be685f7
From 739f7adcf6eeb8486e60fabc7816fff75fac63f9 Mon Sep 17 00:00:00 2001
4e10e2c
From: malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
4e10e2c
Date: Thu, 2 Apr 2009 01:16:39 +0000
be685f7
Subject: [PATCH 18/18] Temporary workaround for ppc on ppc
4e10e2c
4e10e2c
target-ppc/translate.c puts values of type opcode_t into .opcodes
4e10e2c
section, using GCC extension to do so, and hoping that this will make
4e10e2c
them appear contiguously and in the source order in the resulting
4e10e2c
executable. This assumption is not safe and is known to be violated
4e10e2c
with certain versions of GCC, certain flags passed to it and on
4e10e2c
certain platforms (gcc 4.3.0, -O and PPC/PPC64 for instance)
4e10e2c
4e10e2c
The workaround consists of adding -fno-unit-at-a-time to the list of
4e10e2c
GCC command line options while building PPC translate.o on a PPC.
4e10e2c
be685f7
(cherry picked from commit d19076faca944c31bb051b95d285e75ec67902f7)
be685f7
be685f7
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
4e10e2c
---
4e10e2c
 Makefile.target |    4 ++++
4e10e2c
 1 files changed, 4 insertions(+), 0 deletions(-)
4e10e2c
4e10e2c
diff --git a/Makefile.target b/Makefile.target
be685f7
index e2e23bf..7e18719 100644
4e10e2c
--- a/Makefile.target
4e10e2c
+++ b/Makefile.target
4e10e2c
@@ -91,6 +91,10 @@ ifeq ($(ARCH),i386)
4e10e2c
 HELPER_CFLAGS+=-fomit-frame-pointer
4e10e2c
 endif
4e10e2c
 
4e10e2c
+ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
4e10e2c
+translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
4e10e2c
+endif
4e10e2c
+
4e10e2c
 ifeq ($(ARCH),sparc)
4e10e2c
   CFLAGS+=-ffixed-g2 -ffixed-g3
4e10e2c
   ifneq ($(CONFIG_SOLARIS),yes)
4e10e2c
-- 
be685f7
1.6.2.2
4e10e2c