Unique library paths need to be listed first.
Description
When compiling BIND 9.18 on Solaris 11.4 SRU I specifically want to
use OpenSSL 3.0. However, despite giving the path to that library,
using either the command line option (--with-openssl=/usr/openssl/3
)
or via pkgconfig, libtool still linked against OpenSSL 1.0.
The issue with the order in which the library directories are listed on the command linking command line. The directory for libuv comes before libssl and as in this case ssl v1.0 is in the same directory as libuv (/usr/lib) is thus used instead of the next listed path.
To address this in our build environment I've simply patched Makefile.am and Makefile.in, shown below, before running Configure.
Patch modifies Makefile.in and Makefile.am so that OpenSSL 3.0 library
path comes before libuv's path, which is in the default location
where OpenSSL 1.0.2 can also be found!
Patch provided upstream for their information, I expect we shall need
to maintain until OpenSSL 3.0 is the default.
diff -r 07e0fb901363 -r c87ec2edd8d7 lib/isc/Makefile.am
--- a/lib/isc/Makefile.am Thu Jun 09 07:50:32 2022 -0700
+++ b/lib/isc/Makefile.am Thu Jun 09 07:54:32 2022 -0700
@@ -216,8 +216,8 @@
-release "$(PACKAGE_VERSION)"
libisc_la_LIBADD = \
+ $(OPENSSL_LIBS) \
$(LIBUV_LIBS) \
- $(OPENSSL_LIBS) \
$(ZLIB_LIBS)
if HAVE_JEMALLOC
diff -r 07e0fb901363 -r c87ec2edd8d7 lib/isc/Makefile.in
--- a/lib/isc/Makefile.in Thu Jun 09 07:50:32 2022 -0700
+++ b/lib/isc/Makefile.in Thu Jun 09 07:54:32 2022 -0700
@@ -857,7 +857,7 @@
$(AM_LDFLAGS) \
-release "$(PACKAGE_VERSION)"
-libisc_la_LIBADD = $(LIBUV_LIBS) $(OPENSSL_LIBS) $(ZLIB_LIBS) \
+libisc_la_LIBADD = $(OPENSSL_LIBS) $(LIBUV_LIBS) $(ZLIB_LIBS) \
$(am__append_3) $(am__append_5) $(am__append_8) \
$(am__append_10)
@HAVE_CMOCKA_TRUE@SUBDIRS = tests
Request
I'm not really looking for a fix, it does kind of come down to the environement. Just wanted to make folks aware really and perhaps gather some alternative ideas.
An alternative fix could be too Configure to have it work out that non-default library directories should be listed before standard directories. Or perhaps libtool should do that....