summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/config/ia64/aix.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/config/ia64/aix.h')
-rw-r--r--contrib/gcc/config/ia64/aix.h151
1 files changed, 32 insertions, 119 deletions
diff --git a/contrib/gcc/config/ia64/aix.h b/contrib/gcc/config/ia64/aix.h
index fee0732..5eb2334 100644
--- a/contrib/gcc/config/ia64/aix.h
+++ b/contrib/gcc/config/ia64/aix.h
@@ -71,34 +71,36 @@ Boston, MA 02111-1307, USA. */
/* Define this so we can compile MS code for use with WINE. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
+/* Target OS builtins. */
+#define TARGET_OS_CPP_BUILTINS() \
+do { \
+ if (flag_iso) \
+ builtin_define("_ANSI_C_SOURCE"); \
+ builtin_define("_AIX"); \
+ builtin_define("_AIX64"); \
+ builtin_define("unix"); \
+ builtin_assert("system=unix"); \
+ builtin_assert("system=aix"); \
+ builtin_define("__64BIT__"); \
+ builtin_define("_LONG_LONG"); \
+ builtin_define("_IA64"); \
+ builtin_define("__int128=__size128_t"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define("_XOPEN_SOURCE=500"); \
+ builtin_define("_XOPEN_SOURCE_EXTENDED=1"); \
+ builtin_define("_LARGE_FILE_API"); \
+ builtin_define("_ALL_SOURCE"); \
+ } \
+} while (0)
+
/* A C string constant that tells the GNU CC driver program options to pass to
CPP. It can also specify how to translate options you give to GNU CC into
options for GNU CC to pass to the CPP. */
-/* If -ansi, we need to define _ANSI_C_SOURCE to get the right headers. */
#undef CPP_SPEC
#define CPP_SPEC "\
-%{mcpu=itanium:-D__itanium__} %{mbig-endian:-D__BIG_ENDIAN__} \
-%{ansi:-D_ANSI_C_SOURCE} \
-%{posix:-D_POSIX_SOURCE} \
-%{cpp_cpu} \
--D__LONG_MAX__=9223372036854775807L"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "\
- -D_AIX -D_AIX64 -D_LONGLONG -Dunix \
- -Asystem=unix -Asystem=aix \
- -D__64BIT__ -D_LONG_LONG -D_IA64 -D__int128=__size128_t"
-
-/* The GNU C++ standard library requires that these macros be defined. */
-#undef CPLUSPLUS_CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC \
- "-D_XOPEN_SOURCE=500 \
- -D_XOPEN_SOURCE_EXTENDED=1 \
- -D_LARGE_FILE_API \
- -D_ALL_SOURCE \
- -D__LONG_MAX__=9223372036854775807L \
- %{cpp_cpu}"
+%{posix:-D_POSIX_SOURCE}"
/* Define this for shared library support. */
@@ -132,103 +134,14 @@ do { \
#define STANDARD_STARTFILE_PREFIX "/usr/lib/ia64l64/"
#endif
-/* Override SELECT_SECTION and SELECT_RTX_SECTION from config/ia64/sysv4.h;
- these definitions ignore flag_pic as if it were always set;
- it is illegal to have relocations in shared segments on AIX. */
-
-/* A C statement or statements to switch to the appropriate
- section for output of DECL. DECL is either a `VAR_DECL' node
- or a constant of some sort. RELOC indicates whether forming
- the initial value of DECL requires link-time relocations. */
-
-#undef SELECT_SECTION
-#define SELECT_SECTION(DECL,RELOC,ALIGN) \
-{ \
- if (TREE_CODE (DECL) == STRING_CST) \
- { \
- if (! flag_writable_strings) \
- const_section (); \
- else \
- data_section (); \
- } \
- else if (TREE_CODE (DECL) == VAR_DECL) \
- { \
- if (XSTR (XEXP (DECL_RTL (DECL), 0), 0)[0] \
- == SDATA_NAME_FLAG_CHAR) \
- sdata_section (); \
- /* ??? We need the extra ! RELOC check, because the default is to \
- only check RELOC if flag_pic is set, and we don't set flag_pic \
- (yet?). */ \
- else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC)) \
- const_section (); \
- else \
- data_section (); \
- } \
- /* This could be a CONSTRUCTOR containing ADDR_EXPR of a VAR_DECL, \
- in which case we can't put it in a shared library rodata. */ \
- else if (RELOC) \
- data_section (); \
- else \
- const_section (); \
-}
-
-/* Similarly for constant pool data. */
-
-extern unsigned int ia64_section_threshold;
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
-{ \
- if (GET_MODE_SIZE (MODE) > 0 \
- && GET_MODE_SIZE (MODE) <= ia64_section_threshold) \
- sdata_section (); \
- else if (symbolic_operand ((RTX), (MODE))) \
- data_section (); \
- else \
- const_section (); \
-}
-
-#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL, RELOC) \
- do \
- { \
- int len; \
- int sec; \
- const char *name; \
- char *string; \
- const char *prefix; \
- static const char *const prefixes[/*4*/3][2] = \
- { \
- { ".text.", ".gnu.linkonce.t." }, \
- { ".rodata.", ".gnu.linkonce.r." }, \
- { ".data.", ".gnu.linkonce.d." } \
- /* Do not generate unique sections for uninitialised \
- data since we do not have support for this in the \
- linker scripts yet... \
- ,{ ".bss.", ".gnu.linkonce.b." } */ \
- }; \
- \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- sec = 0; \
- /* else if (DECL_INITIAL (DECL) == 0 \
- || DECL_INITIAL (DECL) == error_mark_node) \
- sec = 3; */ \
- else if (DECL_READONLY_SECTION (DECL, RELOC) && ! (RELOC))\
- sec = 1; \
- else \
- sec = 2; \
- \
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
- /* Strip off any encoding in name. */ \
- STRIP_NAME_ENCODING (name, name); \
- prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \
- len = strlen (name) + strlen (prefix); \
- string = alloca (len + 1); \
- \
- sprintf (string, "%s%s", prefix, name); \
- \
- DECL_SECTION_NAME (DECL) = build_string (len, string); \
- } \
- while (0)
+/* It is illegal to have relocations in shared segments on AIX.
+ Pretend flag_pic is always set. */
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION ia64_rwreloc_select_section
+#undef TARGET_ASM_UNIQUE_SECTION
+#define TARGET_ASM_UNIQUE_SECTION ia64_rwreloc_unique_section
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION ia64_rwreloc_select_rtx_section
/* Override ia64/sysv4.h setting with that used by AIX5. */
#undef WCHAR_TYPE
OpenPOWER on IntegriCloud