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