1 /* Definitions of target machine for GNU compiler.
2 Motorola m88100 running DG/UX.
3 Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
4 Contributed by Michael Tiemann (tiemann@mcc.com)
5 Enhanced by Michael Meissner (meissner@osf.org)
6 Version 2 port by Tom Wood (twood@pets.sps.mot.com)
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 /* You're not seeing double! To transition to dwarf debugging, both are
25 supported. The option -msvr4 specifies elf. With these combinations,
27 /* DWARF_DEBUGGING_INFO defined in svr4.h. */
28 #define SDB_DEBUGGING_INFO
29 #define PREFERRED_DEBUGGING_TYPE \
30 (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
33 #define VERSION_INFO2 "$Revision: 1.6 $"
36 #define AS_BUG_IMMEDIATE_LABEL
37 /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'. */
42 #include "m88k/m88k.h"
44 /* Augment TARGET_SWITCHES with the MXDB options. */
45 #define MASK_STANDARD 0x40000000 /* Retain standard information */
46 #define MASK_LEGEND 0x20000000 /* Retain legend information */
47 #define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */
49 #define TARGET_STANDARD (target_flags & MASK_STANDARD)
50 #define TARGET_LEGEND (target_flags & MASK_LEGEND)
51 #define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND)
53 #undef SUBTARGET_SWITCHES
54 #define SUBTARGET_SWITCHES \
55 { "standard", MASK_STANDARD }, \
56 { "legend", MASK_LEGEND }, \
57 { "external-legend", MASK_EXTERNAL_LEGEND }, \
58 /* the following is used only in the *_SPEC's */ \
61 /* Default switches */
63 #define TARGET_DEFAULT (MASK_CHECK_ZERO_DIV | \
64 MASK_OCS_DEBUG_INFO | \
65 MASK_OCS_FRAME_POSITION)
67 #define CPU_DEFAULT MASK_88000
69 /* Macros to be automatically defined. __svr4__ is our extension.
70 __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
71 files with DG/UX revision 5.40 and later. This allows GNU CC to
72 operate without installing the header files. */
75 #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
76 -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)"
78 /* If -m88100 is in effect, add -Dm88100; similarly for -m88110.
79 Here, the CPU_DEFAULT is assumed to be -m88000. If not -ansi,
80 -traditional, or restricting include files to one specific source
81 target, specify full DG/UX features. */
83 #define CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \
84 %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \
85 %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}"
87 /* Assembler support (-V, silicon filter, legends for mxdb). */
90 %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\
91 %{msvr4:%{mversion-03.00:-KV3}%{!mversion-03.00:%{mversion-*:-KV%*}}}}\
92 %{!mlegend:%{mstandard:-Wc,off}}\
93 %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\
94 %{traditional:,-lc}%{!traditional:,-lansi-c}\
95 %{mstandard:,-keep-std}\
96 %{mkeep-coff:,-keep-coff}\
97 %{mexternal-legend:,-external}\
98 %{mocs-frame-position:,-ocs}}"
100 /* Override svr4.h. */
101 #undef ASM_FINAL_SPEC
102 #undef STARTFILE_SPEC
104 /* Linker and library spec's.
105 -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
106 -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line.
107 The absense of -msvr4 indicates linking done in a COFF environment and
108 adds the link script to the link line. In all environments, the first
109 and last objects are crtbegin.o and crtend.o.
110 When the -G link option is used (-shared and -symbolic) a final link is
113 #define LIB_SPEC "%{msvr4:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}} crtend.o%s"
115 #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \
116 %{static:-dn -Bstatic} \
118 %{symbolic:-Bsymbolic -G -dy} \
119 %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
120 #undef STARTFILE_SPEC
121 #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \
122 %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \
123 %{!msvr4:m88kdgux.ld%s} crtbegin.o%s \
124 %{svr4:%{ansi:/lib/values-Xc.o} \
125 %{!ansi:%{traditional:/lib/values-Xt.o} \
126 %{!traditional:/usr/lib/values-Xa.o}}}}}"
128 #undef GPLUSPLUS_INCLUDE_DIR
129 #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include"
131 /* Fast DG/UX version of profiler that does not require lots of
132 registers to be stored. */
133 #undef FUNCTION_PROFILER
134 #define FUNCTION_PROFILER(FILE, LABELNO) \
135 output_function_profiler (FILE, LABELNO, "gcc.mcount", 0)
137 /* Output the legend info for mxdb when debugging except if standard
138 debugging information only is explicitly requested. */
139 #undef ASM_FIRST_LINE
140 #define ASM_FIRST_LINE(FILE) \
145 fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00"); \
147 fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00"); \
149 if (write_symbols != NO_DEBUG \
150 && ! (TARGET_STANDARD && ! TARGET_LEGEND)) \
152 fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"", \
153 VERSION_STRING, main_input_filename); \
154 fputs (flag_traditional ? " -lc" : " -lansi-c", FILE); \
155 if (TARGET_STANDARD) \
156 fputs (" -keep-std", FILE); \
157 if (TARGET_EXTERNAL_LEGEND) \
158 fputs (" -external", FILE); \
159 if (TARGET_OCS_FRAME_POSITION) \
160 fputs (" -ocs", FILE); \
161 fputc ('\n', FILE); \
165 /* Override svr4.h. */
168 #undef WCHAR_TYPE_SIZE
170 /* Override svr4.h and m88k.h except when compiling crtstuff.c. These must
171 be constant strings when compiling crtstuff.c. Otherwise, respect the
172 -mversion-STRING option used. */
173 #if !defined (CRT_BEGIN) && !defined (CRT_END)
174 #undef INIT_SECTION_ASM_OP
175 #define INIT_SECTION_ASM_OP (TARGET_SVR4 \
176 ? "section\t .init,\"xa\"" \
177 : "section\t .init,\"x\"")
178 #undef CTORS_SECTION_ASM_OP
179 #define CTORS_SECTION_ASM_OP (TARGET_SVR4 \
180 ? "section\t .ctors,\"aw\"" \
181 : "section\t .ctors,\"d\"")
182 #undef DTORS_SECTION_ASM_OP
183 #define DTORS_SECTION_ASM_OP (TARGET_SVR4 \
184 ? "section\t .dtors,\"aw\"" \
185 : "section\t .dtors,\"d\"")
186 #endif /* crtstuff.c */
188 /* The lists of global object constructors and global destructors are always
189 placed in the .ctors/.dtors sections. This requires the use of a link
190 script if the COFF linker is used, but otherwise COFF and ELF objects
191 can be intermixed. A COFF object will pad the section to 16 bytes with
192 zeros; and ELF object will not contain padding. We deal with this by
193 putting a -1 marker at the begin and end of the list and ignoring zero
196 /* Mark the end of the .ctors/.dtors sections with a -1. */
197 #define CTOR_LIST_END \
198 asm (CTORS_SECTION_ASM_OP); \
199 func_ptr __CTOR_END__[1] = { (func_ptr) (-1) }
201 #define DTOR_LIST_END \
202 asm (DTORS_SECTION_ASM_OP); \
203 func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
205 /* Walk the list ignoring NULL entries till we hit the terminating -1. */
206 #define DO_GLOBAL_CTORS_BODY \
209 for (i=1;(int)(__CTOR_LIST__[i]) != -1; i++) \
210 if (((int *)__CTOR_LIST__)[i] != 0) \
211 __CTOR_LIST__[i] (); \
214 /* Walk the list looking for the terminating -1 that marks the end.
215 Go backward and ignore any NULL entries. */
216 #define DO_GLOBAL_DTORS_BODY \
219 for (i=1;(int)(__DTOR_LIST__[i]) != -1; i++); \
220 for (i-=1;(int)(__DTOR_LIST__[i]) != -1; i--) \
221 if (((int *)__DTOR_LIST__)[i] != 0) \
222 __DTOR_LIST__[i] (); \