php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52725 gcc builtin atomic functions are sometimes used when they are not available
Submitted: 2010-08-28 22:37 UTC Modified: 2010-09-01 10:18 UTC
From: fedora at famillecollet dot com Assigned: fat (profile)
Status: Closed Package: FPM related
PHP Version: 5.3SVN-2010-08-28 (snap) OS: GNU/Linux (RHEL 5.5)
Private report: No CVE-ID: None
 [2010-08-28 22:37 UTC] fedora at famillecollet dot com
Description:
------------
Build fails on RHEL/Centos 5 (gcc-4.1.2)

sapi/fpm/fpm/fpm_shm_slots.o: In function `fpm_spinlock':
/builddir/build/BUILD/php5.3-201008281230/sapi/fpm/fpm/fpm_atomic.h:148: undefined reference to `__sync_bool_compare_and_swap_4'
/builddir/build/BUILD/php5.3-201008281230/sapi/fpm/fpm/fpm_atomic.h:143: undefined reference to `__sync_bool_compare_and_swap_4'

This seems linked to commit 302600
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_atomic.h?r1=299794&r2=302600

Changing the test fixes the issue  
#if (__GNUC__) && (__GNUC__ >= 4 &&  __GNUC_MINOR__ >= 2)

I don't know which is the correct value.

Build ok on fedora 12 (gcc-4.4.4) and fedora 13 (gcc-4.4.4)



Patches

fpm_builtin_atomic.patch (last revision 2010-08-30 13:45 UTC by fat@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-29 00:35 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2010-08-30 15:45 UTC] fat@php.net
The following patch has been added/updated:

Patch Name: fpm_builtin_atomic.patch
Revision:   1283175955
URL:        http://bugs.php.net/patch-display.php?bug=52725&patch=fpm_builtin_atomic.patch&revision=1283175955
 [2010-08-30 15:47 UTC] fat@php.net
-Status: Assigned +Status: Feedback
 [2010-08-30 15:47 UTC] fat@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Can you please try the following patch ?

Don't forget to run ./buildconf before executing ./configure --enable-fpm && make.

Thanks
 [2010-08-30 18:19 UTC] fedora at famillecollet dot com
-Status: Feedback +Status: Assigned
 [2010-08-30 18:19 UTC] fedora at famillecollet dot com
Try build of latest snapshot (201008301430) with your patch

Fedora 13 x86_64 - gcc 4.4.4 : BUILD OK

$ grep HAVE_BUILTIN_ATOMIC build-fpm/main/php_config.h 
#define HAVE_BUILTIN_ATOMIC 1

Enterprise Linux 5 i386 - gcc 4.1.2 : BUILD OK

$ grep HAVE_BUILTIN_ATOMIC build-fpm/main/php_config.h
/* #undef HAVE_BUILTIN_ATOMIC */


So, the patch seems fine to me.
Thanks for taking care of this.
 [2010-09-01 10:15 UTC] fat@php.net
-Summary: undefined reference to `__sync_bool_compare_and_swap_4' +Summary: gcc builtin atomic functions are sometimes used when they are not available -Status: Assigned +Status: Analyzed
 [2010-09-01 10:17 UTC] fat@php.net
Automatic comment from SVN on behalf of fat
Revision: http://svn.php.net/viewvc/?view=revision&revision=302965
Log: - Fixed bug #52725 (gcc builtin atomic functions were sometimes used when they were not available).
 [2010-09-01 10:18 UTC] fat@php.net
-Status: Analyzed +Status: Closed
 [2010-09-01 10:18 UTC] fat@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC