Bug 223171

Summary: dns/unbound: Respect $OPENSSLBASE
Product: Ports & Packages Reporter: Thierry Thomas <thierry>
Component: Individual Port(s)Assignee: Thierry Thomas <thierry>
Status: Closed Works As Intended    
Severity: Affects Some People CC: jaap
Priority: --- Flags: jaap: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 223170    
Bug Blocks:    
Attachments:
Description Flags
Link with ssl in $OPENSSLBASE none

Description Thierry Thomas freebsd_committer freebsd_triage 2017-10-22 16:28:00 UTC
Created attachment 187372 [details]
Link with ssl in $OPENSSLBASE

USES=ssl is set correctly in Makefile, but configure ignore it, and libunbound.so is always linked against libssl.so provided by the base SSL:

ldd /usr/local/lib/libunbound.so
/usr/local/lib/libunbound.so:
        libssl.so.8 => /usr/lib/libssl.so.8 (0x8012bf000)
        libutil.so.9 => /lib/libutil.so.9 (0x801531000)
        libevent-2.1.so.6 => /usr/local/lib/libevent-2.1.so.6 (0x801745000)
        libcrypto.so.8 => /lib/libcrypto.so.8 (0x801a00000)
        libthr.so.3 => /lib/libthr.so.3 (0x801e69000)
        libc.so.7 => /lib/libc.so.7 (0x800825000)

When you link it from another port, you get this warning:

/usr/bin/ld: warning: libssl.so.8, needed by /usr/local/lib/libunbound.so, may conflict with libssl.so.9
/usr/bin/ld: warning: libcrypto.so.8, needed by /usr/local/lib/libunbound.so, may conflict with libcrypto.so.9

and actually this might cause hard to debug problems.

The proposed patch fixes the problem. After this fix:

ldd /usr/local/lib/libunbound.so
/usr/local/lib/libunbound.so:
        libssl.so.9 => /usr/local/lib/libssl.so.9 (0x8012c0000)
        libutil.so.9 => /lib/libutil.so.9 (0x801535000)
        libevent-2.1.so.6 => /usr/local/lib/libevent-2.1.so.6 (0x801749000)
        libcrypto.so.9 => /usr/local/lib/libcrypto.so.9 (0x801a00000)
        libthr.so.3 => /lib/libthr.so.3 (0x801e75000)
        libc.so.7 => /lib/libc.so.7 (0x800825000)
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2017-10-22 16:30:10 UTC
libevent should be fixed too: please see PR 223170
Comment 2 Jaap Akkerhuis 2017-10-24 14:53:00 UTC
Are you sure you have set in /etc/make.conf

DEFAULT_VERSIONS+=ssl=openssl

That is needed when using openssl from the ports
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2017-10-24 16:33:55 UTC
(In reply to jaap from comment #2)

Yes, I do:
$ cd /usr/ports/dns/unbound
$ make -V DEFAULT_VERSIONS
ssl=openssl

And this is taken into account:

$ make -V OPENSSLBASE
/usr/local
Comment 4 Jaap Akkerhuis 2017-10-24 17:06:59 UTC
That is odd. I cannot reproduce the problem. Ca yiu sent me the log of a fresh built?
Comment 5 Thierry Thomas freebsd_committer freebsd_triage 2017-10-25 19:14:45 UTC
You're right.

I reset everything and rebuilt unbound without my patch, and now it's OK. That's strange, probably something was misconfigured on my side, but I don't see what...

Sorry for the false alert.