Fix the build
Backport a patch from upstream git to fix the build on i686.
This commit is contained in:
parent
58ff2dfff3
commit
766ff1432e
58
0001-Process-64-bit-imm-disp-only-for-64-bit-BFD.patch
Normal file
58
0001-Process-64-bit-imm-disp-only-for-64-bit-BFD.patch
Normal file
@ -0,0 +1,58 @@
|
||||
From a28def75916fb4fa8280404f8c023adc0773162d Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Fri, 18 Dec 2015 14:03:43 -0800
|
||||
Subject: [PATCH] Process 64-bit imm/disp only for 64-bit BFD
|
||||
|
||||
We only need to store 32-bit immediate in 64-bit and optimize 64-bit
|
||||
displacement to 32-bit only for 64-bit BFD.
|
||||
|
||||
* config/tc-i386.c (optimize_imm): Store 32-bit immediate in
|
||||
64-bit only for 64-bit BFD
|
||||
(optimize_disp): Optimize 64-bit displacement to 32-bit only
|
||||
for 64-bit BFD.
|
||||
---
|
||||
gas/ChangeLog | 7 +++++++
|
||||
gas/config/tc-i386.c | 6 ++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
|
||||
index 1573043..4940a80 100644
|
||||
--- a/gas/config/tc-i386.c
|
||||
+++ b/gas/config/tc-i386.c
|
||||
@@ -4218,6 +4218,8 @@ optimize_imm (void)
|
||||
i.op[op].imms->X_add_number =
|
||||
(((i.op[op].imms->X_add_number & 0xffff) ^ 0x8000) - 0x8000);
|
||||
}
|
||||
+#ifdef BFD64
|
||||
+ /* Store 32-bit immediate in 64-bit for 64-bit BFD. */
|
||||
if ((i.types[op].bitfield.imm32)
|
||||
&& ((i.op[op].imms->X_add_number & ~(((offsetT) 2 << 31) - 1))
|
||||
== 0))
|
||||
@@ -4226,6 +4228,7 @@ optimize_imm (void)
|
||||
^ ((offsetT) 1 << 31))
|
||||
- ((offsetT) 1 << 31));
|
||||
}
|
||||
+#endif
|
||||
i.types[op]
|
||||
= operand_type_or (i.types[op],
|
||||
smallest_imm_type (i.op[op].imms->X_add_number));
|
||||
@@ -4306,6 +4309,8 @@ optimize_disp (void)
|
||||
op_disp = (((op_disp & 0xffff) ^ 0x8000) - 0x8000);
|
||||
i.types[op].bitfield.disp64 = 0;
|
||||
}
|
||||
+#ifdef BFD64
|
||||
+ /* Optimize 64-bit displacement to 32-bit for 64-bit BFD. */
|
||||
if (i.types[op].bitfield.disp32
|
||||
&& (op_disp & ~(((offsetT) 2 << 31) - 1)) == 0)
|
||||
{
|
||||
@@ -4316,6 +4321,7 @@ optimize_disp (void)
|
||||
op_disp = (op_disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31);
|
||||
i.types[op].bitfield.disp64 = 0;
|
||||
}
|
||||
+#endif
|
||||
if (!op_disp && i.types[op].bitfield.baseindex)
|
||||
{
|
||||
i.types[op].bitfield.disp8 = 0;
|
||||
--
|
||||
2.5.5
|
||||
|
||||
@ -12,6 +12,10 @@ URL: http://www.gnu.org/software/binutils/
|
||||
Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2
|
||||
#Source0: http://www.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
|
||||
|
||||
# Fix the build on i686
|
||||
# Backported from upstream git master.
|
||||
Patch0: 0001-Process-64-bit-imm-disp-only-for-64-bit-BFD.patch
|
||||
|
||||
BuildRequires: flex
|
||||
BuildRequires: bison
|
||||
BuildRequires: texinfo
|
||||
@ -61,6 +65,7 @@ understand Windows executables and DLLs.
|
||||
|
||||
%prep
|
||||
%setup -q -n binutils-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
|
||||
%build
|
||||
|
||||
Loading…
Reference in New Issue
Block a user