* Makefile.in (final.o): Depend on target.h.
[official-gcc.git] / gcc / config / i386 / osf1elf.h
blob4c5238990e94898477e0b74c3a1c00eac65bfb6a
1 /* OSF/1 1.3 now is compitable with SVR4, so include sysv4.h, and
2 put difference here.
3 Copyright (C) 2000 Free Software Foundation, Inc. */
5 #include <stdio.h>
6 #include "i386/sysv4.h" /* Base i386 target machine definitions */
8 #undef TARGET_VERSION
9 #define TARGET_VERSION fprintf (stderr, " (i386 OSF/1)");
11 #define TARGET_OSF1ELF
13 /* WORD_SWITCH_TAKES_ARG defined in svr4 is not correct. We also
14 need an extra -soname */
15 #undef WORD_SWITCH_TAKES_ARG
16 #define WORD_SWITCH_TAKES_ARG(STR) \
17 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
18 || !strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
19 || !strcmp (STR, "Tbss") || !strcmp (STR, "soname"))
21 /* Note, -fpic and -fPIC are equivalent */
22 #undef CPP_SPEC
23 #define CPP_SPEC "\
24 %(cpp_cpu) \
25 %{fpic: -D__SHARED__} %{fPIC: %{!fpic: -D__SHARED__}} \
26 %{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \
27 %{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
28 %{.cc: -D__LANGUAGE_C_PLUS_PLUS} \
29 %{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \
30 %{.C: -D__LANGUAGE_C_PLUS_PLUS} \
31 %{.m: -D__LANGUAGE_OBJECTIVE_C} \
32 %{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"
34 /* -mmcount or -mno-mcount should be used with -pg or -p */
35 #undef CC1_SPEC
36 #define CC1_SPEC "%(cc1_cpu) %{p: %{!mmcount: %{!mno-mcount: -mno-mcount }}} \
37 %{!p: %{pg: %{!mmcount: %{!mno-mcount: -mno-mcount }}}}"
39 /* Note, -D__NO_UNDERSCORES__ -D__ELF__ are provided in the older version of
40 OSF/1 gcc. We keep them here, so that old /usr/include/i386/asm.h works.
42 #undef CPP_PREDEFINES
43 #define CPP_PREDEFINES \
44 "-D__NO_UNDERSCORES__ -D__ELF__ -DOSF -DOSF1 -Dunix \
45 -Asystem=unix -Asystem=xpg4 -Asystem=osf1"
47 /* current OSF/1 doesn't provide separate crti.o and gcrti.o (and also, crtn.o
48 and gcrtn.o) for profile. */
50 #undef STARTFILE_SPEC
51 #define STARTFILE_SPEC "%{!shared: \
52 %{!symbolic: \
53 %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
54 crti.o%s \
55 crtbegin.o%s"
57 #undef ENDFILE_SPEC
58 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
60 #undef ASM_SPEC
61 #define ASM_SPEC "%{v*: -v}"
63 #undef LINK_SPEC
64 #define LINK_SPEC "%{v*: -v} \
65 %{h*} %{z*} \
66 %{dy:-call_shared} %{dn:-static} \
67 %{static:-static} \
68 %{shared:-shared} \
69 %{call_shared:-call_shared} \
70 %{symbolic:-Bsymbolic -shared -call_shared} \
71 %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \
72 %{noshrlib: -static } \
73 %{!noshrlib: -call_shared}}}}}}"
75 #undef MD_EXEC_PREFIX
76 #define MD_EXEC_PREFIX "/usr/ccs/gcc/"
78 #undef MD_STARTFILE_PREFIX
79 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
81 /* Define this macro meaning that gcc should find the library 'libgcc.a'
82 by hand, rather than passing the argument '-lgcc' to tell the linker
83 to do the search */
84 #define LINK_LIBGCC_SPECIAL
86 /* This goes with LINK_LIBGCC_SPECIAL, we need tell libgcc.a differently */
87 #undef LIBGCC_SPEC
88 #define LIBGCC_SPEC "%{!shared:%{!symbolic:libgcc.a%s}}"
90 /* Specify size_t, ptrdiff_t, and wchar_t types. */
91 #undef SIZE_TYPE
92 #undef PTRDIFF_TYPE
93 #undef WCHAR_TYPE
94 #undef WCHAR_TYPE_SIZE
96 #define SIZE_TYPE "long unsigned int"
97 #define PTRDIFF_TYPE "int"
98 #define WCHAR_TYPE "unsigned int"
99 #define WCHAR_TYPE_SIZE BITS_PER_WORD
101 /* Turn off long double being 96 bits. */
102 #undef LONG_DOUBLE_TYPE_SIZE
103 #define LONG_DOUBLE_TYPE_SIZE 64
105 /* Work with OSF/1 profile */
106 #define MASK_NO_MCOUNT 000200000000 /* profiling uses mcount_ptr */
108 #define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0)
110 #undef SUBTARGET_SWITCHES
111 #define SUBTARGET_SWITCHES \
112 { "mcount", -MASK_NO_MCOUNT, \
113 N_("Profiling uses mcount") }, \
114 { "no-mcount", MASK_NO_MCOUNT, "" },
116 /* This macro generates the assembly code for function entry.
117 FILE is a stdio stream to output the code to.
118 SIZE is an int: how many units of temporary storage to allocate.
119 Refer to the array `regs_ever_live' to determine which registers
120 to save; `regs_ever_live[I]' is nonzero if register number I
121 is ever used in the function. This macro is responsible for
122 knowing which registers should not be saved even if used.
124 We override it here to allow for the new profiling code to go before
125 the prologue and the old mcount code to go after the prologue (and
126 after %ebx has been set up for ELF shared library support). */
127 #if 0
128 #define OSF_PROFILE_BEFORE_PROLOGUE \
129 (!TARGET_MCOUNT \
130 && !current_function_needs_context \
131 && (!flag_pic \
132 || !frame_pointer_needed \
133 || (!current_function_uses_pic_offset_table \
134 && !current_function_uses_const_pool)))
135 #else
136 #define OSF_PROFILE_BEFORE_PROLOGUE 0
137 #endif
139 /* A C statement or compound statement to output to FILE some assembler code to
140 call the profiling subroutine `mcount'. Before calling, the assembler code
141 must load the address of a counter variable into a register where `mcount'
142 expects to find the address. The name of this variable is `LP' followed by
143 the number LABELNO, so you would generate the name using `LP%d' in a
144 `fprintf'.
146 The details of how the address should be passed to `mcount' are determined
147 by your operating system environment, not by GNU CC. To figure them out,
148 compile a small program for profiling using the system's installed C
149 compiler and look at the assembler code that results. */
151 #undef FUNCTION_PROFILER
152 #define FUNCTION_PROFILER(FILE, LABELNO) \
153 do \
155 if (!OSF_PROFILE_BEFORE_PROLOGUE) \
157 char *prefix = ""; \
158 char *lprefix = LPREFIX; \
159 int labelno = LABELNO; \
161 /* Note that OSF/rose blew it in terms of calling mcount, \
162 since OSF/rose prepends a leading underscore, but mcount's \
163 doesn't. At present, we keep this kludge for ELF as well \
164 to allow old kernels to build profiling. */ \
166 if (flag_pic \
167 && !current_function_uses_pic_offset_table \
168 && !current_function_uses_const_pool) \
169 abort (); \
171 if (TARGET_MCOUNT && flag_pic) \
173 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
174 lprefix, labelno); \
175 fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \
178 else if (TARGET_MCOUNT) \
180 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
181 fprintf (FILE, "\tcall %smcount\n", prefix); \
184 else if (flag_pic && frame_pointer_needed) \
186 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
187 fprintf (FILE, "\tpushl %%ecx\n"); \
188 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
189 lprefix, labelno); \
190 fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \
191 fprintf (FILE, "\tcall *(%%eax)\n"); \
192 fprintf (FILE, "\tpopl %%eax\n"); \
195 else if (frame_pointer_needed) \
197 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
198 fprintf (FILE, "\tpushl %%ecx\n"); \
199 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
200 fprintf (FILE, "\tcall *_mcount_ptr\n"); \
201 fprintf (FILE, "\tpopl %%eax\n"); \
204 else \
205 abort (); \
208 while (0)
210 #if defined (CROSS_COMPILE) && defined (HOST_BITS_PER_INT) && defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG)
211 #if (HOST_BITS_PER_INT==32) && (HOST_BITS_PER_LONG==64) && (HOST_BITS_PER_LONGLONG==64)
212 #define REAL_ARITHMETIC
213 #endif
214 #endif