Skip to content
Snippets Groups Projects
Commit 31ab6ea9 authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

Fix static build

Added to cmake environment CMAKE_DL_LIBS (The name of the library
that has dlopen and dlclose in it, usually -ldl) to openssl build
to add DL library, to fix the following fails:

Linking CXX executable crypto.test
/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x334): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x3f2): undefined reference to `dlerror'
/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x459): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x4c9): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x502): undefined reference to `dlerror'
/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x5a1): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x601): undefined reference to `dlerror'
/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x662): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [test/unit/crypto.test] Error 1
make[1]: *** [test/unit/CMakeFiles/crypto.test.dir/all] Error 2

Closes #4245
parent 6d7ca0e6
No related branches found
No related tags found
No related merge requests found
......@@ -177,7 +177,7 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
endif ()
endif ()
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS})
foreach(_comp IN LISTS OpenSSL_FIND_COMPONENTS)
if(_comp STREQUAL "Crypto")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment