php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55231 Unsatisfied symbols __sync_fetch_and_add_4
Submitted: 2011-07-18 08:32 UTC Modified: 2011-07-26 15:05 UTC
From: php at dactar dot ch Assigned: felipe (profile)
Status: Closed Package: *Compile Issues
PHP Version: 5.3.7RC3 OS: HP-UX 11.11
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 at dactar dot ch
New email:
PHP Version: OS:

 

 [2011-07-18 08:32 UTC] php at dactar dot ch
Description:
------------
Hello,

I've compiled PHP 5.3.7 RC3 on HP-UX 11.11 with gcc 4.1.2 and following parameters : 

./configure --with-config-file-path=/path/to/etc/php --with-imap=/path/to/imap --with-imap-ssl=/usr --with-libxml-dir=/path/to/libxml2 --with-gd --with-png-dir=/path/to/libpng --with-jpeg-dir=/path/to/jpeg --with-ldap --prefix=/path/to/php --with-ncurses=/path/to/ncurses --with-freetype-dir=/path/to/freetype

I've this error after make : 

/usr/ccs/bin/ld: Unsatisfied symbols:
   __sync_fetch_and_add_4 (first referenced in ext/standard/php_crypt_r.o) (code)
collect2: ld returned 1 exit status
*** Error exit code 1

It works fine with PHP 5.3.6 but not with PHP 5.3.7 RC3.

The diff between 5.3.6 and PHP 5.3.7 RC3 for ext/standard/php_crypt_r.c is : 

1c1
< /* $Id: php_crypt_r.c 311390 2011-05-24 13:48:04Z pajoye $ */
---
> /* $Id: php_crypt_r.c 306939 2011-01-01 02:19:59Z felipe $ */
97c97
< #elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 1))
---
> #elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2))
200c200
<       dwHashLen = 16;
---
>       dwHashLen = pwl + sl + pwl;

I've resolved the situation by return back for line 97 from 

#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 1))
                __sync_fetch_and_add(&initialized, 1);

to

#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2))
                __sync_fetch_and_add(&initialized, 1);



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-18 08:54 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2011-07-18 08:54 UTC] pajoye@php.net
Thanks for your feedback.

Please provide a patch (svn diff -u) and add a test for HPUX11 as well as this 
code is perfectly valid on other (almost all) platforms using gcc.
 [2011-07-18 10:42 UTC] php at dactar dot ch
-Status: Feedback +Status: Open
 [2011-07-18 10:42 UTC] php at dactar dot ch
Hello pajoye.

I can't do that because I don't understand why the 97th line has changed on 24 may. I don't have low level system / compiler skills to be exactly sure what I'm doing and how to correct that properly.

I can however test any patch and validate it.

Thanks for your help, 

@++ 
JC
 [2011-07-18 22:05 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: felipe
 [2011-07-19 18:11 UTC] felipe@php.net
-Status: Assigned +Status: Feedback
 [2011-07-19 18:11 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Such feature requires GCC >= 4.1.2, I've ajusted the check for the version.

Can you test it? :)
 [2011-07-19 18:12 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=313452
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2011-07-20 11:33 UTC] php at dactar dot ch
-Status: Feedback +Status: Assigned
 [2011-07-20 11:33 UTC] php at dactar dot ch
Hello, 

Sorry, with : 

#elif (defined(__GNUC__) && (__GNUC__ > 4 || \
    (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 1)))))

it doesn't work ( Unresolved symbol: __sync_fetch_and_add_4 (code) )

I don't have the problem with : 


#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2))

Thanks

@++
JC
 [2011-07-22 21:09 UTC] felipe@php.net
-Status: Assigned +Status: Analyzed
 [2011-07-22 21:09 UTC] felipe@php.net
I've added a check for HP-UX, GCC seems not have implemented __sync_fetch_and_add_4 for all targets.
 [2011-07-26 14:47 UTC] php at dactar dot ch
Hello felipe, 

I've tested your additionnal check and it's OK for me :)

Can you merge that for official next php 5.3.7 ?

Thanks :)

@++
JC
 [2011-07-26 14:53 UTC] felipe@php.net
-Status: Analyzed +Status: Closed
 [2011-07-26 14:53 UTC] felipe@php.net
It's already in 5.3 branch.

Thanks.
 [2011-07-26 15:05 UTC] php at dactar dot ch
Perfect, thanks :)
 [2011-09-17 00:01 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316885
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ad9c9ed5293cc7805853aff954699a49d4cd5b9f
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2012-04-18 09:49 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e97b0d7522aa66decf4ee20dd67f5fac44474dde
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ad9c9ed5293cc7805853aff954699a49d4cd5b9f
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2012-07-24 23:40 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e97b0d7522aa66decf4ee20dd67f5fac44474dde
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2013-11-17 09:36 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ad9c9ed5293cc7805853aff954699a49d4cd5b9f
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 [2013-11-17 09:37 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e97b0d7522aa66decf4ee20dd67f5fac44474dde
Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 17:01:32 2024 UTC