Bug #78823 [Opn->Csd]: ZLIB_LIBS not added to EXTRA_LIBS

From: Date: Thu, 05 Dec 2019 06:25:38 +0000
Subject: Bug #78823 [Opn->Csd]: ZLIB_LIBS not added to EXTRA_LIBS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224070@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78823&edit=1 ID: 78823 Updated by: nikic@php.net Reported by: build+php at de-korte dot org Summary: ZLIB_LIBS not added to EXTRA_LIBS -Status: Open +Status: Closed Type: Bug Package: *Compile Issues Operating System: Linux PHP Version: 7.4.0RC6 Block user comment: N Private report: N New Comment: Automatic comment on behalf of build+github@de-korte.org Revision: http://git.php.net/?p=php-src.git;a=commit;h=ee4295b4ce421003c2e1d2af98066826deb23319 Log: Fix bug #78823: add zlib library to mysqlnd Previous Comments: ------------------------------------------------------------------------ [2019-11-26 07:41:04] cmb@php.net The following pull request has been associated: Patch Name: Fix #78823: add zlib library to mysqlnd On GitHub: https://github.com/php/php-src/pull/4945 Patch: https://github.com/php/php-src/pull/4945.patch ------------------------------------------------------------------------ [2019-11-19 14:56:53] build+php at de-korte dot org The following patch has been added/updated: Patch Name: php-fix-mysqlnd-compression-library.patch Revision: 1574175413 URL: https://bugs.php.net/patch-display.php?bug=78823&patch=php-fix-mysqlnd-compression-library.patch&revision=1574175413 ------------------------------------------------------------------------ [2019-11-18 08:53:46] build+php at de-korte dot org The problem is newer binutils will no longer default to --copy-dt-needed-entries but use --no-copy-dt-needed-entries instead. So all libraries needed must be provided. This is the reason this previously, as openSUSE only recently switched to a binutils where this is changed. Workarounds (either one works) 1) Add "-Wl,--copy-dt-needed-entries" to LDFLAGS to bring back the old behavior of the linker 2) Add "-lz" to LIBS It would be best though to make sure all libraries are explicitly linked in. IN "ext/mysqlnd/mysqlnd_protocol_frame_codec.c" when the "zlib.h" header is included should also trigger adding ZLIB_LIBS to the list of libraries. ------------------------------------------------------------------------ [2019-11-17 18:30:08] build+php at de-korte dot org Error message: [ 1091s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: ext/mysqlnd/.libs/mysqlnd_protocol_frame_codec.o: undefined reference to symbol 'compress' [ 1091s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /lib64/libz.so.1: error adding symbols: DSO missing from command line Libraries passed to the linker: -lcrypt -largon2 -lresolv -lcrypt -lrt -lstdc++ -lrt -lm -ldl -ltinfo -lxml2 -lpcre2-8 -lxml2 -lcrypt -largon2 -lxml2 -lssl -lcrypto -lcrypt Obviously, '-lz' is missing here and adding that to LIBS fixes the build. ------------------------------------------------------------------------ [2019-11-16 22:31:37] build+php at de-korte dot org Description: ------------ Configure finds ZLIB_LIBS='-L/lib64 -lz ' without problems, but these are not added to EXTRA_LIBS despite having --with-zlib=shared. Adding '-lz' manually does fix this, but I wonder why this now breaks. Up to and including 7.3.11 this worked out of the box with similar configure input. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78823&edit=1

« previous php.bugs (#224070) next »