aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php7/fix-x86-build-bug_571658.patch
blob: 46f68b68655724068dd7068c97ea13baba12f6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 2fcc388d9bf238673ed84b8f38d7753279aea48c Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Thu, 4 Aug 2016 11:42:56 -0400
Subject: [PATCH 1/1] Zend/zend_operators.h: disable x86 assembly on all newer
 GCC-4.x.

In bug 69896, a fix was committed to work around a build error: 'asm'
operand has impossible constraints, in zend_operators.h, on x86. At
the time, the problem was only visible with gcc-4.8, and the fix was
to disable that chunk of assembly for gcc-4.8. With gcc-4.9, the
problem persists, so we now need to check for gcc-4.9 (at least) in
addition to gcc-4.8.

This commit modifies the earlier conditional that checks for
gcc-4.8. The existing check was for equality on the minor component of
the gcc version, namely 8. The == operator that performs the
comparison has been changed to <=, so that it catches any gcc-4.x with
x >= 8. This has been tested and fixes the build on x86 hardware with
gcc-4.9.

PHP-Bug: 69896
Gentoo-Bug: 571658
---
 Zend/zend_operators.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 3705022..dd7c354 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -520,7 +520,7 @@ static zend_always_inline void fast_long_decrement_function(zval *op1)
 
 static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
 {
-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 <= __GNUC_MINOR__)
 	__asm__(
 		"movl	(%1), %%eax\n\t"
 		"addl   (%2), %%eax\n\t"
@@ -606,7 +606,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
 
 static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
 {
-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 <= __GNUC_MINOR__)
 	__asm__(
 		"movl	(%1), %%eax\n\t"
 		"subl   (%2), %%eax\n\t"
-- 
2.7.3