]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
tm.texi.in (ASM_OUTPUT_BSS): Remove documentation.
[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, 2004, 2005, 2007,
3 2010, 2011 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC 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 3, or (at your option)
10 any later version.
11
12 GCC 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 GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 /* Support generation of DWARF2 debugging info. */
22 #define DWARF2_DEBUGGING_INFO 1
23
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
26
27 #undef BSS_SECTION_ASM_OP
28 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
29
30 /* Define the name of the .data section. */
31 #undef DATA_SECTION_ASM_OP
32 #define DATA_SECTION_ASM_OP "\t.section .data"
33
34 /* Define the name of the .ident op. */
35 #undef IDENT_ASM_OP
36 #define IDENT_ASM_OP "\t.ident\t"
37
38 /* Enable alias attribute support. */
39 #ifndef SET_ASM_OP
40 #define SET_ASM_OP "\t.set\t"
41 #endif
42
43 /* Define the name of the .text section. */
44 #undef TEXT_SECTION_ASM_OP
45 #define TEXT_SECTION_ASM_OP "\t.section .text"
46
47 /* Define standard DJGPP installation paths. */
48 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
49 /* points to actual DJGPP installation directory. */
50
51 /* Standard include directory */
52 #undef STANDARD_INCLUDE_DIR
53 #define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
54
55 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
56 #undef MD_EXEC_PREFIX
57 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
58
59 /* Standard DJGPP library and startup files */
60 #undef MD_STARTFILE_PREFIX
61 #define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
62
63 /* Correctly handle absolute filename detection in cp/xref.c */
64 #define FILE_NAME_ABSOLUTE_P(NAME) \
65 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
66 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
67
68 #define TARGET_OS_CPP_BUILTINS() \
69 do \
70 { \
71 builtin_define_std ("MSDOS"); \
72 builtin_define_std ("GO32"); \
73 builtin_assert ("system=msdos"); \
74 } \
75 while (0)
76
77 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
78 #undef CPP_SPEC
79 #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
80 -imacros %s../include/sys/version.h"
81
82 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
83 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
84 before library search directories are known by the linker.
85 This avoids problems when specs file is not available. An alternate way,
86 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
87 */
88
89 #undef LINK_COMMAND_SPEC
90 #define LINK_COMMAND_SPEC \
91 "%{!fsyntax-only: \
92 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{e*} %{N} %{n} \
93 \t%{r} %{s} %{t} %{u*} %{z} %{Z}\
94 \t%{!nostdlib:%{!nostartfiles:%S}}\
95 \t%{static:} %{L*} %D %o\
96 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
97 \t%{!nostdlib:%{!nostartfiles:%E}}\
98 \t-Tdjgpp.djl %{T*}}}}}}}\n\
99 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
100
101 /* Always just link in 'libc.a'. */
102 #undef LIB_SPEC
103 #define LIB_SPEC "-lc"
104
105 /* Pick the right startup code depending on the -pg flag. */
106 #undef STARTFILE_SPEC
107 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
108
109 /* Make sure that gcc will not look for .h files in /usr/local/include
110 unless user explicitly requests it. */
111 #undef LOCAL_INCLUDE_DIR
112
113 /* Switch into a generic section. */
114 #define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
115
116 /* This is how to output an assembler line
117 that says to advance the location counter
118 to a multiple of 2**LOG bytes. */
119
120 #undef ASM_OUTPUT_ALIGN
121 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
122 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
123
124 /* This is how to output a global symbol in the BSS section. */
125 #undef ASM_OUTPUT_ALIGNED_BSS
126 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
127 asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
128
129 /* This is how to tell assembler that a symbol is weak */
130 #undef ASM_WEAKEN_LABEL
131 #define ASM_WEAKEN_LABEL(FILE,NAME) \
132 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
133 fputc ('\n', FILE); } while (0)
134
135 /* djgpp automatically calls its own version of __main, so don't define one
136 in libgcc, nor call one in main(). */
137 #define HAS_INIT_SECTION
138
139 /* Definitions for types and sizes. Wide characters are 16-bits long so
140 Win32 compiler add-ons will be wide character compatible. */
141 #undef WCHAR_TYPE_SIZE
142 #define WCHAR_TYPE_SIZE 16
143
144 #undef WCHAR_TYPE
145 #define WCHAR_TYPE "short unsigned int"
146
147 #undef WINT_TYPE
148 #define WINT_TYPE "int"
149
150 #undef SIZE_TYPE
151 #define SIZE_TYPE "long unsigned int"
152
153 #undef PTRDIFF_TYPE
154 #define PTRDIFF_TYPE "int"
155
156 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
157 #define LIBSTDCXX "stdcxx"
158
159 /* Warn that -mbnu210 is now obsolete. */
160 #undef SUBTARGET_OVERRIDE_OPTIONS
161 #define SUBTARGET_OVERRIDE_OPTIONS \
162 do \
163 { \
164 if (TARGET_BNU210) \
165 { \
166 warning (0, "-mbnu210 is ignored (option is obsolete)"); \
167 } \
168 } \
169 while (0)
170
171 /* Support for C++ templates. */
172 #undef MAKE_DECL_ONE_ONLY
173 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)