Build environment:

OpenBSD 5.7-release (x64) with all latest patches applied via Mtier openup utility.
LibreSSL 2.2.0
OpenSMTPD 5.7.1-rc1

I'm having difficulty getting OpenSMTPD 5.7.1-rc1 to build and link the /usr/sbin/smtpd binary to the proper /usr/local/lib/libssl.so.32.0 library provided by LibreSSL 2.2.0. Only the libcrypto library is being linked.

$ ldd /usr/sbin/smtpd|grep -E "lib(ssl|crypto)"
00001b5dca38c000 00001b5dca7eb000 rlib 0 1 0 /usr/lib/libssl.so.32.0 00001b5d18179000 00001b5d18749000 rlib 0 1 0 /usr/local/lib/libcrypto.so.33.0

I ran into this problem earlier with the OpenSMTPD 5.4.4 release on an OpenBSD 5.6 system patched with LibreSSL 2.1.4. I found a successful workaround by using the following flags with make

$ sudo CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib make

This time around, the same trick is only 50% successful, as detailed by the ldd results earlier.

I brought this up with OpenSMTPD developer gilles@ [1] and he suggested I ask on misc@ for suggestions.


[1] ========= gilles@ response =======================================

I was kinda puzzled then miod@ clarified for me, /usr/lib has priority
over /usr/local/lib, if a lib is available in both the one in /usr/lib
is the one used.

Small snippet from cc(1):

           The directories searched include several standard system
           directories *plus* any that you specify with -L.

It is an environment/host issue, I do not know if it can be fixed with
a build option at this point, it needs investigating, I honestly don't
have a clue if it can be worked-around.

I suggest you ask on misc@openbsd.org for suggestions on how to do it,
if it has worked in the past then the ld.so people may have changed it
because our Makefile certainly has not changed.

In the meantime, you can work around at runtime using LD_LIBRARY_PATH:

$ ldd smtpd/smtpd|grep -E "lib(ssl|crypto)"
00001d2e3b43c000 00001d2e3b89b000 rlib 0 1 0 /usr/lib/libssl.so.32.0 00001d2e52d38000 00001d2e53308000 rlib 0 2 0 /usr/lib/libcrypto.so.33.0
$ LD_LIBRARY_PATH=/usr/local/lib ldd smtpd/smtpd|grep -E "lib(ssl|crypto)"
0000141edd36f000 0000141edd7ce000 rlib 0 1 0 /usr/local/lib/libssl.so.32.0 0000141fb51a0000 0000141fb5770000 rlib 0 2 0 /usr/local/lib/libcrypto.so.33.0

Reply via email to