php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77288 configure bug with static openssl 1.1.1
Submitted: 2018-12-12 15:56 UTC Modified: 2020-08-12 19:14 UTC
Votes:6
Avg. Score:3.8 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:6 (100.0%)
From: tessus@php.net Assigned:
Status: Open Package: *Configuration Issues
PHP Version: 7.2.13 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
33 - 11 = ?
Subscribe to this entry?

 
 [2018-12-12 15:56 UTC] tessus@php.net
Description:
------------
I run into an error when trying to configure PHP 7.2.13 with a static
openssl 1.1.1 library. The strange thing however is that using a static openssl
1.0.2 library works.

The error is as follows:

checking for OpenSSL version... >= 1.0.1
checking for CRYPTO_free in -lcrypto... yes
checking for SSL_CTX_set_ssl_version in -lssl... no
configure: error: libssl not found!

I've also tried to set:
export PKG_CONFIG_PATH=/usr/local/ssl-1.1.1/lib/pkgconfig/

But it did not help.

Here's my config.log: https://evermeet.cx/pub/logs/config.log

So linking against a static openssl 1.0.2 works, but against a static
openssl 1.1.1 does not work.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-23 02:39 UTC] tessus@php.net
For some strange reason the "-lpthread" in OPENSSL_LIBS is ignored. It is necessary though, because the configure process does not add it even though it's needed for openssl.

Adding it to LIBS solved the issue.

This is the command that finally worked (my static OpenSSL 1.1.1 is in /usr/local/ssl-1.1.1):

./configure [snip] --with-openssl=/usr/local/ssl-1.1.1 [snip]
CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LIBS="-lpthread"
OPENSSL_LIBS="-L/usr/local/ssl-1.1.1/lib -l:libssl.a -l:libcrypto.a -ldl
-lpthread" OPENSSL_CFLAGS="-I/usr/local/ssl-1.1.1/include"
 [2019-10-23 19:07 UTC] tessus@php.net
Info from Jan Ehrhardt:

In the next releases (7.2.25 and 7.3.12) '-pthread' in OPENSSL_LIBS will not be ignored any longer for static openssl linking.
 [2020-08-11 15:03 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-08-11 15:03 UTC] cmb@php.net
> In the next releases (7.2.25 and 7.3.12) '-pthread' in
> OPENSSL_LIBS will not be ignored any longer for static openssl
> linking.

So, is that the case?
 [2020-08-12 01:38 UTC] tessus@php.net
I have no idea, since I haven't changed my build script, which still looks like this:

./configure [snip] --with-openssl=/usr/local/ssl-1.1.1 [snip] CFLAGS=-/usr/local/include LDFLAGS=-L/usr/local/lib LIBS="-lpthread" OPENSSL_LIBS="-L/usr/local/ssl-1.1.1/lib -l:libssl.a -l:libcrypto.a -ldl -lpthread" OPENSSL_CFLAGS="-I/usr/local/ssl-1.1.1/include"
 [2020-08-12 02:01 UTC] tessus@php.net
Just tested the following configure line (the one that worked with 1.0.2) and it did not work:

./configure [snip] --with-openssl=/usr/local/ssl-1.1.1 [snip] CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib

I tried with and without:
export PKG_CONFIG_PATH=/usr/local/ssl-1.1.1/lib/pkgconfig/

Same error as before (same name, new log file): https://evermeet.cx/pub/logs/config.log
 [2020-08-12 10:29 UTC] cmb@php.net
-Status: Feedback +Status: Open -Assigned To: cmb +Assigned To:
 [2020-08-12 10:29 UTC] cmb@php.net
Probably relevant error message:

/bin/ld: /usr/local/ssl-1.1.1/lib/libcrypto.a(threads_pthread.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
/bin/ld: note: 'pthread_rwlock_wrlock@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
 [2020-08-12 19:14 UTC] tessus@php.net
This time I added OPENSSL_LIBS=-lpthread, but it still doesn't work.
Same messge in config.log: https://evermeet.cx/pub/logs/config.1.log

>So, is that the case?

So apparently it is not.

Either way, I find it rather strange that the build process checks that there's only a static lib in the specified openssl path, but yet the pthread lib is not added automatically (why not hardcode that? if static, add pthread).

So the current build process does not only ignore pkgconfig, but also OPENSSL_LIBS. Thus nothing was fixed.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Sep 25 07:01:23 2020 UTC