Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit a7fd946

Browse files
Paul E. Murphyouuleilei-bot
Paul E. Murphy
authored andcommitted
go: update usage of TARGET_AIX to TARGET_AIX_OS
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. gcc/go/ChangeLog: * go-backend.cc [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS. * go-lang.cc: Likewise.
1 parent c2d62cd commit a7fd946

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gcc/go/go-backend.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ along with GCC; see the file COPYING3. If not see
4545
#define GO_EXPORT_SECTION_NAME ".go_export"
4646
#endif
4747

48-
#ifndef TARGET_AIX
49-
#define TARGET_AIX 0
48+
#ifndef TARGET_AIX_OS
49+
#define TARGET_AIX_OS 0
5050
#endif
5151

5252
/* 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)
107107
{
108108
gcc_assert (targetm_common.have_named_sections);
109109
sec = get_section (GO_EXPORT_SECTION_NAME,
110-
TARGET_AIX ? SECTION_EXCLUDE : SECTION_DEBUG,
110+
TARGET_AIX_OS ? SECTION_EXCLUDE : SECTION_DEBUG,
111111
NULL);
112112
}
113113

gcc/go/go-lang.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ along with GCC; see the file COPYING3. If not see
3939
#include "go-c.h"
4040
#include "go-gcc.h"
4141

42-
#ifndef TARGET_AIX
43-
#define TARGET_AIX 0
42+
#ifndef TARGET_AIX_OS
43+
#define TARGET_AIX_OS 0
4444
#endif
4545

4646
/* Language-dependent contents of a type. */
@@ -116,9 +116,9 @@ go_langhook_init (void)
116116
args.compiling_runtime = go_compiling_runtime;
117117
args.debug_escape_level = go_debug_escape_level;
118118
args.debug_escape_hash = go_debug_escape_hash;
119-
args.nil_check_size_threshold = TARGET_AIX ? -1 : 4096;
119+
args.nil_check_size_threshold = TARGET_AIX_OS ? -1 : 4096;
120120
args.debug_optimization = go_debug_optimization;
121-
args.need_eqtype = TARGET_AIX ? true : false;
121+
args.need_eqtype = TARGET_AIX_OS ? true : false;
122122
args.linemap = go_get_linemap();
123123
args.backend = go_get_backend();
124124
go_create_gogo (&args);

0 commit comments

Comments
 (0)