]>
Commit | Line | Data |
---|---|---|
79d868e8 | 1 | /* Configuration for an i386 running MS-DOS with DJGPP. |
7adcbafe | 2 | Copyright (C) 1997-2022 Free Software Foundation, Inc. |
fdf004cf | 3 | |
e20285ad | 4 | This file is part of GCC. |
fdf004cf | 5 | |
e20285ad | 6 | GCC is free software; you can redistribute it and/or modify |
fdf004cf | 7 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 8 | the Free Software Foundation; either version 3, or (at your option) |
fdf004cf JL |
9 | any later version. |
10 | ||
e20285ad | 11 | GCC is distributed in the hope that it will be useful, |
fdf004cf JL |
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 | |
2f83c7d6 NC |
17 | along with GCC; see the file COPYING3. If not see |
18 | <http://www.gnu.org/licenses/>. */ | |
fdf004cf | 19 | |
19723541 | 20 | /* Support generation of DWARF2 debugging info. */ |
23532de9 | 21 | #define DWARF2_DEBUGGING_INFO 1 |
19723541 | 22 | |
3df6ff35 AP |
23 | #undef PREFERRED_DEBUGGING_TYPE |
24 | #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG | |
25 | ||
bc3c01c5 | 26 | #undef BSS_SECTION_ASM_OP |
7901f53f | 27 | #define BSS_SECTION_ASM_OP "\t.section\t.bss" |
bc3c01c5 | 28 | |
762f069d ME |
29 | /* Define the name of the .data section. */ |
30 | #undef DATA_SECTION_ASM_OP | |
31 | #define DATA_SECTION_ASM_OP "\t.section .data" | |
32 | ||
3df6ff35 AP |
33 | /* Define the name of the .ident op. */ |
34 | #undef TARGET_ASM_OUTPUT_IDENT | |
35 | #define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive | |
36 | ||
9ee9f4f0 | 37 | /* Enable alias attribute support. */ |
7901f53f | 38 | #ifndef SET_ASM_OP |
71d48a01 | 39 | #define SET_ASM_OP "\t.set\t" |
7901f53f | 40 | #endif |
9ee9f4f0 | 41 | |
762f069d ME |
42 | /* Define the name of the .text section. */ |
43 | #undef TEXT_SECTION_ASM_OP | |
44 | #define TEXT_SECTION_ASM_OP "\t.section .text" | |
45 | ||
f60ed6be NB |
46 | #define TARGET_OS_CPP_BUILTINS() \ |
47 | do \ | |
48 | { \ | |
3df6ff35 AP |
49 | if (!flag_iso) \ |
50 | builtin_define_with_int_value ("DJGPP",2); \ | |
51 | builtin_define_with_int_value ("__DJGPP",2); \ | |
52 | builtin_define_with_int_value ("__DJGPP__",2); \ | |
f60ed6be NB |
53 | builtin_define_std ("MSDOS"); \ |
54 | builtin_define_std ("GO32"); \ | |
3df6ff35 | 55 | builtin_define_std ("unix"); \ |
f60ed6be NB |
56 | builtin_assert ("system=msdos"); \ |
57 | } \ | |
58 | while (0) | |
66168f5d | 59 | |
762f069d | 60 | #undef CPP_SPEC |
3df6ff35 AP |
61 | #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE}" |
62 | ||
63 | #undef POST_LINK_SPEC | |
64 | #define POST_LINK_SPEC "stubify %{v} %{o*:%*} %{!o*:a.out}" | |
d4308a83 ME |
65 | |
66 | /* Always just link in 'libc.a'. */ | |
67 | #undef LIB_SPEC | |
68 | #define LIB_SPEC "-lc" | |
69 | ||
70 | /* Pick the right startup code depending on the -pg flag. */ | |
71 | #undef STARTFILE_SPEC | |
7901f53f | 72 | #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}" |
d4308a83 | 73 | |
7c262518 | 74 | /* Switch into a generic section. */ |
3df6ff35 | 75 | #define TARGET_ASM_NAMED_SECTION i386_djgpp_asm_named_section |
f8c5e8bf | 76 | |
46d4a027 DE |
77 | /* This is how to output an assembler line |
78 | that says to advance the location counter | |
79 | to a multiple of 2**LOG bytes. */ | |
66168f5d | 80 | |
46d4a027 DE |
81 | #undef ASM_OUTPUT_ALIGN |
82 | #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
7c030ad0 | 83 | if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG) |
c678a7f8 | 84 | |
1bf560bd ME |
85 | /* This is how to output a global symbol in the BSS section. */ |
86 | #undef ASM_OUTPUT_ALIGNED_BSS | |
87 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
88 | asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) | |
89 | ||
5aa11061 DD |
90 | /* Write the extra assembler code needed to declare a function properly. */ |
91 | ||
92 | #ifndef ASM_DECLARE_FUNCTION_NAME | |
93 | #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ | |
94 | do \ | |
95 | { \ | |
96 | ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \ | |
97 | } \ | |
98 | while (0) | |
99 | #endif | |
100 | ||
52e45a60 ME |
101 | /* This is how to tell assembler that a symbol is weak */ |
102 | #undef ASM_WEAKEN_LABEL | |
103 | #define ASM_WEAKEN_LABEL(FILE,NAME) \ | |
104 | do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ | |
105 | fputc ('\n', FILE); } while (0) | |
106 | ||
7901f53f JL |
107 | /* djgpp automatically calls its own version of __main, so don't define one |
108 | in libgcc, nor call one in main(). */ | |
109 | #define HAS_INIT_SECTION | |
762f069d | 110 | |
d33d9e47 AI |
111 | #undef TARGET_LIBC_HAS_FUNCTION |
112 | #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function | |
113 | ||
93284395 ME |
114 | /* Definitions for types and sizes. Wide characters are 16-bits long so |
115 | Win32 compiler add-ons will be wide character compatible. */ | |
93284395 | 116 | #undef WCHAR_TYPE_SIZE |
762f069d | 117 | #define WCHAR_TYPE_SIZE 16 |
93284395 ME |
118 | |
119 | #undef WCHAR_TYPE | |
762f069d ME |
120 | #define WCHAR_TYPE "short unsigned int" |
121 | ||
93284395 ME |
122 | #undef WINT_TYPE |
123 | #define WINT_TYPE "int" | |
124 | ||
125 | #undef SIZE_TYPE | |
126 | #define SIZE_TYPE "long unsigned int" | |
127 | ||
128 | #undef PTRDIFF_TYPE | |
129 | #define PTRDIFF_TYPE "int" | |
130 | ||
ca60bd93 ML |
131 | #undef DEBUGGER_REGNO |
132 | #define DEBUGGER_REGNO(n) svr4_debugger_register_map[n] | |
3df6ff35 AP |
133 | |
134 | /* Default to pcc-struct-return. */ | |
135 | #define DEFAULT_PCC_STRUCT_RETURN 1 | |
136 | ||
137 | /* Ignore (with warning) -fPIC for DJGPP */ | |
138 | #undef SUBTARGET_OVERRIDE_OPTIONS | |
139 | #define SUBTARGET_OVERRIDE_OPTIONS \ | |
140 | do { \ | |
141 | if (flag_pic) \ | |
142 | { \ | |
143 | fnotice(stdout, "-f%s ignored (not supported for DJGPP)\n", \ | |
144 | (flag_pic > 1) ? "PIC" : "pic"); \ | |
145 | flag_pic = 0; \ | |
146 | } \ | |
147 | \ | |
148 | /* Don't emit DWARF3/4 unless specifically selected. */ \ | |
149 | /* DWARF3/4 currently does not work for DJGPP. */ \ | |
00f34291 | 150 | if (!OPTION_SET_P (dwarf_version)) \ |
3df6ff35 AP |
151 | dwarf_version = 2; \ |
152 | \ | |
153 | } \ | |
154 | while (0) | |
52e45a60 ME |
155 | |
156 | /* Support for C++ templates. */ | |
157 | #undef MAKE_DECL_ONE_ONLY | |
158 | #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) | |
8cc4b7a2 | 159 | |
3311d93c JWJ |
160 | #undef TARGET_COFF |
161 | #define TARGET_COFF 1 | |
162 | ||
163 | /* Kludge because of missing COFF support for early LTO debug. */ | |
164 | #undef TARGET_ASM_LTO_START | |
165 | #define TARGET_ASM_LTO_START i386_djgpp_asm_lto_start | |
166 | #undef TARGET_ASM_LTO_END | |
167 | #define TARGET_ASM_LTO_END i386_djgpp_asm_lto_end | |
168 | ||
e53b6e56 | 169 | /* Function protypes for gcc/i386/djgpp.cc */ |
3df6ff35 AP |
170 | |
171 | void | |
172 | i386_djgpp_asm_named_section(const char *name, unsigned int flags, | |
173 | tree decl); | |
3311d93c JWJ |
174 | void i386_djgpp_asm_lto_start (void); |
175 | void i386_djgpp_asm_lto_end (void); |