-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake is not generating unbound/config.h correctly with openssl 1.1 #2402
Comments
+help wanted |
(for housekeeping, referencing #2133) |
On my build machine, this appears to be the result of a stale CMakeCache.txt. I.e., it was generated far back in the past, when the machine had OpenSSL 1.0 installed. Later I upgraded the OS, which brought in OpenSSL 1.1. The old value for HAVE_EVP_MD_CTX_NEW (empty, false) was in the CMakeCache.txt file so cmake didn't bother to run the check again. Deleting the cache file, or just deleting the line with HAVE_EVP_MD_CTX_NEW and rerunning cmake to regenerate the CMakeFiles worked. |
I removed ~/.cmake and cloned to a fresh directory. When I run cmake -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-armv8" ../.. as in the "release-static-linux-armv8" Makefile target, EVP_MD_CTX_new is not found: -- Looking for EVP_MD_CTX_new If I just run cmake -D CMAKE_BUILD_TYPE=release ../.. then it is found: -- Looking for EVP_MD_CTX_new |
Perhaps you have no static libcrypto library? |
-- Found OpenSSL: /usr/lib/aarch64-linux-gnu/libssl.a;/usr/lib/aarch64-linux-gnu/libcrypto.a (found version "1.1.0f") Package: libssl-dev |
CMakeFiles/CMakeOutput.log should have some info about the check, can you find anything in there for EVP_MD_CTX_new ? |
Determining if the function EVP_MD_CTX_new exists failed with the following output: Run Build Command:"/usr/bin/make" "cmTC_34550/fast" |
OK, that explains it. They now have a dependency on libpthread. Linking a shared library pulls in the dependency automatically, but using a static library doesn't. But in the meantime, all the other OpenSSL function checks should be failing this same way. Are they? |
Yes the other OpenSSL function checks like EVP_sha* fail with undefined references to pthread also. |
I would have expected pkg-config to have included -lpthread in the libssl/libcrypto dependencies. You may just have to edit the CMakeLists.txt file to add this. Not sure how to do this portably though. |
Hello, |
What version of openssl? I would have expected ubuntu-14.04 to use openssl 1.0. For now I have avoided the issue by using openssl 1.0 instead of 1.1 |
`~ > dpkg -l | grep libssl ii libssl-dev:amd64 1.1.0f-2~ubuntu14.04.1+deb.sury.org+1 amd64 Secure Sockets Layer toolkit - development files ii libssl0.9.8:i386 0.9.8o-7ubuntu3.2.14.04.1 i386 SSL shared libraries ii libssl1.0.0:amd64 1.0.2k-1+deb.sury.org~trusty+1 amd64 Secure Sockets Layer toolkit - shared libraries ii libssl1.0.0:i386 1.0.2k-1+deb.sury.org~trusty+1 i386 Secure Sockets Layer toolkit - shared libraries rc libssl1.0.2:amd64 1.0.2l-0~ubuntu14.04.1+deb.sury.org+1 amd64 Secure Sockets Layer toolkit - shared libraries ii libssl1.1:amd64 1.1.0f-2~ubuntu14.04.1+deb.sury.org+1 amd64 Secure Sockets Layer toolkit - shared libraries` |
What's in your |
On arch mine has
Which is an obvious packaging bug. They should have added -lpthread to Libs.private. If you add it there yourself, you should be able to get past this problem. |
~ > cat /usr/lib/x86_64-linux-gnu/pkgconfig/libcrypto.pc Name: OpenSSL-libcrypto |
Edit the file, add |
Thank you, but I alreade builded src before posting about problem this way: |
This example uses debian stretch, aarch64, openssl 1.1.0f:
https://build.getmonero.org/builders/monero-static-debian-armv8/builds/1737/steps/compile/logs/stdio
/home/buildbot/slave/monero-static-debian-armv8/build/external/unbound/validator/val_secalgo.c:637:34: error: invalid application of 'sizeof' to an incomplete type
'EVP_MD_CTX' (aka 'struct evp_md_ctx_st') ctx = (EVP_MD_CTX*)malloc(sizeof(*ctx));
On IRC hyc confirms the same issue for him with openssl 1.1
Manually editing unbound/config.h to #define HAVE_EVP_MD_CTX_NEW works.
This issue is to solicit help figuring out why configure_checks.cmake doesn't find EVP_MD_CTX_new
The text was updated successfully, but these errors were encountered: