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)
commit8e266b9eeffa3c1fc4dca0081c0553f8c2a488c0
tree646c238b7dce3cc0d542ec83d8c571e9b049bddf
parent58133a96c894c043e48c74ddf0bfe8db90bac62f
Link against libcrypto, not all of openssl

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