|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78823 ZLIB_LIBS not added to EXTRA_LIBS
Submitted: 2019-11-16 22:31 UTC Modified: 2019-11-18 08:53 UTC
From: build+php at de-korte dot org Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 7.4.0RC6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: build+php at de-korte dot org
New email:
PHP Version: OS:


 [2019-11-16 22:31 UTC] build+php at de-korte dot org
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.


php-fix-mysqlnd-compression-library.patch (last revision 2019-11-19 14:56 UTC by build+php at de-korte dot org)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-11-17 18:30 UTC] 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/ 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-18 08:53 UTC] 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-19 14:56 UTC] build+php at de-korte dot org
The following patch has been added/updated:

Patch Name: php-fix-mysqlnd-compression-library.patch
Revision:   1574175413
 [2019-11-26 07:41 UTC]
The following pull request has been associated:

Patch Name: Fix #78823: add zlib library to mysqlnd
On GitHub:
 [2019-12-05 06:25 UTC]
Automatic comment on behalf of
Log: Fix bug #78823: add zlib library to mysqlnd
 [2019-12-05 06:25 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 11:01:31 2024 UTC