Bug #78823 [Opn]: ZLIB_LIBS not added to EXTRA_LIBS
Edit report at https://bugs.php.net/bug.php?id=78823&edit=1
ID: 78823
User updated by: build+php at de-korte dot org
Reported by: build+php at de-korte dot org
Summary: ZLIB_LIBS not added to EXTRA_LIBS
Status: Open
Type: Bug
Package: *Compile Issues
Operating System: Linux
PHP Version: 7.4.0RC6
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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
Thread (6 messages)