]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
go: Update usage of TARGET_AIX to TARGET_AIX_OS
authorPaul E. Murphy <murphyp@linux.ibm.com>
Thu, 22 Jun 2023 22:53:46 +0000 (17:53 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Thu, 29 Jun 2023 03:02:05 +0000 (22:02 -0500)
TARGET_AIX is defined to a non-zero value on linux and maybe other
powerpc64le targets.  This leads to unexpected behavior such as
dropping the .go_export section when linking a shared library
on linux/powerpc64le.

Instead, use TARGET_AIX_OS to toggle AIX specific behavior.

Fixes golang/go#60798.

2023-06-22  Paul E. Murphy  <murphyp@linux.ibm.com>

gcc/go/
* go-backend.c [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS.
* go-lang.c: Likewise.

(cherry picked from commit b76cd1ec361712e1ac9ca5e0246da24ea2b78916)

gcc/go/go-backend.c
gcc/go/go-lang.c

index 7a223e51b002b57fa8406627847f4fcff654d4aa..4655fee6ece98313ecfce0a68af77b8d02aa7d6d 100644 (file)
@@ -45,8 +45,8 @@ along with GCC; see the file COPYING3.  If not see
 #define GO_EXPORT_SECTION_NAME ".go_export"
 #endif
 
-#ifndef TARGET_AIX
-#define TARGET_AIX 0
+#ifndef TARGET_AIX_OS
+#define TARGET_AIX_OS 0
 #endif
 
 /* This file holds all the cases where the Go frontend needs
@@ -107,7 +107,7 @@ go_write_export_data (const char *bytes, unsigned int size)
     {
       gcc_assert (targetm_common.have_named_sections);
       sec = get_section (GO_EXPORT_SECTION_NAME,
-                        TARGET_AIX ? SECTION_EXCLUDE : SECTION_DEBUG,
+                        TARGET_AIX_OS ? SECTION_EXCLUDE : SECTION_DEBUG,
                         NULL);
     }
 
index a01db8dbdcd9a3a08989161762484275036da257..249ecf2503f53ac26b4005e67f04d1fea2879bd6 100644 (file)
@@ -39,8 +39,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "go-c.h"
 #include "go-gcc.h"
 
-#ifndef TARGET_AIX
-#define TARGET_AIX 0
+#ifndef TARGET_AIX_OS
+#define TARGET_AIX_OS 0
 #endif
 
 /* Language-dependent contents of a type.  */
@@ -119,9 +119,9 @@ go_langhook_init (void)
   args.compiling_runtime = go_compiling_runtime;
   args.debug_escape_level = go_debug_escape_level;
   args.debug_escape_hash = go_debug_escape_hash;
-  args.nil_check_size_threshold = TARGET_AIX ? -1 : 4096;
+  args.nil_check_size_threshold = TARGET_AIX_OS ? -1 : 4096;
   args.debug_optimization = go_debug_optimization;
-  args.need_eqtype = TARGET_AIX ? true : false;
+  args.need_eqtype = TARGET_AIX_OS ? true : false;
   args.linemap = go_get_linemap();
   args.backend = go_get_backend();
   go_create_gogo (&args);