]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Link against libcrypto, not all of openssl
authorDave Reisner <dreisner@archlinux.org>
Wed, 13 Feb 2019 15:27:51 +0000 (10:27 -0500)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 13 Feb 2019 17:36:57 +0000 (09:36 -0800)
In the previous build setup, libkmod.so would link to not just
libcrypto.so, but also libssl.so:

$ readelf -d /lib/libkmod.so | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [liblzma.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.1.1]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

We don't need any symbols from libssl, though. This patch ensures that
we pass 'libcrypto' to pkgconfig rather than 'openssl', getting only the
library that we need:

$ readelf -d  ./libkmod/.libs/libkmod.so.2.3.4 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [liblzma.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

Makefile.am
configure.ac

index ddb25f04f4f1dfea2561ff4e43b702cfa0b1c0fd..758f4f03a42b819863b6f9a1ad98323722586d62 100644 (file)
@@ -35,8 +35,8 @@ SED_PROCESS = \
        -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
        -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
        -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
-       -e 's,@openssl_CFLAGS\@,${openssl_CFLAGS},g' \
-       -e 's,@openssl_LIBS\@,${openssl_LIBS},g' \
+       -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
+       -e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \
        < $< > $@ || rm $@
 
 %.pc: %.pc.in Makefile
@@ -89,7 +89,7 @@ libkmod_libkmod_la_DEPENDENCIES = \
        ${top_srcdir}/libkmod/libkmod.sym
 libkmod_libkmod_la_LIBADD = \
        shared/libshared.la \
-       ${liblzma_LIBS} ${zlib_LIBS} ${openssl_LIBS}
+       ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
 
 noinst_LTLIBRARIES += libkmod/libkmod-internal.la
 libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
index ee72283e1d1334c6244e71943206647a7c9101cb..dffe278990f8d6834820bd18466abe009f1245b0 100644 (file)
@@ -110,12 +110,12 @@ AC_ARG_WITH([openssl],
        AS_HELP_STRING([--with-openssl], [handle PKCS7 signatures @<:@default=disabled@:>@]),
        [], [with_openssl=no])
 AS_IF([test "x$with_openssl" != "xno"], [
-       PKG_CHECK_MODULES([openssl], [openssl >= 1.1.0])
+       PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0])
        AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.])
 ], [
        AC_MSG_NOTICE([openssl support not requested])
 ])
-CC_FEATURE_APPEND([with_features], [with_openssl], [OPENSSL])
+CC_FEATURE_APPEND([with_features], [with_openssl], [LIBCRYPTO])
 
 AC_ARG_WITH([bashcompletiondir],
        AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),