* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[official-gcc.git] / gcc / config / i386 / djgpp.h
blob36b4639346f345f9052e40aae7f2261c353caccf
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #include "dbxcoff.h"
23 /* Support generation of DWARF2 debugging info. */
24 #define DWARF2_DEBUGGING_INFO
26 /* Don't assume anything about the header files. */
27 #define NO_IMPLICIT_EXTERN_C
29 #define HANDLE_SYSV_PRAGMA
31 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
32 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
34 #define YES_UNDERSCORES
36 #include "i386/gas.h"
38 /* If defined, a C expression whose value is a string containing the
39 assembler operation to identify the following data as
40 uninitialized global data. If not defined, and neither
41 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
42 uninitialized global data will be output in the data section if
43 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
44 used. */
45 #undef BSS_SECTION_ASM_OP
46 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
48 /* Define the name of the .data section. */
49 #undef DATA_SECTION_ASM_OP
50 #define DATA_SECTION_ASM_OP "\t.section .data"
52 /* Define the name of the .ident op. */
53 #undef IDENT_ASM_OP
54 #define IDENT_ASM_OP "\t.ident\t"
56 /* Enable alias attribute support. */
57 #ifndef SET_ASM_OP
58 #define SET_ASM_OP "\t.set\t"
59 #endif
61 /* Define the name of the .text section. */
62 #undef TEXT_SECTION_ASM_OP
63 #define TEXT_SECTION_ASM_OP "\t.section .text"
65 /* Define standard DJGPP installation paths. */
66 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
67 /* points to actual DJGPP instalation directory. */
69 /* Standard include directory */
70 #undef STANDARD_INCLUDE_DIR
71 #define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
73 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
74 #undef MD_EXEC_PREFIX
75 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
77 /* Standard DJGPP library and startup files */
78 #undef MD_STARTFILE_PREFIX
79 #define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
81 /* Correctly handle absolute filename detection in cp/xref.c */
82 #define FILE_NAME_ABSOLUTE_P(NAME) \
83 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
84 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
86 #undef CPP_PREDEFINES
87 #define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -Asystem=msdos"
89 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
90 #undef CPP_SPEC
91 #define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
92 %{!ansi:%{!std=c*:%{!std=i*:-DMSDOS}}} %{!ansi:%{!std=c*:%{!std=i*:-DGO32}}} \
93 -imacros %s../include/sys/version.h"
95 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
96 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
97 before library search directories are known by the linker.
98 This avoids problems when specs file is not available. An alternate way,
99 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
102 #undef LINK_COMMAND_SPEC
103 #define LINK_COMMAND_SPEC \
104 "%{!fsyntax-only: \
105 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
106 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
107 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
108 \t%{static:} %{L*} %D %o\
109 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
110 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
111 \t-Tdjgpp.djl %{T*}}}}}}}\n\
112 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
114 /* Always just link in 'libc.a'. */
115 #undef LIB_SPEC
116 #define LIB_SPEC "-lc"
118 /* Pick the right startup code depending on the -pg flag. */
119 #undef STARTFILE_SPEC
120 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
122 /* Make sure that gcc will not look for .h files in /usr/local/include
123 unless user explicitly requests it. */
124 #undef LOCAL_INCLUDE_DIR
126 /* Switch into a generic section. */
127 #define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
129 /* Output at beginning of assembler file. */
130 /* The .file command should always begin the output. */
132 #undef ASM_FILE_START
133 #define ASM_FILE_START(FILE) \
134 do { \
135 output_file_directive (FILE, main_input_filename); \
136 } while (0)
138 /* This is how to output an assembler line
139 that says to advance the location counter
140 to a multiple of 2**LOG bytes. */
142 #undef ASM_OUTPUT_ALIGN
143 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
144 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
146 /* This is how to output a global symbol in the BSS section. */
147 #undef ASM_OUTPUT_ALIGNED_BSS
148 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
149 asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
151 /* This is how to tell assembler that a symbol is weak */
152 #undef ASM_WEAKEN_LABEL
153 #define ASM_WEAKEN_LABEL(FILE,NAME) \
154 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
155 fputc ('\n', FILE); } while (0)
157 /* djgpp automatically calls its own version of __main, so don't define one
158 in libgcc, nor call one in main(). */
159 #define HAS_INIT_SECTION
161 /* Definitions for types and sizes. Wide characters are 16-bits long so
162 Win32 compiler add-ons will be wide character compatible. */
163 #undef WCHAR_UNSIGNED
164 #define WCHAR_UNSIGNED 1
166 #undef WCHAR_TYPE_SIZE
167 #define WCHAR_TYPE_SIZE 16
169 #undef WCHAR_TYPE
170 #define WCHAR_TYPE "short unsigned int"
172 #undef WINT_TYPE
173 #define WINT_TYPE "int"
175 #undef SIZE_TYPE
176 #define SIZE_TYPE "long unsigned int"
178 #undef PTRDIFF_TYPE
179 #define PTRDIFF_TYPE "int"
181 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
182 #define LIBSTDCXX "-lstdcxx"
184 /* -mbnu210 is now ignored and obsolete. It was used to enable support for
185 weak symbols, and .gnu.linkonce support. */
186 #undef MASK_BNU210
187 #define MASK_BNU210 (0x40000000)
189 #undef SUBTARGET_SWITCHES
190 #define SUBTARGET_SWITCHES \
191 { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)" }, \
192 { "bnu210", MASK_BNU210, "Ignored (obsolete)" },
194 /* Warn that -mbnu210 is now obsolete. */
195 #undef SUBTARGET_OVERRIDE_OPTIONS
196 #define SUBTARGET_OVERRIDE_OPTIONS \
197 do \
199 if (target_flags & MASK_BNU210) \
201 warning ("-mbnu210 is ignored (option is obsolete)"); \
204 while (0)
206 /* Support for C++ templates. */
207 #undef MAKE_DECL_ONE_ONLY
208 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
210 #undef UNIQUE_SECTION
211 #define UNIQUE_SECTION(DECL,RELOC) \
212 do { \
213 int len; \
214 const char *name, *prefix; \
215 char *string; \
217 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
219 if (! DECL_ONE_ONLY (DECL)) \
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."; \
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."; \
235 len = strlen (name) + strlen (prefix); \
236 string = alloca (len + 1); \
237 sprintf (string, "%s%s", prefix, name); \
239 DECL_SECTION_NAME (DECL) = build_string (len, string); \
240 } while (0)