php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64780 PHP 5.5 builds are broken with GCC 3
Submitted: 2013-05-06 23:05 UTC Modified: 2013-05-07 18:10 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sixd@php.net Assigned: ardbiesheuvel (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.5Git-2013-05-06 (snap) OS: Linux
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: sixd@php.net
New email:
PHP Version: OS:

 

 [2013-05-06 23:05 UTC] sixd@php.net
Description:
------------
PHP 5.5 builds are broken with GCC 3.4.6 due to the inline assembler
changes in zend_operators.h (in aa12cdc361)

Since the old assembler code path works for GCC 3, I suggest we simply
retain it with appropriate #ifdef's.  This may make someone's life
easier, e.g. during platform migration. 

Note RHEL 4.9 with GCC 3.4.6 was released 2 years ago. GCC 3.4.6
itself was released 6 years ago.

Currently compiling PHP 5.5 with GCC 3.4.6 fails with:
In file included from /tmp/php5.5-201305061630/Zend/zend.h:840,
                 from /tmp/php5.5-201305061630/main/php.h:34,
                 from /tmp/php5.5-201305061630/ext/date/php_date.c:21:
/tmp/php5.5-201305061630/Zend/zend_operators.h: In function 
`fast_increment_function':
/tmp/php5.5-201305061630/Zend/zend_operators.h:516: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h:516: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h: In function 
`fast_decrement_function':
/tmp/php5.5-201305061630/Zend/zend_operators.h:559: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h:559: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h: In function `fast_add_function':
/tmp/php5.5-201305061630/Zend/zend_operators.h:613: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h:613: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h: In function `fast_sub_function':
/tmp/php5.5-201305061630/Zend/zend_operators.h:698: error: syntax error before 
"zval"
/tmp/php5.5-201305061630/Zend/zend_operators.h:698: error: syntax error before 
"zval"
make: *** [ext/date/php_date.lo] Error 1

The patch is attached.  It was tested with GCC 3.4.6 and 4.1.2 on 32
and 64 bit Oracle Linux.


Patches

gcc3-offsetof (last revision 2013-05-07 09:06 UTC by ardbiesheuvel@php.net)
zend_operators.h.patch (last revision 2013-05-07 04:02 UTC by sixd@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-07 04:02 UTC] sixd@php.net
The following patch has been added/updated:

Patch Name: zend_operators.h.patch
Revision:   1367899326
URL:        https://bugs.php.net/patch-display.php?bug=64780&patch=zend_operators.h.patch&revision=1367899326
 [2013-05-07 09:06 UTC] ardbiesheuvel@php.net
The following patch has been added/updated:

Patch Name: gcc3-offsetof
Revision:   1367917610
URL:        https://bugs.php.net/patch-display.php?bug=64780&patch=gcc3-offsetof&revision=1367917610
 [2013-05-07 09:07 UTC] ardbiesheuvel@php.net
This seems to be related to GCC 3 not having support for __builtin_offsetof().

Let's fix it like this instead (see patch). Could you please try it?
 [2013-05-07 18:10 UTC] sixd@php.net
Doh! I'd initially patched it that way but hadn't included stddef.h correctly.
Your patch works.  Since you have Zend karma, can you apply it?
 [2013-05-07 18:10 UTC] sixd@php.net
-Assigned To: +Assigned To: ardbiesheuvel
 [2013-05-07 19:13 UTC] bluej100 at gmail dot com
I've confirmed that Ard's patch also fixes cygwin, which is still on 3.4.4. Thanks!
 [2013-05-07 20:07 UTC] ardbiesheuvel@php.net
-Status: Assigned +Status: Closed
 [2013-05-07 20:07 UTC] ardbiesheuvel@php.net
Automatic comment on behalf of ard.biesheuvel@linaro.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b121eb04d358f83e974b6c5fe069c38cf1f960b
Log: Fix #64780 (PHP 5.5 builds are broken with GCC 3)
 [2013-05-07 20:10 UTC] ardbiesheuvel@php.net
Automatic comment on behalf of ard.biesheuvel@linaro.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b121eb04d358f83e974b6c5fe069c38cf1f960b
Log: Fix #64780 (PHP 5.5 builds are broken with GCC 3)
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of ard.biesheuvel@linaro.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b121eb04d358f83e974b6c5fe069c38cf1f960b
Log: Fix #64780 (PHP 5.5 builds are broken with GCC 3)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jun 22 02:01:32 2025 UTC