This is new breakage with libressl-2.7.0 - this problem didn't exist with libressl-2.6.4. [ebuild R ] dev-lang/php-7.2.3:7.2::gentoo USE="acl apache2 bcmath bzip2 cgi cli ctype curl exif fileinfo filter ftp gd gdbm gmp hash iconv imap intl ipv6 json libressl mhash mysql mysqli nls pcntl pdo phar posix readline session simplexml snmp sockets spell sqlite ssl sysvipc threads tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter xslt zip zlib -argon2 -berkdb -calendar -cdb -cjk -coverage -debug -embed -enchant -firebird -flatfile -fpm -inifile -iodbc -kerberos -ldap -ldap-sasl -libedit -lmdb -mssql -oci8-instant-client -odbc -opcache -phpdbg -postgres -qdbm -recode (-selinux) -session-mm -sharedmem -soap -sodium -systemd {-test} -tidy -tokyocabinet -wddx -webp -xpm -zip-encryption" 0 KiB This results in: ... /bin/sh /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/libtool --silent --preserve-dup-deps --mode=compile /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/libxml/ -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/libxml/ -DPHP_ATOM_INC -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/include -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/main -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/imap -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/zip/lib -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/TSRM -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/Zend -D_REENTRANT -I/usr/include -O2 -pipe -march=native -mtune=native -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS -c /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/libxml/libxml.c -o ext/libxml/libxml.lo /bin/sh /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/libtool --silent --preserve-dup-deps --mode=compile /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/meta_ccld -Iext/openssl/ -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/ -DPHP_ATOM_INC -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/include -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/main -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/date/lib -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/imap -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/mbstring/libmbfl/mbfl -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/zip/lib -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/TSRM -I/var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/Zend -D_REENTRANT -I/usr/include -O2 -pipe -march=native -mtune=native -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS -c /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c -o ext/openssl/openssl.lo /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:573:12: error: static declaration of ‘RSA_set0_key’ follows non-static declaration static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) ^~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:401:5: note: previous declaration of ‘RSA_set0_key’ was here int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); ^~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:582:12: error: static declaration of ‘RSA_set0_factors’ follows non-static declaration static int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) ^~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:406:5: note: previous declaration of ‘RSA_set0_factors’ was here int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q); ^~~~~~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:590:12: error: static declaration of ‘RSA_set0_crt_params’ follows non-static declaration static int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) ^~~~~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:404:5: note: previous declaration of ‘RSA_set0_crt_params’ was here int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp); ^~~~~~~~~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:599:13: error: static declaration of ‘RSA_get0_key’ follows non-static declaration static void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ^~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:399:6: note: previous declaration of ‘RSA_get0_key’ was here void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, ^~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:606:13: error: static declaration of ‘RSA_get0_factors’ follows non-static declaration static void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) ^~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:405:6: note: previous declaration of ‘RSA_get0_factors’ was here void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q); ^~~~~~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:612:13: error: static declaration of ‘RSA_get0_crt_params’ follows non-static declaration static void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) ^~~~~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:47:0: /usr/include/openssl/rsa.h:402:6: note: previous declaration of ‘RSA_get0_crt_params’ was here void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, ^~~~~~~~~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:619:13: error: static declaration of ‘DH_get0_pqg’ follows non-static declaration static void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) ^~~~~~~~~~~ In file included from /usr/include/openssl/dsa.h:83:0, from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48: /usr/include/openssl/dh.h:193:6: note: previous declaration of ‘DH_get0_pqg’ was here void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, ^~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:626:12: error: static declaration of ‘DH_set0_pqg’ follows non-static declaration static int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) ^~~~~~~~~~~ In file included from /usr/include/openssl/dsa.h:83:0, from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48: /usr/include/openssl/dh.h:195:5: note: previous declaration of ‘DH_set0_pqg’ was here int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); ^~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:635:13: error: static declaration of ‘DH_get0_key’ follows non-static declaration static void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) ^~~~~~~~~~~ In file included from /usr/include/openssl/dsa.h:83:0, from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48: /usr/include/openssl/dh.h:196:6: note: previous declaration of ‘DH_get0_key’ was here void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); ^~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:641:12: error: static declaration of ‘DH_set0_key’ follows non-static declaration static int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) ^~~~~~~~~~~ In file included from /usr/include/openssl/dsa.h:83:0, from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48: /usr/include/openssl/dh.h:197:5: note: previous declaration of ‘DH_set0_key’ was here int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); ^~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:649:13: error: static declaration of ‘DSA_get0_pqg’ follows non-static declaration static void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) ^~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48:0: /usr/include/openssl/dsa.h:262:6: note: previous declaration of ‘DSA_get0_pqg’ was here void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, ^~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:665:13: error: static declaration of ‘DSA_get0_key’ follows non-static declaration static void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) ^~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:48:0: /usr/include/openssl/dsa.h:265:6: note: previous declaration of ‘DSA_get0_key’ was here void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key); ^~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:679:29: error: static declaration of ‘ASN1_STRING_get0_data’ follows non-static declaration static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1) ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/openssl/objects.h:960:0, from /usr/include/openssl/evp.h:86, from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:45: /usr/include/openssl/asn1.h:788:22: note: previous declaration of ‘ASN1_STRING_get0_data’ was here const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); ^~~~~~~~~~~~~~~~~~~~~ /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:686:12: error: static declaration of ‘X509_get_signature_nid’ follows non-static declaration static int X509_get_signature_nid(const X509 *x) ^~~~~~~~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-lang/php-7.2.3/work/sapis-build/cli/ext/openssl/openssl.c:50:0: /usr/include/openssl/x509.h:921:5: note: previous declaration of ‘X509_get_signature_nid’ was here int X509_get_signature_nid(const X509 *x); ^~~~~~~~~~~~~~~~~~~~~~ make: *** [Makefile:501: ext/openssl/openssl.lo] Error 1 make: *** Waiting for unfinished jobs....
Created attachment 525154 [details] emerge --info output
Created attachment 525212 [details, diff] Fix for php-7.2.3 compile failure with libressl-2.7.0 This is the first (beta!) cut of a patch that fixes this bug and allows php to compile. It is compile tested with (php-7.2.3 and libressl-2.7.0) and appears to produce a php system binary and apache module that runs normally. Note: not tested against any other versions of either libressl or php.
All bug reporters, can you please test against dev-libs/libressl-2.7.1
- Upgraded to libressl-2.7.1 - Tested by not applying the patch, attempting to recompile (fails) - Tested again applying the patch, (compile succeeds) => no change in compile behaviour or changes to the patch with the update to 2.7.1.
(In reply to Reuben Farrelly from comment #4) > - Upgraded to libressl-2.7.1 > - Tested by not applying the patch, attempting to recompile (fails) > - Tested again applying the patch, (compile succeeds) > > => no change in compile behaviour or changes to the patch with the update to > 2.7.1. okay i'm cc-ing the php team to see how they want to proceed with this. can we add that patch contingent on USE=libressl or it that not an approach you want to take?
Can you create an upstream bug and pull-request? These things actually get fixed pretty quick in the current (7.2.x) branch, so you might find that it winds up in the next bugfix release without having to patch. The PR will initiate a CI run, too.
The bug report and patch looks to now have been created upstream: https://bugs.php.net/bug.php?id=76174
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8af50b8b4257360017447d012a08ca968a7c2a7 commit d8af50b8b4257360017447d012a08ca968a7c2a7 Author: Aaron Bauman <bman@gentoo.org> AuthorDate: 2018-04-30 00:14:35 +0000 Commit: Aaron Bauman <bman@gentoo.org> CommitDate: 2018-04-30 00:14:48 +0000 dev-lang/php: add LibreSSL compatibility patch This patch fixes building with >=dev-libs/libressl-2.7.x. Patch taken from upstream bug https://bugs.php.net/bug.php?id=76174. Hopefully this will be included in future releases to properly detect LibreSSL versions due to API differences. Closes: https://bugs.gentoo.org/651308 Package-Manager: Portage-2.3.31, Repoman-2.3.9 dev-lang/php/files/libressl-compatibility.patch | 65 +++++++++++++++++++++++++ dev-lang/php/php-7.0.29.ebuild | 7 ++- dev-lang/php/php-7.0.30.ebuild | 7 ++- dev-lang/php/php-7.1.16.ebuild | 7 ++- dev-lang/php/php-7.1.17.ebuild | 5 ++ dev-lang/php/php-7.2.5.ebuild | 5 ++ 6 files changed, 93 insertions(+), 3 deletions(-)