xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/ia64/aix.h (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 /* Definitions of target machine GNU compiler.  IA-64/AIX version.
2    Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3    Contributed by Timothy Wall (twall@cygnus.com)
4 
5 This file is part of GNU CC.
6 
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11 
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21 
22 /* AIX5 (aka Monterey): a mix of AIX and UnixWare.
23    This file is loosely based on ia64/linux.h.  */
24 
25 /* This macro is a C statement to print on `stderr' a string describing the
26    particular machine description choice.  */
27 
28 #define TARGET_VERSION fprintf (stderr, " (IA-64) AIX");
29 
30 #undef ASM_APP_ON
31 #define ASM_APP_ON "#APP\n"
32 
33 #undef ASM_APP_OFF
34 #define ASM_APP_OFF "#NO_APP\n"
35 
36 #define SET_ASM_OP	"\t.set\t"
37 
38 #undef MD_EXEC_PREFIX
39 #undef MD_STARTFILE_PREFIX
40 #define MD_STARTFILE_PREFIX "/usr/lib/ia64l64/"
41 
42 /* Output at beginning of assembler file.  */
43 /* The .file command should always begin the output.  */
44 #undef ASM_FILE_START
45 #define ASM_FILE_START(FILE)						\
46   do {									\
47 	output_file_directive (FILE, main_input_filename);		\
48 	fprintf (FILE, "\t.version\t\"01.01\"\n");			\
49   } while (0)
50 
51 /* Provide a STARTFILE_SPEC appropriate for AIX.  Here we add
52    the crti C++ startup files file which provide part of the support
53    for getting C++ file-scope static object constructed before entering
54    `main'.  */
55 
56 #undef	STARTFILE_SPEC
57 #define STARTFILE_SPEC \
58 "%{!shared: \
59    %{pg:gcrt1_64.o%s} %{!pg:%{p:mcrt1_64.o%s} \
60                         %{!p:%{profile:gcrt1_64.o%s} \
61                           %{!profile:crt1_64.o%s}}}} \
62  crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
63 
64 /* Provide a ENDFILE_SPEC appropriate for AIX.  Here we tack on
65    the crtn file which provides termination of the support for getting C++
66    file-scope static object constructed before entering `main'.  */
67 
68 #undef  ENDFILE_SPEC
69 #define ENDFILE_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
70 
71 /* Define this so we can compile MS code for use with WINE.  */
72 #define HANDLE_PRAGMA_PACK_PUSH_POP
73 
74 /* Target OS builtins.  */
75 #define TARGET_OS_CPP_BUILTINS()			\
76 do {							\
77 	if (flag_iso)					\
78 	  builtin_define("_ANSI_C_SOURCE");		\
79 	builtin_define("_AIX");				\
80 	builtin_define("_AIX64");			\
81 	builtin_define("unix");				\
82 	builtin_assert("system=unix");			\
83 	builtin_assert("system=aix");			\
84 	builtin_define("__64BIT__");			\
85 	builtin_define("_LONG_LONG");			\
86 	builtin_define("_IA64");			\
87 	builtin_define("__int128=__size128_t");		\
88 	if (c_language == clk_cplusplus)		\
89 	  {						\
90 	    builtin_define("_XOPEN_SOURCE=500");	\
91 	    builtin_define("_XOPEN_SOURCE_EXTENDED=1");	\
92 	    builtin_define("_LARGE_FILE_API");		\
93 	    builtin_define("_ALL_SOURCE");		\
94 	  }						\
95 } while (0)
96 
97 /* A C string constant that tells the GNU CC driver program options to pass to
98    CPP.  It can also specify how to translate options you give to GNU CC into
99    options for GNU CC to pass to the CPP.  */
100 
101 #undef CPP_SPEC
102 #define CPP_SPEC "\
103 %{posix:-D_POSIX_SOURCE}"
104 
105 /* Define this for shared library support.  */
106 
107 #undef LINK_SPEC
108 #define LINK_SPEC "\
109 %{shared:-shared} \
110 %{!shared: \
111   %{!static: \
112     %{rdynamic:-export-dynamic} \
113     %{!dynamic-linker:-dynamic-linker /usr/lib/ia64l64/libc.so.1}} \
114     %{static:-static}}"
115 
116 #define JMP_BUF_SIZE  85
117 
118 /* A C statement or compound statement to output to FILE some assembler code to
119    call the profiling subroutine `mcount'.
120 
121    FIXME this is not supported until xlC supports it and can thus tell us
122    how to do it.
123 */
124 
125 #undef FUNCTION_PROFILER
126 #define FUNCTION_PROFILER(FILE, LABELNO)		\
127 do {							\
128 } while (0)
129 
130 /* Tell the linker where to find the crt*.o files.  */
131 
132 #ifndef CROSS_COMPILE
133 #undef STANDARD_STARTFILE_PREFIX
134 #define STANDARD_STARTFILE_PREFIX "/usr/lib/ia64l64/"
135 #endif
136 
137 /* It is illegal to have relocations in shared segments on AIX.
138    Pretend flag_pic is always set.  */
139 #undef	TARGET_ASM_SELECT_SECTION
140 #define TARGET_ASM_SELECT_SECTION  ia64_rwreloc_select_section
141 #undef	TARGET_ASM_UNIQUE_SECTION
142 #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
143 #undef	TARGET_ASM_SELECT_RTX_SECTION
144 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section
145 
146 /* Override ia64/sysv4.h setting with that used by AIX5.  */
147 #undef WCHAR_TYPE
148 #ifdef __64BIT__
149 #define WCHAR_TYPE "unsigned int"
150 #else
151 #define WCHAR_TYPE "unsigned short"
152 #endif
153 
154 /* Define the `__builtin_va_list' type for AIX.  Use char* b/c that's what the
155    system headers expect.  */
156 #define BUILD_VA_LIST_TYPE(VALIST) \
157   (VALIST) = build_pointer_type(char_type_node)
158 
159 /* End of aix.h */
160