OSDN Git Service

* i386/xm-djgpp.h (LIBSTDCXX): Delete. Moved to config/i386/djgpp.h.
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2    Copyright (C) 1997, 1998, 1999, 2000 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 /* Define the name of the .ctor section.  */
47 #undef CTORS_SECTION_ASM_OP
48 #define CTORS_SECTION_ASM_OP "\t.section .ctor"
49
50 /* Define the name of the .data section.  */
51 #undef DATA_SECTION_ASM_OP
52 #define DATA_SECTION_ASM_OP "\t.section .data"
53
54 /* Define the name of the .dtor section.  */
55 #undef DTORS_SECTION_ASM_OP
56 #define DTORS_SECTION_ASM_OP "\t.section .dtor"
57
58 /* Define the name of the .eh_frame section.  */
59 #undef EH_FRAME_SECTION_ASM_OP
60 #define EH_FRAME_SECTION_ASM_OP "\t.section .eh_frame"
61
62 /* Define the name of the .ident op.  */
63 #undef IDENT_ASM_OP
64 #define IDENT_ASM_OP "\t.ident"
65
66 /* Enable alias attribute support.  */
67 #ifndef SET_ASM_OP
68 #define SET_ASM_OP "\t.set"
69 #endif
70
71 /* Define the name of the .text section.  */
72 #undef TEXT_SECTION_ASM_OP
73 #define TEXT_SECTION_ASM_OP "\t.section .text"
74
75 /* Search for as.exe and ld.exe in DJGPP's binary directory. */ 
76 #define MD_EXEC_PREFIX "$DJDIR/bin/"
77
78 /* Correctly handle absolute filename detection in cp/xref.c */
79 #define FILE_NAME_ABSOLUTE_P(NAME) \
80         (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
81         (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
82
83 #undef CPP_PREDEFINES
84 #define CPP_PREDEFINES "-Dunix -DGO32 -DDJGPP=2 -DMSDOS \
85   -Asystem(unix) -Asystem(msdos)"
86
87 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined.  */
88 #undef CPP_SPEC
89 #define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
90   -imacros %s../include/sys/version.h"
91 +
92 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
93    This cannot be done in LINK_SPECS as that LINK_SPECS is processed
94    before library search directories are known by the linker.
95    This avoids problems when specs file is not available. An alternate way,
96    suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
97 */ 
98
99 #undef LINK_COMMAND_SPEC
100 #define LINK_COMMAND_SPEC \
101 "%{!fsyntax-only: \
102 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
103 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
104 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
105 \t%{static:} %{L*} %D %o\
106 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
107 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
108 \t-Tdjgpp.djl %{T*}}}}}}}\n\
109 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
110
111 /* Always just link in 'libc.a'.  */
112 #undef LIB_SPEC
113 #define LIB_SPEC "-lc"
114
115 /* Pick the right startup code depending on the -pg flag.  */
116 #undef STARTFILE_SPEC
117 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
118
119 /* Make sure that gcc will not look for .h files in /usr/local/include 
120    unless user explicitly requests it.  */
121 #undef LOCAL_INCLUDE_DIR
122
123 #undef EXTRA_SECTIONS
124 #define EXTRA_SECTIONS in_ctor, in_dtor
125
126 #undef EXTRA_SECTION_FUNCTIONS
127 #define EXTRA_SECTION_FUNCTIONS                                 \
128   CTOR_SECTION_FUNCTION                                         \
129   DTOR_SECTION_FUNCTION
130
131 #define CTOR_SECTION_FUNCTION                                   \
132 void                                                            \
133 ctor_section ()                                                 \
134 {                                                               \
135   if (in_section != in_ctor)                                    \
136     {                                                           \
137       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
138       in_section = in_ctor;                                     \
139     }                                                           \
140 }
141
142 #define DTOR_SECTION_FUNCTION                                   \
143 void                                                            \
144 dtor_section ()                                                 \
145 {                                                               \
146   if (in_section != in_dtor)                                    \
147     {                                                           \
148       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
149       in_section = in_dtor;                                     \
150     }                                                           \
151 }
152
153 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)       \
154   do {                                          \
155     ctor_section ();                            \
156     fprintf (FILE, "%s\t", ASM_LONG);           \
157     assemble_name (FILE, NAME);                 \
158     fprintf (FILE, "\n");                       \
159   } while (0)
160
161 /* Allow (eg) __attribute__((section "locked")) to work */
162 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
163   do {                                          \
164     fprintf (FILE, "\t.section %s\n", NAME);    \
165   } while (0)
166
167 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)        \
168   do {                                          \
169     dtor_section ();                            \
170     fprintf (FILE, "%s\t", ASM_LONG);           \
171     assemble_name (FILE, NAME);                 \
172     fprintf (FILE, "\n");                       \
173   } while (0)
174
175 /* Output at beginning of assembler file.  */
176 /* The .file command should always begin the output.  */
177
178 #undef ASM_FILE_START
179 #define ASM_FILE_START(FILE)                                            \
180   do {                                                                  \
181         output_file_directive (FILE, main_input_filename);              \
182   } while (0)
183
184 /* This is how to output an assembler line
185    that says to advance the location counter
186    to a multiple of 2**LOG bytes.  */
187
188 #undef ASM_OUTPUT_ALIGN
189 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
190   if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
191
192 /* This is how to output a global symbol in the BSS section.  */
193 #undef ASM_OUTPUT_ALIGNED_BSS
194 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
195   asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
196
197 /* djgpp automatically calls its own version of __main, so don't define one
198    in libgcc, nor call one in main().  */
199 #define HAS_INIT_SECTION
200
201 /* Definitions to set wchar_t type to 'unsigned short int' to help out
202    add-on Windows compilers for DJGPP. */
203 #define WCHAR_UNSIGNED 1
204 #define WCHAR_TYPE_SIZE 16
205 #define WCHAR_TYPE "short unsigned int"
206
207 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers.  */
208 #define LIBSTDCXX "-lstdcxx"