]>
git.ipfire.org Git - thirdparty/gcc.git/blob - 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).
5 This file is part of GCC.
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)
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.
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/>. */
21 #define TARGET_OBJECT_SUFFIX ".obj"
22 #define TARGET_EXECUTABLE_SUFFIX ".exe"
24 #define OBJECT_FORMAT_ELF
26 #define TARGET_OS_CPP_BUILTINS() \
28 builtin_define_std ("vms"); \
29 builtin_define_std ("VMS"); \
30 builtin_define ("__IA64"); \
31 builtin_assert ("system=vms"); \
32 builtin_define ("__IEEE_FLOAT"); \
35 /* By default, allow $ to be part of an identifier. */
36 #define DOLLARS_IN_IDENTIFIERS 2
38 #undef TARGET_ABI_OPEN_VMS
39 #define TARGET_ABI_OPEN_VMS 1
41 /* Need .debug_line info generated from gcc and gas. */
43 #define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
45 #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
47 /* "long" is 32 bits, but 64 bits for Ada. */
49 #define LONG_TYPE_SIZE 32
50 #define ADA_LONG_TYPE_SIZE 64
52 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
54 #define POINTER_SIZE 32
55 #define POINTERS_EXTEND_UNSIGNED 0
57 #undef MAX_OFILE_ALIGNMENT
58 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
60 /* Widest floating-point type efficiently supported by hardware and OS. */
61 #undef WIDEST_HARDWARE_FP_SIZE
62 #define WIDEST_HARDWARE_FP_SIZE 64
64 /* The structure return address arrives as an "argument" on VMS. */
65 #undef PCC_STATIC_STRUCT_RETURN
67 /* Turn on VMS specific Dwarf2 features. */
68 #define VMS_DEBUGGING_INFO 1
70 #define ASM_OUTPUT_DWARF_VMS_DELTA(FILE,SIZE,LABEL1,LABEL2) \
72 fprintf (FILE, "\tdata4.ua\t@slotcount("); \
73 assemble_name (FILE, LABEL1); \
74 fprintf (FILE, "-"); \
75 assemble_name (FILE, LABEL2); \
76 fprintf (FILE, ")"); \
80 #define STARTFILE_SPEC \
81 "%{!shared:%{mvms-return-codes:vcrt0.o%s} %{!mvms-return-codes:pcrt0.o%s} \
83 %{!static:%{shared:crtinitS.o%s crtbeginS.o%s}}"
86 #define ENDFILE_SPEC \
87 "%{!shared:crtend.o%s} %{!static:%{shared:crtendS.o%s}}"
89 #define LINK_GCC_C_SEQUENCE_SPEC "%G"
92 #define LINK_SPEC "%{g*} %{map} %{save-temps} %{shared} %{v}"
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}"
102 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
103 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
105 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
106 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
109 /* Set the function to change the names of the division and modulus
111 #undef TARGET_INIT_LIBFUNCS
112 #define TARGET_INIT_LIBFUNCS ia64_vms_init_libfuncs
114 #define NAME__MAIN "__gccmain"
115 #define SYMBOL__MAIN __gccmain
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) };
122 #undef INIT_SECTION_ASM_OP
123 #define INIT_SECTION_ASM_OP ".section\tLIB$INITIALIZE#,\"a\",@progbits"
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);
130 #undef FINI_SECTION_ASM_OP
132 /* Maybe same as HPUX? Needs to be checked. */
133 #define JMP_BUF_SIZE (8 * 76)
135 typedef struct crtl_name_spec
137 const char *const name
;
138 const char *deccname
;
142 #include "config/vms/vms-crtl.h"
144 /* Alias CRTL names to 32/64bit DECCRTL functions.
145 Fixme: This should do a binary search. */
146 #define DO_CRTL_NAMES \
150 static crtl_name_spec vms_crtl_names[] = CRTL_NAMES; \
151 static int malloc64_init = 0; \
153 if ((malloc64_init == 0) && TARGET_MALLOC64) \
155 for (i=0; vms_crtl_names [i].name; i++) \
157 if (strcmp ("calloc", vms_crtl_names [i].name) == 0) \
158 vms_crtl_names [i].deccname = "decc$_calloc64"; \
160 if (strcmp ("malloc", vms_crtl_names [i].name) == 0) \
161 vms_crtl_names [i].deccname = "decc$_malloc64"; \
163 if (strcmp ("realloc", vms_crtl_names [i].name) == 0) \
164 vms_crtl_names [i].deccname = "decc$_realloc64"; \
166 if (strcmp ("strdup", vms_crtl_names [i].name) == 0) \
167 vms_crtl_names [i].deccname = "decc$_strdup64"; \
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)) \
175 fprintf (file, "\t.alias %s, \"%s\"\n", \
176 name, vms_crtl_names [i].deccname); \
177 vms_crtl_names [i].referenced = 1; \
181 #undef SUBTARGET_OPTIMIZATION_OPTIONS
182 #define SUBTARGET_OPTIMIZATION_OPTIONS \
183 { OPT_LEVELS_ALL, OPT_fmerge_constants, NULL, 0 }
185 /* Define this to be nonzero if static stack checking is supported. */
186 #define STACK_CHECK_STATIC_BUILTIN 1
188 #define UNW_IVMS_MODE(HEADER) (((HEADER) >> 44) & 0x3L)
189 #define MD_UNW_COMPATIBLE_PERSONALITY_P(HEADER) (!UNW_IVMS_MODE (HEADER))
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)
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)
200 #undef TARGET_VALID_POINTER_MODE
201 #define TARGET_VALID_POINTER_MODE ia64_vms_valid_pointer_mode
203 #undef TARGET_ASM_NAMED_SECTION
204 #define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section