php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67849 error compiling mysqlnd if zlib is compiled shared
Submitted: 2014-08-15 14:35 UTC Modified: 2021-02-02 14:58 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: public at grik dot net Assigned: cmb (profile)
Status: Closed Package: MySQL related
PHP Version: 5.6.0RC4 OS: Linux, OSX 10.9
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: public at grik dot net
New email:
PHP Version: OS:

 

 [2014-08-15 14:35 UTC] public at grik dot net
Description:
------------
trying to compile php 5.6 RC4

separately pdo-mysql and zlib extensions compile successfully, as well as if zlib is not shared, but if zlib is configured as shared, pdo-mysql extension fails to be built

Test script:
---------------
php-5.6.0RC4 gri$ ./configure --disable-all --enable-pdo --with-pdo-mysql --with-zlib=shared
...
php-5.6.0RC4 gri$ make
...
Undefined symbols for architecture x86_64:
  "_compress", referenced from:
      _php_mysqlnd_net_encode_pub in mysqlnd_net.o
  "_uncompress", referenced from:
      _php_mysqlnd_net_decode_pub in mysqlnd_net.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1

Expected result:
----------------
build successful

Actual result:
--------------
Undefined symbols for architecture x86_64:
  "_compress", referenced from:
      _php_mysqlnd_net_encode_pub in mysqlnd_net.o
  "_uncompress", referenced from:
      _php_mysqlnd_net_decode_pub in mysqlnd_net.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-15 17:15 UTC] aharvey@php.net
-Package: Zlib related +Package: MySQL related -Assigned To: +Assigned To: mysql
 [2014-08-15 17:15 UTC] aharvey@php.net
The trick here appears to be to force pdo_mysql and mysqlnd to be built as shared as well, via ./configure --disable-all --enable-mysqlnd=shared --enable-pdo --with-pdo-mysql=shared --with-zlib=shared.

Reassigning to the MySQL team. I'm not sure if we can detect this in mysqlnd's config9.m4, but it might be worth looking at.
 [2014-08-16 10:35 UTC] public at grik dot net
-Operating System: OSX 10.9 +Operating System: Linux, OSX 10.9
 [2014-08-16 10:35 UTC] public at grik dot net
reproduced in Linux

ext/mysqlnd/.libs/mysqlnd_net.o: In function `php_mysqlnd_net_encode_pub':
/usr/src/web/php-5.6.0RC4/ext/mysqlnd/mysqlnd_net.c:608: undefined reference to `compress'
ext/mysqlnd/.libs/mysqlnd_net.o: In function `php_mysqlnd_net_decode_pub':
/usr/src/web/php-5.6.0RC4/ext/mysqlnd/mysqlnd_net.c:584: undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
 [2017-10-24 08:13 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: mysql +Assigned To:
 [2021-02-01 15:29 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-01 15:29 UTC] cmb@php.net
Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-02-01 16:16 UTC] public at grik dot net
-Status: Feedback +Status: Assigned
 [2021-02-01 16:16 UTC] public at grik dot net
I build with a static zlib, and wrote the report just because met the error. It does not make big problems cause compilation is fast nowdays, but it worth to check this in a configure script and write a readable error without compilation, I guess.
I can check this with 7.4.
 [2021-02-02 14:58 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2021-02-02 14:58 UTC] cmb@php.net
Well, I just tried on Debian with gcc and current PHP-7.4 head,
and the build showed no errors.  I'm assuming this has been fixed
in the meantime; please re-open if you are still experiencing
these issues.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC