summaryrefslogtreecommitdiff
path: root/lang/gcc32
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2004-12-19 19:13:24 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2004-12-19 19:13:24 +0000
commit015e520ca3e4055e79527c1b3dee3e52f4e6991f (patch)
tree695b8132de14f09b0143000ce6c94df4f9861900 /lang/gcc32
parent+ Our AMD64 Linux compat is 32-bit i386 emulation, so adjust accordingly. (diff)
Fix xfmode splits on AMD64; using patch from Richard Henderson <rth@redhat.com>
Notes
Notes: svn path=/head/; revision=124508
Diffstat (limited to 'lang/gcc32')
-rw-r--r--lang/gcc32/Makefile7
-rw-r--r--lang/gcc32/files/patch-gcc,config,i386,i386.c52
2 files changed, 55 insertions, 4 deletions
diff --git a/lang/gcc32/Makefile b/lang/gcc32/Makefile
index b36705ac16f6..af088cf4a10c 100644
--- a/lang/gcc32/Makefile
+++ b/lang/gcc32/Makefile
@@ -25,6 +25,7 @@ COMMENT?= GNU Compiler Collection 3.2.3
LATEST_LINK?= gcc32${PKGNAMESUFFIX}
USE_BZIP2= yes
+USE_REINPLACE= yes
PATCH_WRKSRC= ${SRCDIR}
CONFIGURE_SCRIPT= ../${SRCDIR:C/${WRKDIR}//}/configure
@@ -38,10 +39,6 @@ NOMANCOMPRESS= yes # too hard to deal with differences on 5-cur and releng4
EXTRA_PATCHES= ${FILESDIR}/extrapatch-gcc__config__freebsd-spec.h
.endif
-.if ${ARCH} == "amd64"
-BROKEN= linker: unrecognised emulation mode: elf_x86_64
-.endif
-
.if ${PORTOBJFORMAT} == "aout"
CONFIGURE_TARGET= ${ARCH}-portbld-freebsdaout${OSREL}
.else
@@ -87,6 +84,8 @@ pre-configure:
cd ${SRCDIR} ; contrib/gcc_update --touch
@${RM} -f ${SRCDIR}/gcc/*/*.info*
@${MKDIR} ${CONFIGURE_WRKSRC}
+ @${REINPLACE_CMD} -e 's/elf_x86_64/elf_x86_64_fbsd/g' \
+ ${SRCDIR}/gcc/config/i386/freebsd64.h
post-build:
@echo "Consider running 'make check' before 'make install',"
diff --git a/lang/gcc32/files/patch-gcc,config,i386,i386.c b/lang/gcc32/files/patch-gcc,config,i386,i386.c
new file mode 100644
index 000000000000..6a33405716d8
--- /dev/null
+++ b/lang/gcc32/files/patch-gcc,config,i386,i386.c
@@ -0,0 +1,52 @@
+$FreeBSD$
+
+http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00629.html
+ Date: Wed, 7 May 2003 17:52:21 -0700
+ From: Richard Henderson <rth@redhat.com>
+ Subject: fix amd64 xfmode splits
+ Message-ID: <20030508005221.GX27351@redhat.com>
+
+ Test case for this is FreeBSD vfprintf.c (i.e. a tad big) and
+ I wasn't able to reduce the test. The cause is evident though:
+ the second part of a 12-byte quantity is SImode, not DImode,
+ and so is invalid as a base address.
+
+ r~
+
+* config/i386/i386.c (ix86_split_long_move): Fix base register
+ mode for XFmode splits for TARGET_64BIT.
+
+--- gcc/config/i386/i386.c.orig Wed Mar 12 01:04:01 2003
++++ gcc/config/i386/i386.c Sun Dec 19 10:39:53 2004
+@@ -8828,15 +8828,24 @@
+ Do an lea to the last part and use only one colliding move. */
+ else if (collisions > 1)
+ {
++ rtx base;
++
+ collisions = 1;
+- emit_insn (gen_rtx_SET (VOIDmode, part[0][nparts - 1],
+- XEXP (part[1][0], 0)));
+- part[1][0] = change_address (part[1][0],
+- TARGET_64BIT ? DImode : SImode,
+- part[0][nparts - 1]);
+- part[1][1] = adjust_address (part[1][0], VOIDmode, UNITS_PER_WORD);
++
++ base = part[0][nparts - 1];
++
++ /* Handle the case when the last part isn't valid for lea.
++ Happens in 64-bit mode storing the 12-byte XFmode. */
++ if (GET_MODE (base) != Pmode)
++ base = gen_rtx_REG (Pmode, REGNO (base));
++
++ emit_insn (gen_rtx_SET (VOIDmode, base, XEXP (part[1][0], 0)));
++ part[1][0] = replace_equiv_address (part[1][0], base);
++ part[1][1] = replace_equiv_address (part[1][1],
++ plus_constant (base, UNITS_PER_WORD));
+ if (nparts == 3)
+- part[1][2] = adjust_address (part[1][0], VOIDmode, 8);
++ part[1][2] = replace_equiv_address (part[1][2],
++ plus_constant (base, 8));
+ }
+ }
+