]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
c-common.c (c_common_init): Set options->unsigned_wchar.
[thirdparty/gcc.git] / gcc / config / i386 / djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
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.
11
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.
16
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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 /* Support generation of DWARF2 debugging info. */
23 #define DWARF2_DEBUGGING_INFO
24
25 /* Don't assume anything about the header files. */
26 #define NO_IMPLICIT_EXTERN_C
27
28 #define HANDLE_SYSV_PRAGMA
29
30 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
31 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
32
33 #include "i386/unix.h"
34 #include "i386/bsd.h"
35 #include "i386/gas.h"
36
37 /* If defined, a C expression whose value is a string containing the
38 assembler operation to identify the following data as
39 uninitialized global data. If not defined, and neither
40 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
41 uninitialized global data will be output in the data section if
42 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
43 used. */
44 #undef BSS_SECTION_ASM_OP
45 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
46
47 /* Define the name of the .data section. */
48 #undef DATA_SECTION_ASM_OP
49 #define DATA_SECTION_ASM_OP "\t.section .data"
50
51 /* Define the name of the .ident op. */
52 #undef IDENT_ASM_OP
53 #define IDENT_ASM_OP "\t.ident\t"
54
55 /* Enable alias attribute support. */
56 #ifndef SET_ASM_OP
57 #define SET_ASM_OP "\t.set\t"
58 #endif
59
60 /* Define the name of the .text section. */
61 #undef TEXT_SECTION_ASM_OP
62 #define TEXT_SECTION_ASM_OP "\t.section .text"
63
64 /* Define standard DJGPP installation paths. */
65 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
66 /* points to actual DJGPP instalation directory. */
67
68 /* Standard include directory */
69 #undef STANDARD_INCLUDE_DIR
70 #define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
71
72 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
73 #undef MD_EXEC_PREFIX
74 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
75
76 /* Standard DJGPP library and startup files */
77 #undef MD_STARTFILE_PREFIX
78 #define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
79
80 /* Correctly handle absolute filename detection in cp/xref.c */
81 #define FILE_NAME_ABSOLUTE_P(NAME) \
82 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
83 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
84
85 #undef CPP_PREDEFINES
86 #define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -Asystem=msdos"
87
88 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
89 #undef CPP_SPEC
90 #define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
91 %{!ansi:%{!std=c*:%{!std=i*:-DMSDOS}}} %{!ansi:%{!std=c*:%{!std=i*:-DGO32}}} \
92 -imacros %s../include/sys/version.h"
93
94 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
95 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
96 before library search directories are known by the linker.
97 This avoids problems when specs file is not available. An alternate way,
98 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
99 */
100
101 #undef LINK_COMMAND_SPEC
102 #define LINK_COMMAND_SPEC \
103 "%{!fsyntax-only: \
104 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
105 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
106 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
107 \t%{static:} %{L*} %D %o\
108 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
109 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
110 \t-Tdjgpp.djl %{T*}}}}}}}\n\
111 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
112
113 /* Always just link in 'libc.a'. */
114 #undef LIB_SPEC
115 #define LIB_SPEC "-lc"
116
117 /* Pick the right startup code depending on the -pg flag. */
118 #undef STARTFILE_SPEC
119 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
120
121 /* Make sure that gcc will not look for .h files in /usr/local/include
122 unless user explicitly requests it. */
123 #undef LOCAL_INCLUDE_DIR
124
125 /* Switch into a generic section. */
126 #define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
127
128 /* Output at beginning of assembler file. */
129 /* The .file command should always begin the output. */
130
131 #undef ASM_FILE_START
132 #define ASM_FILE_START(FILE) \
133 do { \
134 output_file_directive (FILE, main_input_filename); \
135 } while (0)
136
137 /* This is how to output an assembler line
138 that says to advance the location counter
139 to a multiple of 2**LOG bytes. */
140
141 #undef ASM_OUTPUT_ALIGN
142 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
143 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
144
145 /* This is how to output a global symbol in the BSS section. */
146 #undef ASM_OUTPUT_ALIGNED_BSS
147 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
148 asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
149
150 /* This is how to tell assembler that a symbol is weak */
151 #undef ASM_WEAKEN_LABEL
152 #define ASM_WEAKEN_LABEL(FILE,NAME) \
153 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
154 fputc ('\n', FILE); } while (0)
155
156 /* djgpp automatically calls its own version of __main, so don't define one
157 in libgcc, nor call one in main(). */
158 #define HAS_INIT_SECTION
159
160 /* Definitions for types and sizes. Wide characters are 16-bits long so
161 Win32 compiler add-ons will be wide character compatible. */
162 #undef WCHAR_TYPE_SIZE
163 #define WCHAR_TYPE_SIZE 16
164
165 #undef WCHAR_TYPE
166 #define WCHAR_TYPE "short unsigned int"
167
168 #undef WINT_TYPE
169 #define WINT_TYPE "int"
170
171 #undef SIZE_TYPE
172 #define SIZE_TYPE "long unsigned int"
173
174 #undef PTRDIFF_TYPE
175 #define PTRDIFF_TYPE "int"
176
177 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
178 #define LIBSTDCXX "-lstdcxx"
179
180 /* -mbnu210 is now ignored and obsolete. It was used to enable support for
181 weak symbols, and .gnu.linkonce support. */
182 #undef MASK_BNU210
183 #define MASK_BNU210 (0x40000000)
184
185 #define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)");
186
187 #undef SUBTARGET_SWITCHES
188 #define SUBTARGET_SWITCHES \
189 { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)" }, \
190 { "bnu210", MASK_BNU210, "Ignored (obsolete)" },
191
192 /* Warn that -mbnu210 is now obsolete. */
193 #undef SUBTARGET_OVERRIDE_OPTIONS
194 #define SUBTARGET_OVERRIDE_OPTIONS \
195 do \
196 { \
197 if (target_flags & MASK_BNU210) \
198 { \
199 warning ("-mbnu210 is ignored (option is obsolete)"); \
200 } \
201 } \
202 while (0)
203
204 /* Support for C++ templates. */
205 #undef MAKE_DECL_ONE_ONLY
206 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
207
208 #undef UNIQUE_SECTION
209 #define UNIQUE_SECTION(DECL,RELOC) \
210 do { \
211 int len; \
212 const char *name, *prefix; \
213 char *string; \
214 \
215 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
216 /* Strip off any encoding in fnname. */ \
217 STRIP_NAME_ENCODING (name, name); \
218 \
219 if (! DECL_ONE_ONLY (DECL)) \
220 { \
221 if (TREE_CODE (DECL) == FUNCTION_DECL) \
222 prefix = ".text."; \
223 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
224 prefix = ".rodata."; \
225 else \
226 prefix = ".data."; \
227 } \
228 else if (TREE_CODE (DECL) == FUNCTION_DECL) \
229 prefix = ".gnu.linkonce.t."; \
230 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
231 prefix = ".gnu.linkonce.r."; \
232 else \
233 prefix = ".gnu.linkonce.d."; \
234 \
235 len = strlen (name) + strlen (prefix); \
236 string = alloca (len + 1); \
237 sprintf (string, "%s%s", prefix, name); \
238 \
239 DECL_SECTION_NAME (DECL) = build_string (len, string); \
240 } while (0)