Initial revision
[official-gcc.git] / gcc / config / i386 / dgux.h
blob4a923fca67985b01db410eeba2bd31fb3145f2d2
1 /* Target definitions for GNU compiler for Intel 80x86 running DG/ux
2 Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
3 Currently maintained by gcc@dg-rtp.dg.com.
5 This file is part of GNU CC.
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.
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.
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* for now, we are just like the sysv4 version with a
22 few hacks
25 #include "i386/sysv4.h"
27 #ifndef VERSION_INFO2
28 #define VERSION_INFO2 "$Revision: 1.1 $"
29 #endif
31 #ifndef VERSION_STRING
32 #define VERSION_STRING version_string
33 #endif
35 /* Identify the compiler. */
36 /* TARGET_VERSION used by toplev.c VERSION_STRING used by -midentify-revision */
38 #undef TARGET_VERSION
39 #define TARGET_VERSION fprintf (stderr, " (%s%s, %s)", \
40 VERSION_INFO1, VERSION_INFO2, __DATE__)
41 #undef VERSION_INFO1
42 #define VERSION_INFO1 "ix86 DG/ux, "
44 /* Augment TARGET_SWITCHES with the MXDB options. */
45 #define MASK_STANDARD 0x40000000 /* Retain standard information */
46 #define MASK_NOLEGEND 0x20000000 /* Discard legend information */
47 #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */
48 #define MASK_IDENTIFY_REVISION 0x08000000 /* Emit 'ident' to .s */
49 #define MASK_WARN_PASS_STRUCT 0x04000000 /* Emit 'ident' to .s */
51 #define TARGET_STANDARD (target_flags & MASK_STANDARD)
52 #define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND)
53 #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND)
54 #define TARGET_IDENTIFY_REVISION (target_flags & MASK_IDENTIFY_REVISION)
55 #define TARGET_WARN_PASS_STRUCT (target_flags & MASK_WARN_PASS_STRUCT)
57 #undef SUBTARGET_SWITCHES
58 #define SUBTARGET_SWITCHES \
59 { "standard", MASK_STANDARD }, \
60 { "legend", -MASK_NOLEGEND }, \
61 { "no-legend", MASK_NOLEGEND }, \
62 { "external-legend", MASK_EXTERNAL_LEGEND }, \
63 { "identify-revision", MASK_IDENTIFY_REVISION }, \
64 { "warn-passed-structs", MASK_WARN_PASS_STRUCT },
66 #undef DWARF_DEBUGGING_INFO
67 #define DWARF_DEBUGGING_INFO
70 allow -gstabs so that those who have gnu-as installed
71 can debug c++ programs.
73 #undef DBX_DEBUGGING_INFO
74 #define DBX_DEBUGGING_INFO
76 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
78 /* Override svr[34].h. */
79 #undef ASM_FILE_START
80 #define ASM_FILE_START(FILE) \
81 output_file_start (FILE, f_options, sizeof f_options / sizeof f_options[0], \
82 W_options, sizeof W_options / sizeof W_options[0])
84 /* ix86 abi specified type for wchar_t */
86 #undef WCHAR_TYPE
87 #define WCHAR_TYPE "long int"
89 #undef WCHAR_TYPE_SIZE
90 #define WCHAR_TYPE_SIZE BITS_PER_WORD
93 /* Some machines may desire to change what optimizations are performed for
94 various optimization levels. This macro, if defined, is executed once
95 just after the optimization level is determined and before the remainder
96 of the command options have been parsed. Values set in this macro are
97 used as the default values for the other command line options.
99 LEVEL is the optimization level specified; 2 if -O2 is specified,
100 1 if -O is specified, and 0 if neither is specified. */
102 /* This macro used to store 0 in flag_signed_bitfields.
103 Not only is that misuse of this macro; the whole idea is wrong.
105 The GNU C dialect makes bitfields signed by default,
106 regardless of machine type. Making any machine inconsistent in this
107 regard is bad for portability.
109 I chose to make bitfields signed by default because this is consistent
110 with the way ordinary variables are handled: `int' equals `signed int'.
111 If there is a good reason to prefer making bitfields unsigned by default,
112 it cannot have anything to do with the choice of machine.
113 If the reason is good enough, we should change the convention for all machines.
115 -- rms, 20 July 1991. */
118 this really should go into dgux-local.h
121 #undef OPTIMIZATION_OPTIONS
122 #define OPTIMIZATION_OPTIONS(LEVEL) \
123 do { \
124 extern int flag_signed_bitfields; \
125 flag_signed_bitfields = 0; \
126 abort_helper (); \
127 optimization_options (LEVEL); \
128 } while (0)
131 /* The normal location of the `ld' and `as' programs */
133 #undef MD_EXEC_PREFIX
134 #define MD_EXEC_PREFIX "/usr/bin/"
136 /* The normal location of the various *crt*.o files is the */
138 #undef MD_STARTFILE_PREFIX
139 #define MD_STARTFILE_PREFIX "/usr/lib/"
141 /* Macros to be automatically defined.
142 __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
143 files with DG/UX revision 5.40 and later. This allows GNU CC to
144 operate without installing the header files. */
146 #undef CPP_PREDEFINES
147 #define CPP_PREDEFINES "-Di386 -D__ix86 -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
148 -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)"
151 If not -ansi, -traditional, or restricting include files to one
152 specific source target, specify full DG/UX features.
154 #undef CPP_SPEC
155 #define CPP_SPEC "%{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}"
157 /* Assembler support (legends for mxdb). */
158 #undef ASM_SPEC
159 #define ASM_SPEC "\
160 %{mno-legend:%{mstandard:-Wc,off}}\
161 %{g:%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\
162 %{traditional:,-lc}%{!traditional:,-lansi-c}\
163 %{mstandard:,-keep-std}\
164 %{mexternal-legend:,-external}}}"
166 /* Override svr4.h. */
168 /* hassey 3/12/94 keep svr4 ASM_FINAL_SPEC allows -pipe to work */
170 /* Linker and library spec's.
171 -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
172 -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line.
173 The absense of -msvr4 indicates linking done in a COFF environment and
174 adds the link script to the link line. In all environments, the first
175 and last objects are crtbegin.o and crtend.o.
176 When the -G link option is used (-shared and -symbolic) a final link is
177 not being done. */
179 #undef LIB_SPEC
180 #define LIB_SPEC \
181 "%{!shared:%{!symbolic:-lc}}"
183 #undef LINK_SPEC
184 #define LINK_SPEC "%{z*} %{h*} %{v:-V} \
185 %{static:-dn -Bstatic} \
186 %{shared:-G -dy} \
187 %{symbolic:-Bsymbolic -G -dy} \
188 %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
190 #ifdef CROSS_COMPILE
192 #undef STARTFILE_SPEC
193 #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \
194 %{!pg:%{p:mcrt1.o%s} \
195 %{!p:crt1.o%s}}}} \
196 %{pg:gcrti.o%s}%{!pg:crti.o%s} \
197 crtbegin.o%s \
198 %{ansi:values-Xc.o%s} \
199 %{!ansi:%{traditional:values-Xt.o%s} \
200 %{!traditional:values-Xa.o%s}}"
202 #undef ENDFILE_SPEC
203 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:crtn.o%s}"
205 #else
207 #undef STARTFILE_SPEC
208 #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \
209 %{!pg:%{p:/lib/mcrt1.o%s} \
210 %{!p:/lib/crt1.o%s}}} \
211 %{pg:gcrti.o%s}%{!pg:/lib/crti.o%s}} \
212 crtbegin.o%s \
213 %{ansi:/lib/values-Xc.o%s} \
214 %{!ansi:%{traditional:/lib/values-Xt.o%s} \
215 %{!traditional:/lib/values-Xa.o%s}}"
217 #undef ENDFILE_SPEC
218 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:/lib/crtn.o}"
220 #endif /* CROSS_COMPILE */
222 #if !defined (no_abort) || defined (CRT_BEGIN) || defined (CRT_END)
223 #undef abort
225 char insn; int insn_; char * file_; int line_;
226 #define abort() \
227 (insn_ = (int) insn, \
228 file_ = __FILE__, \
229 line_ = __LINE__, \
230 fancy_abort ())
231 #define abort_helper() \
232 do { \
233 extern void abort_aux (); \
234 atexit (abort_aux); \
235 } while (0)
236 #define _abort_aux
237 #endif /* no abort */
239 /* The maximum alignment which the object file format can support.
240 page alignment would seem to be enough */
241 #undef MAX_OFILE_ALIGNMENT
242 #define MAX_OFILE_ALIGNMENT 0x1000
244 /* Must use data section for relocatable constants when pic. */
245 #undef SELECT_RTX_SECTION
246 #define SELECT_RTX_SECTION(MODE,RTX) \
248 if (flag_pic && symbolic_operand (RTX)) \
249 data_section (); \
250 else \
251 const_section (); \
254 /* This supplements FUNCTION_ARG's definition in i386.h to check
255 TARGET_WARN_PASS_STRUCT */
257 #undef FUNCTION_ARG
258 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
259 ((((MODE) == BLKmode && TARGET_WARN_PASS_STRUCT) ? \
260 warning ("argument is a structure"),0 : 0), \
261 (function_arg (&CUM, MODE, TYPE, NAMED)))
263 /* This is how to output an assembler line
264 that says to advance the location counter
265 to a multiple of 2**LOG bytes. */
267 #undef ASM_OUTPUT_ALIGN
268 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
269 if (LOG <= 2) \
270 fprintf ((FILE), "\t.align %d\n", 1<<(LOG));\
271 else if ((LOG)!=0) \
273 char buf[256]; \
274 if (!backalign_labelno) fprintf ((FILE), "\t.align %d\n", 1); \
275 ASM_GENERATE_INTERNAL_LABEL (buf, "LBA", backalign_labelno++); \
276 fprintf ((FILE), "%s:", &buf[1]); \
277 fprintf ((FILE), "\t.backalign %s,%d,%d\n", &buf[1], 1<<(LOG), \
278 ((TARGET_PENTIUMPRO || TARGET_486) && LOG==4) ? 6 : 2);\
281 /* add .align 1 to avoid .backalign bug in assembler */
282 #undef CONST_SECTION_ASM_OP
283 #define CONST_SECTION_ASM_OP ".section\t.rodata\n\t.align 1"