diff options
author | Brent Cook <busterb@gmail.com> | 2020-08-20 09:30:21 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2020-10-04 03:50:18 -0500 |
commit | fe42a8011b25797afa48cf0359c7e2753b2ece5f (patch) | |
tree | 71b7ae8e5f29f90bbd7b24ac6bab81f4990b555a | |
parent | 17c88164016df821df2dff4b2b1291291ec4f28a (diff) | |
download | portable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.tar.gz portable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.tar.bz2 portable-fe42a8011b25797afa48cf0359c7e2753b2ece5f.zip |
Configure libtls and nc(1) to statically link to libcrypto/ssl
An issue that Reyk Floeter noted while building a Debian package for
LibreSSL is that installing libtls along with OpenSSL causes linker
issues since it will often pick up the wrong libcrypto/libssl. This
change makes libtls statically link the object files it needs rather
than relying on the shared libraries, effectively making libtls
self-contained and able to be packaged independently.
This should make it possible for other projects that also use libtls to
be able to package support without requiring the target OS to ship
libcrypto / libssl from LibreSSL.
https://salsa.debian.org/reyk-guest/libressl/-/commit/678278df55ce866f2f363998ca690442fa786c66
-rw-r--r-- | apps/nc/Makefile.am | 6 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | libtls.pc.in | 3 | ||||
-rw-r--r-- | tls/Makefile.am | 6 |
4 files changed, 8 insertions, 10 deletions
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am index 4b5b561..135ff4b 100644 --- a/apps/nc/Makefile.am +++ b/apps/nc/Makefile.am | |||
@@ -12,9 +12,9 @@ endif | |||
12 | EXTRA_DIST = nc.1 | 12 | EXTRA_DIST = nc.1 |
13 | EXTRA_DIST += CMakeLists.txt | 13 | EXTRA_DIST += CMakeLists.txt |
14 | 14 | ||
15 | nc_LDADD = $(abs_top_builddir)/crypto/libcrypto.la | 15 | nc_LDFLAGS = $(abs_top_builddir)/crypto/.libs/libcompat.a |
16 | nc_LDADD += $(abs_top_builddir)/ssl/libssl.la | 16 | |
17 | nc_LDADD += $(abs_top_builddir)/tls/libtls.la | 17 | nc_LDADD = $(abs_top_builddir)/tls/libtls.la |
18 | nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD) | 18 | nc_LDADD += $(PLATFORM_LDADD) $(PROG_LDADD) |
19 | 19 | ||
20 | AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat | 20 | AM_CPPFLAGS += -I$(top_srcdir)/apps/nc/compat |
diff --git a/configure.ac b/configure.ac index 75b88fe..3aca617 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -29,8 +29,7 @@ USER_CFLAGS="$CFLAGS" | |||
29 | AC_PROG_CC([cc gcc]) | 29 | AC_PROG_CC([cc gcc]) |
30 | AC_PROG_CC_STDC | 30 | AC_PROG_CC_STDC |
31 | AM_PROG_CC_C_O | 31 | AM_PROG_CC_C_O |
32 | AC_PROG_LIBTOOL | 32 | LT_INIT([pic-only]) |
33 | LT_INIT | ||
34 | 33 | ||
35 | CHECK_OS_OPTIONS | 34 | CHECK_OS_OPTIONS |
36 | 35 | ||
diff --git a/libtls.pc.in b/libtls.pc.in index 82a6a71..0d4e625 100644 --- a/libtls.pc.in +++ b/libtls.pc.in | |||
@@ -9,8 +9,7 @@ Name: LibreSSL-libtls | |||
9 | Description: Secure communications using the TLS socket protocol. | 9 | Description: Secure communications using the TLS socket protocol. |
10 | Version: @VERSION@ | 10 | Version: @VERSION@ |
11 | Requires: | 11 | Requires: |
12 | Requires.private: libcrypto libssl | ||
13 | Conflicts: | 12 | Conflicts: |
14 | Libs: -L${libdir} -ltls | 13 | Libs: -L${libdir} -ltls |
15 | Libs.private: @LIBS@ -lcrypto -lssl @PLATFORM_LDADD@ | 14 | Libs.private: @LIBS@ @PLATFORM_LDADD@ |
16 | Cflags: -I${includedir} | 15 | Cflags: -I${includedir} |
diff --git a/tls/Makefile.am b/tls/Makefile.am index 942abf9..c4790a4 100644 --- a/tls/Makefile.am +++ b/tls/Makefile.am | |||
@@ -7,9 +7,9 @@ EXTRA_DIST += CMakeLists.txt | |||
7 | EXTRA_DIST += tls.sym | 7 | EXTRA_DIST += tls.sym |
8 | 8 | ||
9 | libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym | 9 | libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym |
10 | libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la | 10 | libtls_la_LDFLAGS += $(abs_top_builddir)/ssl/.libs/libssl.a |
11 | libtls_la_LIBADD += $(abs_top_builddir)/crypto/libcrypto.la | 11 | libtls_la_LDFLAGS += $(abs_top_builddir)/crypto/.libs/libcrypto.a |
12 | libtls_la_LIBADD += $(PLATFORM_LDADD) | 12 | libtls_la_LIBADD = $(PLATFORM_LDADD) |
13 | 13 | ||
14 | libtls_la_CPPFLAGS = $(AM_CPPFLAGS) | 14 | libtls_la_CPPFLAGS = $(AM_CPPFLAGS) |
15 | if OPENSSLDIR_DEFINED | 15 | if OPENSSLDIR_DEFINED |