On 2018/05/16 12:27, Reyk Floeter wrote:
> On Wed, May 16, 2018 at 11:11:31AM +0100, Stuart Henderson wrote:
> > On 2018/05/16 11:55, Reyk Floeter wrote:
> > > Hi,
> > > 
> > > On Tue, May 15, 2018 at 11:46:45PM +0200, Reyk Floeter wrote:
> > > > attached is a new port, sysutils/cloud-agent.  I wrote this tool
> > > > myself and you can find it on https://github.com/reyk/cloud-agent.
> > > 
> > > New version of the port, with the following changes:
> > > 
> > > - Added expat to WANTLIB (pointed out by Rafael)
> > > - Uploaded my own release tarball (pointed out by Stuart,
> > > see https://www.conserver.com/pipermail/users/2018-March/msg00005.html)
> > > 
> > > new pkg/DESCR:
> > > ---
> > > This is a simple OpenBSD-specific agent that handles provisioning and
> > > cloud initialization on clouds such as Microsoft Azure, Amazon AWS,
> > > Apache CloudStack, or OpenStack.
> > > ---
> > > 
> > > OK?
> > > 
> > > Reyk
> > 
> > Seems ssl isn't actually linked (I'm not sure what purpose DPADD servers
> > in agent/Makefile?)  So I think WANTLIB should be "c crypto tls expat".
> > 
> > Otherwise OK.
> > 
> 
> Well, it does link with libssl, libcrypto, and libtls.  It works
> because libtls is linked against libssl and libcrypto and our linker
> is smart enough to handle those inter-library dependencies.
> 
> But it doesn't work with static linking (make LDSTATIC=-static) and
> LDADD should really be "LDADD+= -lexpat -ltls -lssl -lcrypto".
> 
> I will fix it in the next upstream version of cloud-agent but I think
> that the current port with "WANTLIB= c tls ssl crypto expat" is fine.
> 
> Unless there are issues on non-amd64/i386 platforms?  I don't have
> access to any of them at the moment.
> 
> $ grep LDADD Makefile
> LDADD+=         -lexpat -ltls
> $ ldd obj/cloud-agent
> obj/cloud-agent:
>         Start            End              Type  Open Ref GrpRef Name
>         0000189a1b400000 0000189a1b60e000 exe   1    0   0      
> obj/cloud-agent
>         0000189d01b2d000 0000189d01d58000 rlib  0    1   0      
> /usr/lib/libexpat.so.12.0
>         0000189c8a57e000 0000189c8a78e000 rlib  0    1   0      
> /usr/lib/libtls.so.17.1
>         0000189c8bb95000 0000189c8be77000 rlib  0    1   0      
> /usr/lib/libc.so.92.3
>         0000189c9ea0f000 0000189c9edef000 rlib  0    2   0      
> /usr/lib/libcrypto.so.43.1
>         0000189d0d3bd000 0000189d0d611000 rlib  0    1   0      
> /usr/lib/libssl.so.45.1
>         0000189d08200000 0000189d08200000 ld.so 0    1   0      
> /usr/libexec/ld.so
> 
> Reyk
> 

ldd shows too much information for ports WANTLIB purposes, look at
readelf -d or objdump -p:

$ readelf -d libexec/cloud-agent bin/cms

File: libexec/cloud-agent

Dynamic section at offset 0xcb18 contains 18 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libexpat.so.12.0]
 0x0000000000000001 (NEEDED)             Shared library: [libtls.so.17.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.92.3]
 0x0000000000000004 (HASH)               0x107a20
 0x0000000000000005 (STRTAB)             0x108908
 0x0000000000000006 (SYMTAB)             0x107d98
 0x000000000000000a (STRSZ)              1009 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x20cc98
 0x0000000000000002 (PLTRELSZ)           2376 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x108e08
 0x0000000000000007 (RELA)               0x108d00
 0x0000000000000008 (RELASZ)             264 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          5
 0x0000000000000000 (NULL)               0x0

File: bin/cms

Dynamic section at offset 0x25208 contains 17 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.43.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.92.3]
 0x0000000000000004 (HASH)               0x113660
 0x0000000000000005 (STRTAB)             0x1168c8
 0x0000000000000006 (SYMTAB)             0x114120
 0x000000000000000a (STRSZ)              6926 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x225378
 0x0000000000000002 (PLTRELSZ)           8568 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x11abb0
 0x0000000000000007 (RELA)               0x1183d8
 0x0000000000000008 (RELASZ)             10200 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          308
 0x0000000000000000 (NULL)               0x0

So libssl is only pulled in via inter library link, it doesn't matter to
the package if libssl gets a revision bumped because it's only libtls that
depends on the ABI.

Reply via email to