Bug #74969 [Asn->Csd]: Broken build with libsodium 1.0.0 and macro redifinitions

From: Date: Mon, 24 Jul 2017 08:38:23 +0000
Subject: Bug #74969 [Asn->Csd]: Broken build with libsodium 1.0.0 and macro redifinitions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210258@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74969&edit=1 ID: 74969 Updated by: kalle@php.net Reported by: ab@php.net Summary: Broken build with libsodium 1.0.0 and macro redifinitions -Status: Assigned +Status: Closed Type: Bug Package: Compile Failure Operating System: Debian Jessie PHP Version: 7.2Git-2017-07-22 (Git) Assigned To: jedisct1 Block user comment: N Private report: N New Comment: Closing per Anatol's comment Previous Comments: ------------------------------------------------------------------------ [2017-07-22 20:47:50] ab@php.net Fix confirmed. For the further, just you to be aware, there's a standard procedure - please check https://wiki.php.net/vcs/gitworkflow for merging rules - once fixed, the ticket can be set to "closed" - updating NEWS (released branches only, except the change is master only) - note to UPGRADING would make sense Thanks! ------------------------------------------------------------------------ [2017-07-22 20:25:02] jedisct1@php.net A configuration-time check for libsodium >= 1.0.8 was added. ------------------------------------------------------------------------ [2017-07-22 17:30:53] ab@php.net Ok, I thought that. Perhaps the right way were to add a version check, also cleaning up the macro redifines while on that. It is definitely not nice to fail in the middle of compilation, where the configure could reject the incompatible version. Fe see what is done for OpenSSL version checks. It can be different on other distros/OSes, here as mentioned 1.0.11 from backports seems OK. However the backports repo has to be extra enabled and the regular repo has a higher priority, so that's not the version installed by default. Thanks. ------------------------------------------------------------------------ [2017-07-22 16:35:20] jedisct1@php.net libsodium 1.0.0 is dead old, we can't reasonably support that. In addition to many missing functions, there were some annoying limitations, such as input/output buffers that couldn't overlap. ------------------------------------------------------------------------ [2017-07-22 12:03:04] ab@php.net Description: ------------ From the config.log 14407 configure:76454: checking for sodium support 14408 configure:76490: result: yes 14409 configure:76502: checking for pkg-config 14410 configure:76533: result: /usr/bin/pkg-config 14411 configure:76541: checking for libsodium 14412 configure:76553: result: version 1.0.0 found using pkg-config Package libsodium-dev: p 1.0.0-1 oldstable 500 i 1.0.11-1~bpo8+1 jessie-backports 100 The package from the backports compiles, the macro redifinition warnings are still present. Same warnings are shown in Windows builds. The extension should either compile with older dependency versions or do a clean error check at the configure time. Thanks. Actual result: -------------- /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c: In function ‘zm_startup_sodium’: /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:419:0: warning: "crypto_kx_PUBLICKEYBYTES" redefined # define crypto_kx_PUBLICKEYBYTES 32 ^ In file included from /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:26:0: /home/anatol/dws/src/php-7.2-nts/ext/sodium/php_libsodium.h:113:0: note: this is the location of the previous definition #define crypto_kx_PUBLICKEYBYTES crypto_scalarmult_SCALARBYTES ^ /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:420:0: warning: "crypto_kx_SECRETKEYBYTES" redefined # define crypto_kx_SECRETKEYBYTES 32 ^ In file included from /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:26:0: /home/anatol/dws/src/php-7.2-nts/ext/sodium/php_libsodium.h:114:0: note: this is the location of the previous definition #define crypto_kx_SECRETKEYBYTES crypto_scalarmult_SCALARBYTES ^ /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c: In function ‘zif_sodium_crypto_aead_chacha20poly1305_ietf_keygen’: /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:2870:20: error: ‘crypto_aead_chacha20poly1305_ietf_KEYBYTES’ undeclared (first use in this function) unsigned char key[crypto_aead_chacha20poly1305_ietf_KEYBYTES]; ^ /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:2870:20: note: each undeclared identifier is reported only once for each function it appears in /home/anatol/dws/src/php-7.2-nts/ext/sodium/libsodium.c:2870:16: warning: unused variable ‘key’ [-Wunused-variable] unsigned char key[crypto_aead_chacha20poly1305_ietf_KEYBYTES]; ^ Makefile:1607: recipe for target 'ext/sodium/libsodium.lo' failed make: *** [ext/sodium/libsodium.lo] Error 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74969&edit=1

« previous php.bugs (#210258) next »