|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54371 Undefined symbol: __sync_fetch_and_add_4
Submitted: 2011-03-24 16:10 UTC Modified: 2011-03-24 21:18 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: wyatt at lle dot rochester dot edu Assigned:
Status: Wont fix Package: Compile Failure
PHP Version: 5.3.6 OS: SunOS 5.10 Generic_14290
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-03-24 16:10 UTC] wyatt at lle dot rochester dot edu
__sync_fetch_and_add_4 shouldn't be called on SPARC.

The system is 64 bit with v9 processors but our Oracle libraries are 32 bit so I'm 
using mcpu=v8.

Test script:
This is the configure script:


export CC="gcc"
export CFLAGS="-mcpu=v8 -Wa,-xarch=v8plusa"
export LD_LIBRARY_PATH=/usr/lib:/usr/sfw/lib:/usr/local/lib:/usr/ccs/lib
export LD_LIBRARY_FLAGS="-L/usr/lib -R/usr/lib -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/local/lib -R/usr/local/lib -L/usr/ccs/lib -R/usr/ccs/lib"

./configure \
--prefix=/usr/local/php-5.3.6 \
--enable-shared \
--with-apxs2=/usr/local/httpd-2.2.17/bin/apxs \
--with-libxml-dir=/usr/include/libxml2 \
--with-iconv-dir=/usr/local/libiconv-1.12/lib \
--with-zlib \
--enable-exif \
--enable-mbstring \
--enable-calendar \
--enable-bcmath \
--enable-ftp \
--enable-zip \
--with-bz2=/usr/local/lib \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--with-gettext=shared,/opt/sfw \
--enable-sockets \
--with-oci8=/usr/local/php-5.3.1/ORACLE_LIB32 \
--with-gd \


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-24 16:12 UTC] wyatt at lle dot rochester dot edu
This is the reported error:

Undefined                       first referenced
 symbol                             in file
__sync_fetch_and_add_4              ext/standard/.libs/php_crypt_r.o
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
gmake: *** [sapi/cli/php] Error 1
 [2011-03-24 18:50 UTC]
Have you tried the free 64bit Oracle Instant Client libraries?
 [2011-03-24 19:00 UTC]
Also see
 [2011-03-24 19:19 UTC]
If you want to compile with 32-bit, you should be using -m32. unless, u know 
exactly what you are doing, please refrain from using -xarch/-mcpu flags. let the 
compiler figure it for you.

export CFLAGS="-m32"
 [2011-03-24 20:59 UTC] wyatt at lle dot rochester dot edu
I could try the Instant Client libraries but that would require a lot of work 
recompiling other supporting software that is in use.  It's also not related to 
the problem at hand.

Bug report 53310 looks like it might be related to this issue but I am using gcc 
4.2.2.  I should add that I was able to compile versions 5.3.1, 5.3.3, 5.3.4, 
and 5.3.5 with no problems using the same script (other than changing the 

I thought I had tried -m32 by itself but clearly not because I tried again and 
it compiled successfully.  Perhaps this would be a good thing to add to the 
README's.  Thank you!
 [2011-03-24 21:18 UTC]
-Status: Open +Status: Wont fix
 [2011-03-24 21:18 UTC]
Thanks for the feedback.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue May 24 00:03:50 2022 UTC