]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/ia64/vms.h
linux.h (MD_UNWIND_SUPPORT): Remove.
[thirdparty/gcc.git] / gcc / config / ia64 / vms.h
1 /* Definitions of target machine GNU compiler. IA64-VMS version.
2 Copyright (C) 2003-2011 Free Software Foundation, Inc.
3 Contributed by Douglas B Rupp (rupp@gnat.com).
4
5 This file is part of GCC.
6
7 GCC 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 3, or (at your option)
10 any later version.
11
12 GCC 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 GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #define TARGET_OBJECT_SUFFIX ".obj"
22 #define TARGET_EXECUTABLE_SUFFIX ".exe"
23
24 #define OBJECT_FORMAT_ELF
25
26 #define TARGET_OS_CPP_BUILTINS() \
27 do { \
28 builtin_define_std ("vms"); \
29 builtin_define_std ("VMS"); \
30 builtin_define ("__IA64"); \
31 builtin_assert ("system=vms"); \
32 builtin_define ("__IEEE_FLOAT"); \
33 } while (0)
34
35 /* By default, allow $ to be part of an identifier. */
36 #define DOLLARS_IN_IDENTIFIERS 2
37
38 #undef TARGET_ABI_OPEN_VMS
39 #define TARGET_ABI_OPEN_VMS 1
40
41 /* Need .debug_line info generated from gcc and gas. */
42 #undef TARGET_DEFAULT
43 #define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
44
45 #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
46
47 /* "long" is 32 bits, but 64 bits for Ada. */
48 #undef LONG_TYPE_SIZE
49 #define LONG_TYPE_SIZE 32
50 #define ADA_LONG_TYPE_SIZE 64
51
52 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
53 #undef POINTER_SIZE
54 #define POINTER_SIZE 32
55 #define POINTERS_EXTEND_UNSIGNED 0
56
57 #undef MAX_OFILE_ALIGNMENT
58 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
59
60 /* Widest floating-point type efficiently supported by hardware and OS. */
61 #undef WIDEST_HARDWARE_FP_SIZE
62 #define WIDEST_HARDWARE_FP_SIZE 64
63
64 /* The structure return address arrives as an "argument" on VMS. */
65 #undef PCC_STATIC_STRUCT_RETURN
66
67 /* Turn on VMS specific Dwarf2 features. */
68 #define VMS_DEBUGGING_INFO 1
69
70 #define ASM_OUTPUT_DWARF_VMS_DELTA(FILE,SIZE,LABEL1,LABEL2) \
71 do { \
72 fprintf (FILE, "\tdata4.ua\t@slotcount("); \
73 assemble_name (FILE, LABEL1); \
74 fprintf (FILE, "-"); \
75 assemble_name (FILE, LABEL2); \
76 fprintf (FILE, ")"); \
77 } while (0)
78
79 #undef STARTFILE_SPEC
80 #define STARTFILE_SPEC \
81 "%{!shared:%{mvms-return-codes:vcrt0.o%s} %{!mvms-return-codes:pcrt0.o%s} \
82 crtbegin.o%s} \
83 %{!static:%{shared:crtinitS.o%s crtbeginS.o%s}}"
84
85 #undef ENDFILE_SPEC
86 #define ENDFILE_SPEC \
87 "%{!shared:crtend.o%s} %{!static:%{shared:crtendS.o%s}}"
88
89 #define LINK_GCC_C_SEQUENCE_SPEC "%G"
90
91 #undef LINK_SPEC
92 #define LINK_SPEC "%{g*} %{map} %{save-temps} %{shared} %{v}"
93
94 #undef LIB_SPEC
95 #define LIB_SPEC ""
96
97 #undef ASM_SPEC
98 #define ASM_SPEC \
99 "%{mno-gnu-as:-N so -N vms_upcase -W DVLoc_off} %{mconstant-gp:-M const_gp} \
100 %{mauto-pic:-M no_plabel} %{source-listing:-ahdl=%b.lis}"
101
102 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
103 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
104 do { \
105 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
106 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
107 } while (0)
108
109 /* Set the function to change the names of the division and modulus
110 functions. */
111 #undef TARGET_INIT_LIBFUNCS
112 #define TARGET_INIT_LIBFUNCS ia64_vms_init_libfuncs
113
114 #define NAME__MAIN "__gccmain"
115 #define SYMBOL__MAIN __gccmain
116
117 #define CTOR_LIST_BEGIN asm (".global\tLIB$INITIALIZE#\n"); \
118 STATIC func_ptr __CTOR_LIST__[1] \
119 __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) \
120 = { (func_ptr) (-1) };
121
122 #undef INIT_SECTION_ASM_OP
123 #define INIT_SECTION_ASM_OP ".section\tLIB$INITIALIZE#,\"a\",@progbits"
124
125 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
126 asm (SECTION_OP "\n\tdata4 @fptr(" #FUNC"#)\n"); \
127 FORCE_CODE_SECTION_ALIGN \
128 asm (TEXT_SECTION_ASM_OP);
129
130 #undef FINI_SECTION_ASM_OP
131
132 /* Maybe same as HPUX? Needs to be checked. */
133 #define JMP_BUF_SIZE (8 * 76)
134
135 typedef struct crtl_name_spec
136 {
137 const char *const name;
138 const char *deccname;
139 int referenced;
140 } crtl_name_spec;
141
142 #include "config/vms/vms-crtl.h"
143
144 /* Alias CRTL names to 32/64bit DECCRTL functions.
145 Fixme: This should do a binary search. */
146 #define DO_CRTL_NAMES \
147 do \
148 { \
149 int i; \
150 static crtl_name_spec vms_crtl_names[] = CRTL_NAMES; \
151 static int malloc64_init = 0; \
152 \
153 if ((malloc64_init == 0) && TARGET_MALLOC64) \
154 { \
155 for (i=0; vms_crtl_names [i].name; i++) \
156 { \
157 if (strcmp ("calloc", vms_crtl_names [i].name) == 0) \
158 vms_crtl_names [i].deccname = "decc$_calloc64"; \
159 else \
160 if (strcmp ("malloc", vms_crtl_names [i].name) == 0) \
161 vms_crtl_names [i].deccname = "decc$_malloc64"; \
162 else \
163 if (strcmp ("realloc", vms_crtl_names [i].name) == 0) \
164 vms_crtl_names [i].deccname = "decc$_realloc64"; \
165 else \
166 if (strcmp ("strdup", vms_crtl_names [i].name) == 0) \
167 vms_crtl_names [i].deccname = "decc$_strdup64"; \
168 } \
169 malloc64_init = 1; \
170 } \
171 for (i=0; vms_crtl_names [i].name; i++) \
172 if (!vms_crtl_names [i].referenced && \
173 (strcmp (name, vms_crtl_names [i].name) == 0)) \
174 { \
175 fprintf (file, "\t.alias %s, \"%s\"\n", \
176 name, vms_crtl_names [i].deccname); \
177 vms_crtl_names [i].referenced = 1; \
178 } \
179 } while (0)
180
181 #undef SUBTARGET_OPTIMIZATION_OPTIONS
182 #define SUBTARGET_OPTIMIZATION_OPTIONS \
183 { OPT_LEVELS_ALL, OPT_fmerge_constants, NULL, 0 }
184
185 /* Define this to be nonzero if static stack checking is supported. */
186 #define STACK_CHECK_STATIC_BUILTIN 1
187
188 #define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
189 #define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
190
191 /* Minimum amount of stack required to recover from an anticipated stack
192 overflow detection. The default value conveys an estimate of the amount
193 of stack required to propagate an exception. */
194 #define STACK_CHECK_PROTECT (24 * 1024)
195
196 #undef ASM_OUTPUT_ALIGNED_DECL_COMMON
197 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
198 ia64_vms_output_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN)
199
200 #undef TARGET_VALID_POINTER_MODE
201 #define TARGET_VALID_POINTER_MODE ia64_vms_valid_pointer_mode
202
203 #undef TARGET_ASM_NAMED_SECTION
204 #define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section