djgpp.h revision 169689
1234353Sdim/* Configuration for an i386 running MS-DOS with DJGPP.
2218885Sdim   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005
3218885Sdim   Free Software Foundation, Inc.
4218885Sdim
5218885SdimThis file is part of GCC.
6218885Sdim
7218885SdimGCC is free software; you can redistribute it and/or modify
8218885Sdimit under the terms of the GNU General Public License as published by
9218885Sdimthe Free Software Foundation; either version 2, or (at your option)
10218885Sdimany later version.
11218885Sdim
12218885SdimGCC is distributed in the hope that it will be useful,
13218885Sdimbut WITHOUT ANY WARRANTY; without even the implied warranty of
14221345SdimMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15221345SdimGNU General Public License for more details.
16218885Sdim
17218885SdimYou should have received a copy of the GNU General Public License
18218885Sdimalong with GCC; see the file COPYING.  If not, write to
19218885Sdimthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
20218885SdimBoston, MA 02110-1301, USA.  */
21218885Sdim
22218885Sdim/* Support generation of DWARF2 debugging info.  */
23218885Sdim#define DWARF2_DEBUGGING_INFO 1
24218885Sdim
25218885Sdim/* Don't assume anything about the header files.  */
26218885Sdim#define NO_IMPLICIT_EXTERN_C
27218885Sdim
28218885Sdim#define HANDLE_SYSV_PRAGMA 1
29249423Sdim
30249423Sdim/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */
31218885Sdim#define HANDLE_PRAGMA_PACK_PUSH_POP 1
32239462Sdim
33239462Sdim/* If defined, a C expression whose value is a string containing the
34218885Sdim   assembler operation to identify the following data as
35218885Sdim   uninitialized global data.  If not defined, and neither
36243830Sdim   `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
37243830Sdim   uninitialized global data will be output in the data section if
38243830Sdim   `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
39218885Sdim   used.  */
40218885Sdim#undef BSS_SECTION_ASM_OP
41249423Sdim#define BSS_SECTION_ASM_OP "\t.section\t.bss"
42239462Sdim
43239462Sdim/* Define the name of the .data section.  */
44239462Sdim#undef DATA_SECTION_ASM_OP
45218885Sdim#define DATA_SECTION_ASM_OP "\t.section .data"
46218885Sdim
47218885Sdim/* Define the name of the .ident op.  */
48#undef IDENT_ASM_OP
49#define IDENT_ASM_OP "\t.ident\t"
50
51/* Enable alias attribute support.  */
52#ifndef SET_ASM_OP
53#define SET_ASM_OP "\t.set\t"
54#endif
55
56/* Define the name of the .text section.  */
57#undef TEXT_SECTION_ASM_OP
58#define TEXT_SECTION_ASM_OP "\t.section .text"
59
60/* Define standard DJGPP installation paths.  */
61/* We override default /usr or /usr/local part with /dev/env/DJDIR which */
62/* points to actual DJGPP installation directory.  */
63
64/* Standard include directory */
65#undef STANDARD_INCLUDE_DIR
66#define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
67
68/* Search for as.exe and ld.exe in DJGPP's binary directory.  */
69#undef MD_EXEC_PREFIX
70#define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
71
72/* Standard DJGPP library and startup files */
73#undef MD_STARTFILE_PREFIX
74#define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
75
76/* Correctly handle absolute filename detection in cp/xref.c */
77#define FILE_NAME_ABSOLUTE_P(NAME) \
78        (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
79        (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
80
81#define TARGET_OS_CPP_BUILTINS()		\
82  do						\
83    {						\
84	builtin_define_std ("MSDOS");		\
85	builtin_define_std ("GO32");		\
86	builtin_assert ("system=msdos");	\
87    }						\
88  while (0)
89
90/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined.  */
91#undef CPP_SPEC
92#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
93  -imacros %s../include/sys/version.h"
94
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.
100*/
101
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} }}}}}"
113
114/* Always just link in 'libc.a'.  */
115#undef LIB_SPEC
116#define LIB_SPEC "-lc"
117
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}"
121
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
125
126/* Switch into a generic section.  */
127#define TARGET_ASM_NAMED_SECTION  default_coff_asm_named_section
128
129/* This is how to output an assembler line
130   that says to advance the location counter
131   to a multiple of 2**LOG bytes.  */
132
133#undef ASM_OUTPUT_ALIGN
134#define ASM_OUTPUT_ALIGN(FILE,LOG) \
135  if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
136
137/* This is how to output a global symbol in the BSS section.  */
138#undef ASM_OUTPUT_ALIGNED_BSS
139#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
140  asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
141
142/* This is how to tell assembler that a symbol is weak  */
143#undef ASM_WEAKEN_LABEL
144#define ASM_WEAKEN_LABEL(FILE,NAME) \
145  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
146       fputc ('\n', FILE); } while (0)
147
148/* djgpp automatically calls its own version of __main, so don't define one
149   in libgcc, nor call one in main().  */
150#define HAS_INIT_SECTION
151
152/* Definitions for types and sizes. Wide characters are 16-bits long so
153   Win32 compiler add-ons will be wide character compatible.  */
154#undef WCHAR_TYPE_SIZE
155#define WCHAR_TYPE_SIZE 16
156
157#undef WCHAR_TYPE
158#define WCHAR_TYPE "short unsigned int"
159
160#undef WINT_TYPE
161#define WINT_TYPE "int"
162
163#undef SIZE_TYPE
164#define SIZE_TYPE "long unsigned int"
165
166#undef PTRDIFF_TYPE
167#define PTRDIFF_TYPE "int"
168
169/* Used to be defined in xm-djgpp.h, but moved here for cross-compilers.  */
170#define LIBSTDCXX "-lstdcxx"
171
172#define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)");
173
174/* Warn that -mbnu210 is now obsolete.  */
175#undef  SUBTARGET_OVERRIDE_OPTIONS
176#define SUBTARGET_OVERRIDE_OPTIONS \
177do \
178  { \
179    if (TARGET_BNU210) \
180      {	\
181        warning (0, "-mbnu210 is ignored (option is obsolete)"); \
182      }	\
183  } \
184while (0)
185
186/* Support for C++ templates.  */
187#undef MAKE_DECL_ONE_ONLY
188#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
189