php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51847 php 5.2.13 and gettext 0.18: Undefined symbols: _zif_setlocale
Submitted: 2010-05-18 05:07 UTC Modified: 2010-06-02 07:55 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: php-bugs-2010 at ryandesign dot com Assigned: rasmus (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.2.13 OS: Mac OS X 10.6.3 x86_64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php-bugs-2010 at ryandesign dot com
New email:
PHP Version: OS:

 

 [2010-05-18 05:07 UTC] php-bugs-2010 at ryandesign dot com
Description:
------------
Hello, I'm the maintainer of the php packages in MacPorts, 
and it seems that php 5.2.13 doesn't build with gettext 0.18 
(at least not on Mac OS X 10.6.3 x86_64). It fails with:


Undefined symbols:
  "_zif_setlocale", referenced from:
      _basic_functions in basic_functions.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1


php 5.2.13 builds fine with gettext 0.17, and php 5.3.2 
builds fine with gettext 0.17 and 0.18. Here's the bug 
report that was submitted to us:

http://trac.macports.org/ticket/24934


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-18 05:09 UTC] php-bugs-2010 at ryandesign dot com
-Summary: php 5.2.13 and gettext 0.18: +Summary: php 5.2.13 and gettext 0.18: Undefined symbols: _zif_setlocale
 [2010-05-18 05:09 UTC] php-bugs-2010 at ryandesign dot com
Modify summary.
 [2010-05-18 10:04 UTC] kalle@php.net
Hi

Does this happen with 5.3 aswell? Does adding the following include after including 'ext/standard/php_uuencode.h' work:

#include "ext/standard/php_string.h"
 [2010-05-18 10:05 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2010-05-18 12:18 UTC] php-bugs-2010 at ryandesign dot com
-Status: Feedback +Status: Open
 [2010-05-18 12:18 UTC] php-bugs-2010 at ryandesign dot com
php 5.3.2 builds fine with gettext 0.17 and 0.18. 
This issue only appears to affect php 5.2.x.

Adding '#include "ext/standard/php_string.h"' to 
ext/standard/basic_functions.c does not change the 
error message.
 [2010-06-02 07:35 UTC] rasmus@php.net
I think this has to do with libintl.  I see:

#undef setlocale
#define setlocale libintl_setlocale

in libintl.h which is obviously going to make a mess of things.

So, a quick compile fix is to skip the #include libintl.h in ext/standard/string.c but someone should really give the libintl dev who decided that was a good idea a "pat" on the back.
 [2010-06-02 07:53 UTC] rasmus@php.net
Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=300085
Log: Fix for bug #51847
Someone in libintl world decided it was a good idea to do:

#undef setlocale
#define setlocale libintl_setlocale

That means, of course, that any use of "setlocale" by the
preprocessor now becomes libintl_setlocale which means we
no longer have a _zif_setlocale symbol in string.o, but we
magically have a _zif_libintl_setlocale symbol.  The linker
is obviously not very happy about this when basic_functions.o
tries to find _zif_setlocale.

So, let's not do that again.
 [2010-06-02 07:55 UTC] rasmus@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rasmus
 [2010-06-02 07:55 UTC] rasmus@php.net
Fixed in all branches in svn
 [2010-06-02 21:24 UTC] rasmus@php.net
Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=300104
Log: Tweak the fix for bug #51847 to still call libintl_setlocale
when libintl has done that redefine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 18:01:30 2024 UTC