configure: fix the -ldl check for openssl, add -lpthread check - #1427
configure: fix the -ldl check for openssl, add -lpthread check#1427bagder wants to merge 1 commit into
Conversation
The check for if -ldl is needed to build with (a statically built) openssl was broken. This repairs the check, and adds a check for -lpthread as well since OpenSSL 1.1.0+ does in fact require -lpthread so only adding -ldl for a static openssl build is no longer enough. Reported-by: Jay Satiro Fixes #1426
|
@bagder, thanks for your PR! By analyzing the history of the files in this pull request, we identified @yangtse, @dfandrich and @gknauf to be potential reviewers. |
|
Turns out this PR doesn't fix the #1426 case but it did fix my test builds using a static OpenSSL 1.1.0 devel version (from git master) so unless someone objects I intend to merge this soon. It removes the need to specify |
jay
left a comment
There was a problem hiding this comment.
I'm not sure I follow this, it looks like you've changed the -ldl check to only occur when HMAC_Init_ex link fails. Also at this point there may already be -lssl -lcrypto from pkg-config which seems like we could skip these crypto checks then, like in other words imagine
-lpthread -ldl -lcrypto -lssl -lcrypto
but -ldl should come after -lssl shouldn't it?
Yes. When building with a static openssl that requires -ldl, trying to link the library to use HMAC_Init_ex fails. The previous (current) way to check for -ldl is pointless since it will fail to detect openssl completely before even considering the -ldl issue.
Maybe, but I would prefer to have the -ldl and -lpthread checks only get tried when it fails without those libs and I only want to add those specific libs to try to fix the build and not make conclusions or guesses about the other libs that are used or not used. Hence the flow with this patch goes like this:
I've tested this with a static openssl from their git master and with this fix, it works without any custom LIBS set, but without this patch it will fail to detect a static only openssl completely. |
The check for if -ldl is needed to build with (a statically built)
openssl was broken. This repairs the check, and adds a check for
-lpthread as well since OpenSSL 1.1.0+ does in fact require -lpthread so
only adding -ldl for a static openssl build is no longer enough.
Reported-by: Jay Satiro
Fixes #1426