[PHP-DEV] php 7.{3,4}/git ext/curl builds FAIL with recent curl/libcurl 7.67+: "error: ‘CURLE_OBSOLETE20’ undeclared ...".

2019-11-14 Thread PGNet Dev
I needed to bump local curl build version to fix a (php-unrelated) SEGV.  
Currently, I have

curl -V
curl 7.67.1-DEV (x86_64-pc-linux-gnu) libcurl/7.67.1-DEV 
OpenSSL/1.1.1d zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 
(+libidn2/2.2.0) libssh2/1.9.0_DEV nghttp2/1.40.0-DEV
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s 
scp sftp smtp smtps tftp
Features: AsynchDNS brotli HTTP2 HTTPS-proxy IDN IPv6 Largefile 
libz Metalink NTLM NTLM_WB PSL SSL TLS-SRP UnixSockets

Rebuilding my usual PHP7.3/git install,
(add'l note: fwiw, the following issue also occurs with 7.4/git ...)

cd php7

git branch -a | grep \*
* PHP-7.3

git log | head
commit 9083e178f656878cab46aee52b555346ef92a768
Author: Dmitry Stogov 
Date:   Tue Nov 12 12:59:50 2019 +0300

Fixed wrong constant usage

commit ea2a125789d2e6cf7416bd706be1ac44df1367e4
Merge: 4a55794b98 2c9926f156
Author: Stanislav Malyshev 
Date:   Mon Nov 11 23:08:38 2019 -0800

works nicely as usual,

/usr/local/php7/bin/php -v
PHP 7.3.13-dev (cli) (built: Nov 14 2019 19:53:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.13-dev, Copyright (c) 1998-2018 Zend 
Technologies
with Zend OPcache v7.3.13-dev, Copyright (c) 1999-2018, by 
Zend Technologies

But curl extension now fails,

ext/curl/interface.c:778:25: error: ‘CURLE_OBSOLETE20’ undeclared 
(first use in this function); did you mean ‘CURLE_OBSOLETE50’?
  778 |  REGISTER_CURL_CONSTANT(CURLE_FTP_WRITE_ERROR);


Before making noise about in @bugs, wanted to check 1st; known issue? 
additional/new config req'd?

Here's more detail

cd ext/curl

/usr/local/php7/bin/phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No:  20180731
Zend Extension Api No:   320180731

./configure \
--with-php-config=/usr/local/php7/bin/php-config \
--with-curl=/usr/local \
--with-libdir=lib64 \
--enable-shared --disable-static \
--with-gnu-ld
...
checking for cURL support... yes, shared
checking for libcurl.pc... using 
/usr/local/lib64/pkgconfig/libcurl.pc
checking for cURL 7.15.5 or greater... 7.67.1-DEV
checking for SSL support in libcurl... yes
checking how to run the C preprocessor... /usr/bin/cpp-9
checking for openssl support in libcurl... checking for ANSI C 
header files... yes
...
checking for gnutls support in libcurl... no
checking for curl_easy_perform in -lcurl... yes
checking for curl_easy_strerror in -lcurl... yes
checking for curl_multi_strerror in -lcurl... yes
...

, at `make`,

make V=1
/bin/sh /usr/local/src/php7-src/ext/curl/libtool --mode=compile 
/usr/bin/gcc-9  -I. -I/usr/local/src/php7-src/ext/curl -DPHP_ATOM_INC 
-I/usr/local/src/php7-src/ext/curl/include 
-I/usr/local/src/php7-src/ext/curl/main -I/usr/local/src/php7-src/ext/curl 
-I/usr/local/php7/include/php -I/usr/local/php7/include/php/main 
-I/usr/local/php7/include/php/TSRM -I/usr/local/php7/include/php/Zend 
-I/usr/local/php7/include/php/ext -I/usr/local/php7/include/php/ext/date/lib 
-I/usr/local/include  -O3 -Wall -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches 
-march=native -mtune=native -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H  -O3 -Wall 
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables 
-fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native   -c 
/usr/local/src/php7-src/ext/curl/interface.c -o interface.lo
mkdir .libs
 /usr/bin/gcc-9 -I. -I/usr/local/src/php7-src/ext/curl 
-DPHP_ATOM_INC -I/usr/local/src/php7-src/ext/curl/include 
-I/usr/local/src/php7-src/ext/curl/main -I/usr/local/src/php7-src/ext/curl 
-I/usr/local/php7/include/php -I/usr/local/php7/include/php/main 
-I/usr/local/php7/include/php/TSRM -I/usr/local/php7/include/php/Zend 
-I/usr/local/php7/include/php/ext -I/usr/local/php7/include/php/ext/date/lib 
-I/usr/local/include -O3 -Wall -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches 
-march=native -mtune=native -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -O3 -Wall 
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables 
-fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native -c 
/usr/local/src/php7-src/ext/curl/interface.c  -fPIC -DPIC -o .libs/int

Re: [PHP-DEV] Re: php 7.{3,4}/git ext/curl builds FAIL with recent curl/libcurl 7.67+: "error: ‘CURLE_OBSOLETE20’ undeclared ...".

2019-11-15 Thread PGNet Dev
On 11/15/19 1:41 AM, Christoph M. Becker wrote:
> Ah, thanks!  I've just submitted .

applied that patch to local curl/master build

now build of php7/ext/curl

...
make
>>  Build complete.


thx!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: php 7.{3,4}/git ext/curl builds FAIL with recent curl/libcurl 7.67+: "error: ‘CURLE_OBSOLETE20’ undeclared ...".

2019-11-21 Thread PGNet Dev
On 11/15/19 8:15 AM, PGNet Dev wrote:
> On 11/15/19 1:41 AM, Christoph M. Becker wrote:
>> Ah, thanks!  I've just submitted <https://github.com/curl/curl/pull/4601>.
> 
> applied that patch to local curl/master build
> 
> now build of php7/ext/curl

fyi,


bumps to php 7.4/git

git log | head
commit 99b8e67615159fc600a615e1e97f2d1cf18f14cb
Merge: b78ec58f09 e981f5af51
Author: George Wang 
Date:   Thu Nov 21 17:58:44 2019 -0500

Merge branch 'PHP-7.3' into PHP-7.4

commit e981f5af51bf2a16965aad68ae268021dc251c9c
Merge: b4f501d5a4 c7141412ce
Author: George Wang 

and curl/master,

git log | head
commit f70da9c17e315f382694d8ca5585191f4e5478d7
Author: Daniel Stenberg 
Date:   Thu Nov 21 11:37:44 2019 +0100

include: make CURLE_HTTP3 use a new error code

To avoid potential issues with error code reuse.

Reported-by: Christoph M. Becker
Assisted-by: Dan Fandrich

which includes the reworked fix for this issue,


https://github.com/curl/curl/commit/f70da9c17e315f382694d8ca5585191f4e5478d7

does the trick as well,

php -v
PHP 7.4.1-dev (cli) (built: Nov 21 2019 16:45:24) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.1-dev, Copyright (c), by Zend 
Technologies

php -m | grep curl
curl

now just a matter of the fix making it into next curl release.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] current status of php + Openssl 1.1 builds?

2017-04-05 Thread PGNet Dev
What's the current status of Openssl 1.1 builds?

Several references

https://externals.io/thread/661

http://git.php.net/?p=php-src.git;a=commitdiff;h=015a80ef7bb5d691745b6fba35060d996c788a53
https://bugs.php.net/bug.php?id=72360

suggest that it should be 'in' head, at least, if not 71 branch.


But, here, with php HEAD

cd /work/php-src
git clean -xfd
git reset --hard HEAD
git checkout master
git log | head

the 'cleanest' build on linux64 + openssl 1.1 I can manage atm,

*requires* this fix

perl -pi -e '\
 
s|SSLeay_version\(SSLEAY_VERSION\)|OpenSSL_version\(OPENSSL_VERSION\)|g' \
/work/php-src/ext/openssl/openssl.c

then, with simple config

export PHP_RPATHS="/usr/local/openssl11/lib64"
./buildconf --force
./configure \
 --disable-all \
 --with-openssl=/usr/local/openssl11

builds, with lots of warnings, but no apparent errors

make V=1

/bin/sh /work/php-src/libtool --silent --preserve-dup-deps 
--mode=compile /usr/bin/gcc-6  -Iext/openssl/ -I/work/php-src/ext/openssl/ 
-DPHP_ATOM_INC -I/work/php-src/include -I/work/php-src/main -I/work/php-src 
-I/work/php-src/ext/date/lib -I/usr/local/openssl11/include 
-I/work/php-src/TSRM -I/work/php-src/Zend-O3 -Wall -fstack-protector 
-funwind-tables -fasynchronous-unwind-tables -fmessage-length=0 
-grecord-gcc-switches -march=native -mtune=native -fPIC -DPIC -D_GNU_SOURCE 
-fno-strict-aliasing -fvisibility=hidden -DZEND_SIGNALS-c 
/work/php-src/ext/openssl/openssl.c -o ext/openssl/openssl.lo 
/work/php-src/ext/openssl/openssl.c: In function 
‘add_assoc_name_entry’:
/work/php-src/ext/openssl/openssl.c:859:13: warning: implicit 
declaration of function ‘ASN1_STRING_data’ [-Wimplicit-function-declaration]
to_add = ASN1_STRING_data(str);
 ^~~~
/work/php-src/ext/openssl/openssl.c:859:11: warning: assignment 
makes pointer from integer without a cast [-Wint-conversion]
to_add = ASN1_STRING_data(str);
   ^
/work/php-src/ext/openssl/openssl.c: In function 
‘asn1_time_to_time_t’:
/work/php-src/ext/openssl/openssl.c:921:28: warning: cast to 
pointer from integer of different size [-Wint-to-pointer-cast]
  if (timestr_len != strlen((const 
char*)ASN1_STRING_data(timestr))) {
^
In file included from /work/php-src/Zend/zend.h:31:0,
 from /work/php-src/main/php.h:35,
 from /work/php-src/ext/openssl/openssl.c:30:
/work/php-src/ext/openssl/openssl.c:936:19: warning: cast to 
pointer from integer of different size [-Wint-to-pointer-cast]
  strbuf = estrdup((char *)ASN1_STRING_data(timestr));
   ^
/work/php-src/Zend/zend_alloc.h:172:36: note: in definition of 
macro ‘estrdup’
 #define estrdup(s)   _estrdup((s) ZEND_FILE_LINE_CC 
ZEND_FILE_LINE_EMPTY_CC)
^
/work/php-src/ext/openssl/openssl.c: In function 
‘zm_startup_openssl’:
/work/php-src/ext/openssl/openssl.c:1402:2: warning: implicit 
declaration of function ‘SSL_library_init’ [-Wimplicit-function-declaration]
  SSL_library_init();
  ^~~~
/work/php-src/ext/openssl/openssl.c:1403:2: warning: implicit 
declaration of function ‘OpenSSL_add_all_ciphers’ 
[-Wimplicit-function-declaration]
  OpenSSL_add_all_ciphers();
  ^~~
/work/php-src/ext/openssl/openssl.c:1404:2: warning: implicit 
declaration of function ‘OpenSSL_add_all_digests’ 
[-Wimplicit-function-declaration]
  OpenSSL_add_all_digests();
  ^~~
/work/php-src/ext/openssl/openssl.c:1405:2: warning: implicit 
declaration of function ‘OpenSSL_add_all_algorithms’ 
[-Wimplicit-function-declaration]
  OpenSSL_add_all_algorithms();
  ^~
/work/php-src/ext/openssl/openssl.c:1413:2: warning: implicit 
declaration of function ‘SSL_load_error_strings’ 
[-Wimplicit-function-declaration]
  SSL_load_error_strings();
  ^~
/work/php-src/ext/openssl/openssl.c: In function 
‘zm_shutdown_openssl’:
/work/php-src/ext/openssl/openssl.c:1577:2: warning: implicit 
declaration of function ‘EVP_cleanup’ [-Wimplicit-function-declaration]
  EVP_cleanup();
  ^~~
/work/php-src/ext/openssl/openssl.c:1580:2: warning: implicit 
declaration of functi