]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/rs6000/aix.h
Makefile.def (target_modules): Remove libmudflap
[thirdparty/gcc.git] / gcc / config / rs6000 / aix.h
CommitLineData
9ebbca7d
GK
1/* Definitions of target machine for GNU compiler,
2 for IBM RS/6000 POWER running AIX.
d1e082c2 3 Copyright (C) 2000-2013 Free Software Foundation, Inc.
9ebbca7d 4
5de601cf 5 This file is part of GCC.
9ebbca7d 6
5de601cf
NC
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
2f83c7d6 9 by the Free Software Foundation; either version 3, or (at your
5de601cf 10 option) any later version.
9ebbca7d 11
5de601cf
NC
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
9ebbca7d 16
5de601cf 17 You should have received a copy of the GNU General Public License
2f83c7d6
NC
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
9ebbca7d
GK
20
21/* Yes! We are AIX! */
22#define DEFAULT_ABI ABI_AIX
774b5662 23#undef TARGET_AIX
2bfcf297 24#define TARGET_AIX 1
774b5662 25
78009d9f
MM
26/* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used
27 in the #if conditional in options-default.h, so provide another macro. */
146d930b 28#undef TARGET_AIX_OS
78009d9f
MM
29#define TARGET_AIX_OS 1
30
774b5662
DE
31/* AIX always has a TOC. */
32#define TARGET_NO_TOC 0
33#define TARGET_TOC 1
34#define FIXED_R2 1
35
36/* AIX allows r13 to be used in 32-bit mode. */
37#define FIXED_R13 0
38
4e9d3943
DE
39/* 32-bit and 64-bit AIX stack boundary is 128. */
40#undef STACK_BOUNDARY
41#define STACK_BOUNDARY 128
42
602ea4d3
JJ
43#undef TARGET_IEEEQUAD
44#define TARGET_IEEEQUAD 0
774b5662 45
84c041a1
ZW
46/* The AIX linker will discard static constructors in object files before
47 collect has a chance to see them, so scan the object files directly. */
48#define COLLECT_EXPORT_LIST
9ebbca7d 49
636cf8b1 50#if HAVE_AS_REF
7e49a4b3
OH
51/* Issue assembly directives that create a reference to the given DWARF table
52 identifier label from the current function section. This is defined to
53 ensure we drag frame frame tables associated with needed function bodies in
54 a link with garbage collection activated. */
55#define ASM_OUTPUT_DWARF_TABLE_REF rs6000_aix_asm_output_dwarf_table_ref
636cf8b1 56#endif
7e49a4b3 57
9ebbca7d
GK
58/* This is the only version of nm that collect2 can work with. */
59#define REAL_NM_FILE_NAME "/usr/ucb/nm"
60
2bfcf297 61#define USER_LABEL_PREFIX ""
6de9cd9a 62
9ebbca7d
GK
63/* Don't turn -B into -L if the argument specifies a relative file name. */
64#define RELATIVE_PREFIX_NOT_LINKDIR
65
fc51424c
RH
66/* Because of the above, we must have gcc search itself to find libgcc.a. */
67#define LINK_LIBGCC_SPECIAL_1
9ebbca7d 68
fc51424c 69/* Names to predefine in the preprocessor for this target machine. */
bb904c1a
DE
70#define TARGET_OS_AIX_CPP_BUILTINS() \
71 do \
72 { \
73 builtin_define ("_IBMR2"); \
74 builtin_define ("_POWER"); \
7a9a6698
DE
75 builtin_define ("__powerpc__"); \
76 builtin_define ("__PPC__"); \
77 builtin_define ("__unix__"); \
bb904c1a
DE
78 builtin_define ("_AIX"); \
79 builtin_define ("_AIX32"); \
80 builtin_define ("_AIX41"); \
81 builtin_define ("_LONG_LONG"); \
82 if (TARGET_LONG_DOUBLE_128) \
83 builtin_define ("__LONGDOUBLE128"); \
84 builtin_assert ("system=unix"); \
85 builtin_assert ("system=aix"); \
86 } \
7990b46f 87 while (0)
9ebbca7d 88
d6121128
AO
89/* Define appropriate architecture macros for preprocessor depending on
90 target switches. */
91
92#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
4c4eb375 93 %{ansi: -D_ANSI_C_SOURCE}"
2bfcf297 94
0eab6840
DE
95#define CC1_SPEC "%(cc1_cpu)"
96
f984d8df 97#undef ASM_DEFAULT_SPEC
2bfcf297
DB
98#define ASM_DEFAULT_SPEC ""
99
9ebbca7d
GK
100/* Tell the assembler to assume that all undefined names are external.
101
102 Don't do this until the fixed IBM assembler is more generally available.
103 When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,
104 ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no
1bc7c5b6
ZW
105 longer be needed. Also, the extern declaration of mcount in
106 rs6000_xcoff_file_start will no longer be needed. */
9ebbca7d
GK
107
108/* #define ASM_SPEC "-u %(asm_cpu)" */
109
110/* Default location of syscalls.exp under AIX */
7f142d33 111#define LINK_SYSCALLS_SPEC "-bI:%R/lib/syscalls.exp"
9ebbca7d
GK
112
113/* Default location of libg.exp under AIX */
7f142d33 114#define LINK_LIBG_SPEC "-bexport:%R/usr/lib/libg.exp"
9ebbca7d
GK
115
116/* Define the options for the binder: Start text at 512, align all segments
117 to 512 bytes, and warn if there is text relocation.
118
a9098fd0 119 The -bhalt:4 option supposedly changes the level at which ld will abort,
9ebbca7d
GK
120 but it also suppresses warnings about multiply defined symbols and is
121 used by the AIX cc command. So we use it here.
122
123 -bnodelcsect undoes a poor choice of default relating to multiply-defined
124 csects. See AIX documentation for more information about this.
125
a9098fd0 126 -bM:SRE tells the linker that the output file is Shared REusable. Note
9ebbca7d
GK
127 that to actually build a shared library you will also need to specify an
128 export list with the -Wl,-bE option. */
129
130#define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
131%{static:-bnso %(link_syscalls) } \
132%{!shared:%{g*: %(link_libg) }} %{shared:-bM:SRE}"
133
134/* Profiled library versions are used by linking with special directories. */
7f142d33
RS
135#define LIB_SPEC "%{pg:-L%R/lib/profiled -L%R/usr/lib/profiled}\
136%{p:-L%R/lib/profiled -L%R/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc"
9ebbca7d 137
ce75e1dd 138/* Static linking with shared libstdc++ requires libsupc++ as well. */
d9d16a19 139#define LIBSTDCXX_STATIC "supc++"
ce75e1dd 140
a3c9585f 141/* This now supports a natural alignment mode. */
3b85fe5f
JJ
142/* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
143#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
dd25a747
AM
144 ((TARGET_ALIGN_NATURAL == 0 \
145 && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
146 ? MIN ((COMPUTED), 32) \
147 : (COMPUTED))
3b85fe5f 148
2bfcf297
DB
149/* AIX increases natural record alignment to doubleword if the first
150 field is an FP double while the FP fields remain word aligned. */
4e9d3943
DE
151#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
152 ((TREE_CODE (STRUCT) == RECORD_TYPE \
153 || TREE_CODE (STRUCT) == UNION_TYPE \
154 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
155 && TARGET_ALIGN_NATURAL == 0 \
156 ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
2bfcf297
DB
157 : MAX ((COMPUTED), (SPECIFIED)))
158
8d05ebaa
DE
159/* The AIX ABI isn't explicit on whether aggregates smaller than a
160 word/doubleword should be padded upward or downward. One could
161 reasonably assume that they follow the normal rules for structure
162 layout treating the parameter area as any other block of memory,
163 then map the reg param area to registers, i.e., pad upward, which
164 is the way IBM Compilers for AIX behave.
368ebcd6 165 Setting both of the following defines results in this behavior. */
8d05ebaa
DE
166#define AGGREGATE_PADDING_FIXED 1
167#define AGGREGATES_PAD_UPWARD_ALWAYS 1
168
8d05ebaa
DE
169/* Specify padding for the last element of a block move between
170 registers and memory. FIRST is nonzero if this is the only
171 element. */
172#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
173 (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
174
9ebbca7d
GK
175/* Indicate that jump tables go in the text section. */
176
177#define JUMP_TABLES_IN_TEXT_SECTION 1
178
9ebbca7d
GK
179/* Define any extra SPECS that the compiler needs to generate. */
180#undef SUBTARGET_EXTRA_SPECS
181#define SUBTARGET_EXTRA_SPECS \
182 { "link_syscalls", LINK_SYSCALLS_SPEC }, \
183 { "link_libg", LINK_LIBG_SPEC }
184
411707f4 185#define PROFILE_HOOK(LABEL) output_profile_hook (LABEL)
b91da81f 186
66188a7e
GK
187/* No version of AIX fully supports AltiVec or 64-bit instructions in
188 32-bit mode. */
189#define OS_MISSING_POWERPC64 1
190#define OS_MISSING_ALTIVEC 1
466db3c1
DE
191
192/* WINT_TYPE */
193#define WINT_TYPE "int"
39acb18f
EB
194
195/* Static stack checking is supported by means of probes. */
196#define STACK_CHECK_STATIC_BUILTIN 1