Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
1.17.2
-
None
-
Ubuntu 20.04
CMake 3.16.0
GCC 9.3.0
Description
I created a very simple CMake project (see attached files) to test static linkage of OpenSSL but I go the following error message:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5' |
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line |
collect2: error: ld returned 1 exit status |
Steps to reproduce:
mkdir build
|
cd build
|
|
|
cmake -DBUILD_SHARED_LIBS=OFF -DOPENSSL_USE_STATIC_LIBS=ON ..
|
|
|
make -j 6 |
N.B.: If OPENSSL_USE_STATIC_LIBS is unset (or set to OFF), .so are used and compilation works.