OSDN Git Service

New for profiling Solaris 2
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / dgux.h
1 /* Target definitions for GNU compiler for Intel 80x86 running DG/ux
2    Copyright (C) 1993, 1995 Free Software Foundation, Inc.
3
4    Currently maintained by (gcc@dg-rtp.dg.com)
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22 /* for now, we are just like the sysv4 version with a
23    few hacks
24 */
25
26 #include "i386/sysv4.h"
27
28 #ifndef VERSION_INFO2
29 #define VERSION_INFO2   "$Revision: 1.2 $"
30 #endif
31
32 #ifndef VERSION_STRING
33 #define VERSION_STRING  version_string
34 #endif
35
36 /* Identify the compiler.  */
37 /* TARGET_VERSION used by toplev.c VERSION_STRING used by -midentify-revision */
38
39 #undef  TARGET_VERSION
40 #define TARGET_VERSION fprintf (stderr, " (%s%s, %s)", \
41                                 VERSION_INFO1, VERSION_INFO2, __DATE__)
42 #undef  VERSION_INFO1
43 #define VERSION_INFO1 "ix86 DG/ux, "
44
45 /* Augment TARGET_SWITCHES with the MXDB options.  */
46 #define MASK_STANDARD           0x40000000 /* Retain standard information */
47 #define MASK_NOLEGEND           0x20000000 /* Discard legend information */
48 #define MASK_EXTERNAL_LEGEND    0x10000000 /* Make external legends */
49 #define MASK_IDENTIFY_REVISION  0x08000000 /* Emit 'ident' to .s */
50 #define MASK_WARN_PASS_STRUCT   0x04000000 /* Emit 'ident' to .s */
51
52 #define TARGET_STANDARD           (target_flags & MASK_STANDARD)
53 #define TARGET_NOLEGEND           (target_flags & MASK_NOLEGEND)
54 #define TARGET_EXTERNAL_LEGEND    (target_flags & MASK_EXTERNAL_LEGEND)
55 #define TARGET_IDENTIFY_REVISION  (target_flags & MASK_IDENTIFY_REVISION)
56 #define TARGET_WARN_PASS_STRUCT   (target_flags & MASK_WARN_PASS_STRUCT)
57
58 #undef  SUBTARGET_SWITCHES
59 #define SUBTARGET_SWITCHES \
60     { "standard",                        MASK_STANDARD },          \
61     { "legend",                         -MASK_NOLEGEND },          \
62     { "no-legend",                       MASK_NOLEGEND },          \
63     { "external-legend",                 MASK_EXTERNAL_LEGEND },   \
64     { "identify-revision",               MASK_IDENTIFY_REVISION }, \
65     { "warn-passed-structs",             MASK_WARN_PASS_STRUCT },
66
67 #undef  DWARF_DEBUGGING_INFO
68 #define DWARF_DEBUGGING_INFO
69
70 /*
71   allow -gstabs so that those who have gnu-as installed
72   can debug c++ programs.
73 */
74 #undef  DBX_DEBUGGING_INFO
75 #define DBX_DEBUGGING_INFO
76
77 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
78
79 /* Override svr[34].h.  */
80 #undef  ASM_FILE_START
81 #define ASM_FILE_START(FILE) \
82   output_file_start (FILE, f_options, sizeof f_options / sizeof f_options[0], \
83                      W_options, sizeof W_options / sizeof W_options[0])
84
85 /* ix86 abi specified type for wchar_t */
86
87 #undef WCHAR_TYPE
88 #define WCHAR_TYPE "long int"
89
90 #undef WCHAR_TYPE_SIZE
91 #define WCHAR_TYPE_SIZE BITS_PER_WORD
92
93
94 /* Define this to be nonzero if the character `$' should be allowed
95    by default in identifier names.  DG/ux does this differently than
96    standard i386 */
97
98 #undef  DOLLARS_IN_IDENTIFIERS
99 #define DOLLARS_IN_IDENTIFIERS  1
100
101 /* Some machines may desire to change what optimizations are performed for
102    various optimization levels.   This macro, if defined, is executed once
103    just after the optimization level is determined and before the remainder
104    of the command options have been parsed.  Values set in this macro are
105    used as the default values for the other command line options.
106
107    LEVEL is the optimization level specified; 2 if -O2 is specified,
108    1 if -O is specified, and 0 if neither is specified.  */
109
110 /* This macro used to store 0 in flag_signed_bitfields.
111    Not only is that misuse of this macro; the whole idea is wrong.
112
113    The GNU C dialect makes bitfields signed by default,
114    regardless of machine type.  Making any machine inconsistent in this
115    regard is bad for portability.
116
117    I chose to make bitfields signed by default because this is consistent
118    with the way ordinary variables are handled: `int' equals `signed int'.
119    If there is a good reason to prefer making bitfields unsigned by default,
120    it cannot have anything to do with the choice of machine.
121    If the reason is good enough, we should change the convention for all machines.
122
123    -- rms, 20 July 1991.  */
124
125 /*
126   this really should go into dgux-local.h 
127 */
128
129 #undef  OPTIMIZATION_OPTIONS
130 #define OPTIMIZATION_OPTIONS(LEVEL)                     \
131   do {                                                  \
132     extern int flag_signed_bitfields;                   \
133     flag_signed_bitfields = 0;                          \
134     abort_helper ();                                    \
135     optimization_options (LEVEL);                       \
136   } while (0)
137
138
139 /* The normal location of the `ld' and `as' programs */
140
141 #undef MD_EXEC_PREFIX
142 #define MD_EXEC_PREFIX "/usr/bin/"
143
144 /* The normal location of the various *crt*.o files is the */
145
146 #undef MD_STARTFILE_PREFIX
147 #define MD_STARTFILE_PREFIX "/usr/lib/"
148
149 /* Macros to be automatically defined.  
150    __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
151    files with DG/UX revision 5.40 and later.  This allows GNU CC to
152    operate without installing the header files.  */
153
154 #undef  CPP_PREDEFINES
155 #define CPP_PREDEFINES "-Di386 -D__ix86 -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
156    -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)"
157
158    /*
159      If not -ansi, -traditional, or restricting include files to one
160      specific source target, specify full DG/UX features.
161    */
162 #undef  CPP_SPEC
163 #define CPP_SPEC "%{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}"
164
165 /* Assembler support (legends for mxdb).  */
166 #undef  ASM_SPEC
167 #define ASM_SPEC "\
168 %{mno-legend:%{mstandard:-Wc,off}}\
169 %{g:%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\
170 %{traditional:,-lc}%{!traditional:,-lansi-c}\
171 %{mstandard:,-keep-std}\
172 %{mexternal-legend:,-external}}}"
173
174 /* Override svr4.h.  */
175
176 /* hassey 3/12/94 keep svr4 ASM_FINAL_SPEC allows -pipe to work */
177
178 /* Linker and library spec's.
179    -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
180    -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line.
181    The absense of -msvr4 indicates linking done in a COFF environment and
182    adds the link script to the link line.  In all environments, the first
183    and last objects are crtbegin.o and crtend.o.
184    When the -G link option is used (-shared and -symbolic) a final link is
185    not being done.  */
186
187 #undef  LIB_SPEC
188 #define LIB_SPEC \
189 "%{!shared:%{!symbolic:-lc}}"
190
191 #undef  LINK_SPEC
192 #define LINK_SPEC "%{z*} %{h*} %{v:-V} \
193                    %{static:-dn -Bstatic} \
194                    %{shared:-G -dy} \
195                    %{symbolic:-Bsymbolic -G -dy} \
196                    %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
197
198 #ifdef CROSS_COMPILE
199
200 #undef  STARTFILE_SPEC
201 #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s}           \
202                                               %{!pg:%{p:mcrt1.o%s}      \
203                                               %{!p:crt1.o%s}}}}         \
204                          %{pg:gcrti.o%s}%{!pg:crti.o%s}                 \
205                          crtbegin.o%s                                   \
206                          %{ansi:values-Xc.o%s}                          \
207                          %{!ansi:%{traditional:values-Xt.o%s}           \
208                                  %{!traditional:values-Xa.o%s}}"
209
210 #undef  ENDFILE_SPEC
211 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:crtn.o%s}"
212
213 #else
214
215 #undef  STARTFILE_SPEC
216 #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s}           \
217                                               %{!pg:%{p:/lib/mcrt1.o%s} \
218                                               %{!p:/lib/crt1.o%s}}}     \
219                         %{pg:gcrti.o%s}%{!pg:/lib/crti.o%s}}            \
220                         crtbegin.o%s                                    \
221                         %{ansi:/lib/values-Xc.o%s}                      \
222                         %{!ansi:%{traditional:/lib/values-Xt.o%s}       \
223                                 %{!traditional:/lib/values-Xa.o%s}}"
224
225 #undef  ENDFILE_SPEC
226 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:/lib/crtn.o}"
227
228 #endif /* CROSS_COMPILE */
229
230 #if !defined (no_abort) || defined (CRT_BEGIN) || defined (CRT_END)
231 #undef abort
232
233 char insn; int insn_; char * file_; int line_;
234 #define abort()                 \
235   (insn_ = (int) insn,          \
236    file_ = __FILE__,            \
237    line_ = __LINE__,            \
238    fancy_abort ())
239 #define abort_helper()          \
240   do {                          \
241     extern void abort_aux ();   \
242     atexit (abort_aux);         \
243   } while (0)
244 #define _abort_aux
245 #endif /* no abort */
246
247 /* The maximum alignment which the object file format can support.
248    page alignment would seem to be enough */
249 #undef MAX_OFILE_ALIGNMENT
250 #define MAX_OFILE_ALIGNMENT 0x1000
251
252 /* Must use data section for relocatable constants when pic.  */
253 #undef SELECT_RTX_SECTION
254 #define SELECT_RTX_SECTION(MODE,RTX)            \
255 {                                               \
256   if (flag_pic && symbolic_operand (RTX))       \
257     data_section ();                            \
258   else                                          \
259     const_section ();                           \
260 }
261
262 /* This supplements FUNCTION_ARG's definition in i386.h to check
263    TARGET_WARN_PASS_STRUCT */
264
265 #undef  FUNCTION_ARG
266 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
267 ((((MODE) == BLKmode && TARGET_WARN_PASS_STRUCT) ? \
268     warning ("argument is a structure"),0 : 0), \
269     (function_arg (&CUM, MODE, TYPE, NAMED)))
270