]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
386bsd.h, [...]: Remove -Di386 -Acpu(i386) -Amachine(i386) from CPP_PREDEFINES.
[thirdparty/gcc.git] / gcc / config / i386 / djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
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.
10
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.
15
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. */
20
21
22 #include "dbxcoff.h"
23
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
26
27 #define HANDLE_SYSV_PRAGMA
28
29 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
30 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
31
32 #define YES_UNDERSCORES
33
34 #include "i386/gas.h"
35
36 /* If defined, a C expression whose value is a string containing the
37 assembler operation to identify the following data as
38 uninitialized global data. If not defined, and neither
39 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
40 uninitialized global data will be output in the data section if
41 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
42 used. */
43 #undef BSS_SECTION_ASM_OP
44 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
45
46 /* Enable alias attribute support. */
47 #ifndef SET_ASM_OP
48 #define SET_ASM_OP "\t.set"
49 #endif
50
51 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
52 #define MD_EXEC_PREFIX "$DJDIR/bin/"
53
54 /* Correctly handle absolute filename detection in cp/xref.c */
55 #define FILE_NAME_ABSOLUTE_P(NAME) \
56 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
57 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
58
59 #undef CPP_PREDEFINES
60 #define CPP_PREDEFINES "-Dunix -DGO32 -DDJGPP=2 -DMSDOS \
61 -Asystem(unix) -Asystem(msdos)"
62
63 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
64 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
65 before library search directories are known by the linker.
66 This avoids problems when specs file is not available. An alternate way,
67 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
68 */
69
70 #undef LINK_COMMAND_SPEC
71 #define LINK_COMMAND_SPEC \
72 "%{!fsyntax-only: \
73 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
74 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
75 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
76 \t%{static:} %{L*} %D %o\
77 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
78 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
79 \t-Tdjgpp.djl %{T*}}}}}}}\n\
80 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
81
82 /* Always just link in 'libc.a'. */
83 #undef LIB_SPEC
84 #define LIB_SPEC "-lc"
85
86 /* Pick the right startup code depending on the -pg flag. */
87 #undef STARTFILE_SPEC
88 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
89
90 /* Make sure that gcc will not look for .h files in /usr/local/include
91 unless user explicitly requests it. */
92 #undef LOCAL_INCLUDE_DIR
93
94 #undef EXTRA_SECTIONS
95 #define EXTRA_SECTIONS in_ctor, in_dtor
96
97 #undef EXTRA_SECTION_FUNCTIONS
98 #define EXTRA_SECTION_FUNCTIONS \
99 CTOR_SECTION_FUNCTION \
100 DTOR_SECTION_FUNCTION
101
102 #define CTOR_SECTION_FUNCTION \
103 void \
104 ctor_section () \
105 { \
106 if (in_section != in_ctor) \
107 { \
108 fprintf (asm_out_file, "\t.section .ctor\n"); \
109 in_section = in_ctor; \
110 } \
111 }
112
113 #define DTOR_SECTION_FUNCTION \
114 void \
115 dtor_section () \
116 { \
117 if (in_section != in_dtor) \
118 { \
119 fprintf (asm_out_file, "\t.section .dtor\n"); \
120 in_section = in_dtor; \
121 } \
122 }
123
124 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
125 do { \
126 ctor_section (); \
127 fprintf (FILE, "%s\t", ASM_LONG); \
128 assemble_name (FILE, NAME); \
129 fprintf (FILE, "\n"); \
130 } while (0)
131
132 /* Allow (eg) __attribute__((section "locked")) to work */
133 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
134 do { \
135 fprintf (FILE, "\t.section %s\n", NAME); \
136 } while (0)
137
138 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
139 do { \
140 dtor_section (); \
141 fprintf (FILE, "%s\t", ASM_LONG); \
142 assemble_name (FILE, NAME); \
143 fprintf (FILE, "\n"); \
144 } while (0)
145
146 /* Output at beginning of assembler file. */
147 /* The .file command should always begin the output. */
148
149 #undef ASM_FILE_START
150 #define ASM_FILE_START(FILE) \
151 do { \
152 output_file_directive (FILE, main_input_filename); \
153 } while (0)
154
155 /* This is how to output an assembler line
156 that says to advance the location counter
157 to a multiple of 2**LOG bytes. */
158
159 #undef ASM_OUTPUT_ALIGN
160 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
161 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
162
163 /* This is how to output a global symbol in the BSS section. */
164 #undef ASM_OUTPUT_ALIGNED_BSS
165 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
166 asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
167
168 /* djgpp automatically calls its own version of __main, so don't define one
169 in libgcc, nor call one in main(). */
170 #define HAS_INIT_SECTION