]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR66870 PowerPC64 Enable gold linker with split stack
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 2015 23:50:30 +0000 (23:50 +0000)
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Oct 2015 23:50:30 +0000 (23:50 +0000)
A powerpc-linux/powerpc64-linux biarch compiler can default to either
-m32 or -m64, and we need to notice both -m32 and -m64 on the gccgo
command line.  It's also possible to build a -m64 only compiler, so in
that case we can define TARGET_CAN_SPLIT_STACK.

gcc/
PR go/66870
* config/rs6000/sysv4.h (TARGET_CAN_SPLIT_STACK_64BIT): Don't define.
* config/rs6000/linux64.h (TARGET_CAN_SPLIT_STACK): Define.
(TARGET_CAN_SPLIT_STACK_64BIT): Define.
gcc/go/
PR go/66870
* gospec.c (saw_opt_m32): Rename to..
(is_m64): ..this, initialised by TARGET_CAN_SPLIT_STACK_64BIT.
Update uses.
(lang_specific_driver): Set is_m64 if OPT_m64, clear if OPT_m32.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229009 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/linux64.h
gcc/config/rs6000/sysv4.h
gcc/go/ChangeLog
gcc/go/gospec.c

index 4279557480d774d2032a8b974ea75f643949822f..a342d6a9618f614ec52d672b091247b2654454de 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-20  Alan Modra  <amodra@gmail.com>
+
+       PR go/66870
+       * config/rs6000/sysv4.h (TARGET_CAN_SPLIT_STACK_64BIT): Don't define.
+       * config/rs6000/linux64.h (TARGET_CAN_SPLIT_STACK): Define.
+       (TARGET_CAN_SPLIT_STACK_64BIT): Define.
+
 2015-10-19  Pierre-Marie de Rodat  <derodat@adacore.com>
 
        PR rtl-optimization/66790
index 95997357579ce6c95e7587c7145ac6e79f78f2be..1948e8679b5a5b7619d7f5bd5118d7a3aeb2c513 100644 (file)
@@ -245,6 +245,21 @@ extern int dot_symbols;
 #define MULTILIB_DEFAULTS { "m32" }
 #endif
 
+/* Split stack is only supported for 64 bit, and requires glibc >= 2.18.  */
+#if TARGET_GLIBC_MAJOR * 1000 + TARGET_GLIBC_MINOR >= 2018
+# ifndef RS6000_BI_ARCH
+#  define TARGET_CAN_SPLIT_STACK
+# else
+#  if DEFAULT_ARCH64_P
+/* Supported, and the default is -m64  */
+#   define TARGET_CAN_SPLIT_STACK_64BIT 1
+#  else
+/* Supported, and the default is -m32  */
+#   define TARGET_CAN_SPLIT_STACK_64BIT 0
+#  endif
+# endif
+#endif
+
 #ifndef RS6000_BI_ARCH
 
 /* 64-bit PowerPC Linux always has a TOC.  */
index 7b2f9bd6f0d2820dc124758131b7d01257874fd8..f48af43e7c508abc44bb0d7dc5edc80b7ed8cac9 100644 (file)
@@ -940,14 +940,6 @@ ncrtn.o%s"
 #undef TARGET_ASAN_SHADOW_OFFSET
 #define TARGET_ASAN_SHADOW_OFFSET rs6000_asan_shadow_offset
 
-/* On ppc64 and ppc64le, split stack is only support for
-   64 bit. */
-#undef TARGET_CAN_SPLIT_STACK_64BIT
-#if TARGET_GLIBC_MAJOR > 2 \
-  || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 18)
-#define TARGET_CAN_SPLIT_STACK_64BIT
-#endif
-
 /* This target uses the sysv4.opt file.  */
 #define TARGET_USES_SYSV4_OPT 1
 
index be1fd0cb09bbdc5423ed6223b06d6275c62327b9..f25c898782b445256f8bc0d70a19ad5304056639 100644 (file)
@@ -1,3 +1,11 @@
+2015-10-20  Alan Modra  <amodra@gmail.com>
+
+       PR go/66870
+       * gospec.c (saw_opt_m32): Rename to..
+       (is_m64): ..this, initialised by TARGET_CAN_SPLIT_STACK_64BIT.
+       Update uses.
+       (lang_specific_driver): Set is_m64 if OPT_m64, clear if OPT_m32.
+
 2015-10-01  Ian Lance Taylor  <iant@google.com>
 
        PR go/66870
index ca3c2d70d68643a68c23e0f85adef5384ce7a75b..a56ffe0fad10597847f62569d8be197ee18036b4 100644 (file)
@@ -120,8 +120,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
   /* Whether the -S option was used.  */
   bool saw_opt_S = false;
 
-  /* Whether the -m32 option was used. */
-  bool saw_opt_m32 ATTRIBUTE_UNUSED = false;
+#ifdef TARGET_CAN_SPLIT_STACK_64BIT
+  /* Whether the -m64 option is in force. */
+  bool is_m64 = TARGET_CAN_SPLIT_STACK_64BIT;
+#endif
 
   /* The first input file with an extension of .go.  */
   const char *first_go_file = NULL;  
@@ -160,7 +162,11 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 
 #ifdef TARGET_CAN_SPLIT_STACK_64BIT
        case OPT_m32:
-         saw_opt_m32 = true;
+         is_m64 = false;
+         break;
+
+       case OPT_m64:
+         is_m64 = true;
          break;
 #endif
 
@@ -253,7 +259,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 #endif
 
 #ifdef TARGET_CAN_SPLIT_STACK_64BIT
-  if (!saw_opt_m32)
+  if (is_m64)
     supports_split_stack = 1;
 #endif