Patchwork [committed] Fix ppc build breakage (PR target/45837)

login
register
mail settings
Submitter Michael Meissner
Date Sept. 30, 2010, 8 p.m.
Message ID <20100930200050.GA13694@hungry-tiger.westford.ibm.com>
Download mbox | patch
Permalink /patch/66745/
State New
Headers show

Comments

Michael Meissner - Sept. 30, 2010, 8 p.m.
This fixes the breakage that comes up when building GCC on a powerpc64-linux
system due to the changes in the option handling submitted on the 29th.
Powerpc64-linux defined TARGET_AIX to be TARGET_64BIT, while options-default.h
had an #if TARGET_AIX in it.  Before the option changes when in, the
preprecessor would just use 0 for target flags, and use -m64/-m32 as the opions
for 64/32-bit code.  Under the new setup, target flags is a define into a
struction, and the preprocessor doesn't like the . in the expression.

I bootstraped it on a powerpc64-linux system using --with-cpu=default32.
Unfortunately, it currently won't build defaulting to 64-bit compiles, due to
interactions caused by the fix for PR 45807.

Patch

Index: gcc/config/rs6000/aix.h
===================================================================
--- gcc/config/rs6000/aix.h	(revision 164732)
+++ gcc/config/rs6000/aix.h	(working copy)
@@ -24,6 +24,10 @@ 
 #undef  TARGET_AIX
 #define TARGET_AIX 1
 
+/* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used
+   in the #if conditional in options-default.h, so provide another macro.  */
+#define TARGET_AIX_OS 1
+
 /* AIX always has a TOC.  */
 #define TARGET_NO_TOC 0
 #define TARGET_TOC 1
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h	(revision 164732)
+++ gcc/config/rs6000/rs6000.h	(working copy)
@@ -46,6 +46,10 @@ 
 #define TARGET_AIX 0
 #endif
 
+#ifndef TARGET_AIX_OS
+#define TARGET_AIX_OS 0
+#endif
+
 /* Control whether function entry points use a "dot" symbol when
    ABI_AIX.  */
 #define DOT_SYMBOLS 1
Index: gcc/config/rs6000/option-defaults.h
===================================================================
--- gcc/config/rs6000/option-defaults.h	(revision 164732)
+++ gcc/config/rs6000/option-defaults.h	(working copy)
@@ -27,7 +27,7 @@ 
 /* This header needs to be included after any other headers affecting
    TARGET_DEFAULT.  */
 
-#if TARGET_AIX
+#if TARGET_AIX_OS
 #define OPT_64 "maix64"
 #define OPT_32 "maix32"
 #else