]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/djgpp.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / i386 / djgpp.h
CommitLineData
dc68aa49 1/* Configuration for an i386 running MS-DOS with DJGPP.
f1717362 2 Copyright (C) 1997-2016 Free Software Foundation, Inc.
8572f93b 3
ccd321d7 4This file is part of GCC.
8572f93b 5
ccd321d7 6GCC is free software; you can redistribute it and/or modify
8572f93b 7it under the terms of the GNU General Public License as published by
038d1e19 8the Free Software Foundation; either version 3, or (at your option)
8572f93b 9any later version.
10
ccd321d7 11GCC is distributed in the hope that it will be useful,
8572f93b 12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
038d1e19 17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
8572f93b 19
2f2888fb 20/* Support generation of DWARF2 debugging info. */
a4cad234 21#define DWARF2_DEBUGGING_INFO 1
2f2888fb 22
bb441676 23/* Don't assume anything about the header files. */
ca953aeb 24#define NO_IMPLICIT_EXTERN_C
25
fecdcd66 26#undef BSS_SECTION_ASM_OP
a597770e 27#define BSS_SECTION_ASM_OP "\t.section\t.bss"
fecdcd66 28
6f933364 29/* Define the name of the .data section. */
30#undef DATA_SECTION_ASM_OP
31#define DATA_SECTION_ASM_OP "\t.section .data"
32
3e222f10 33/* Enable alias attribute support. */
a597770e 34#ifndef SET_ASM_OP
e2f5319a 35#define SET_ASM_OP "\t.set\t"
a597770e 36#endif
3e222f10 37
6f933364 38/* Define the name of the .text section. */
39#undef TEXT_SECTION_ASM_OP
40#define TEXT_SECTION_ASM_OP "\t.section .text"
41
d697f1db 42/* Define standard DJGPP installation paths. */
b7b8ae12 43/* We override default /usr or /usr/local part with /dev/env/DJDIR which */
d697f1db 44/* points to actual DJGPP installation directory. */
b7b8ae12 45
bb441676 46/* Search for as.exe and ld.exe in DJGPP's binary directory. */
b7b8ae12 47#undef MD_EXEC_PREFIX
4e79af62 48#define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
4c0bcacd 49
b7b8ae12 50/* Standard DJGPP library and startup files */
51#undef MD_STARTFILE_PREFIX
52#define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
53
4c0bcacd 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
e6627095 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)
14962dd2 67
6f933364 68/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
69#undef CPP_SPEC
d9d8b700 70#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
6f933364 71 -imacros %s../include/sys/version.h"
f00484e1 72
a597770e 73/* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
4c0bcacd 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: \
4185c905 83%{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l " LINK_COMPRESS_DEBUG_SPEC \
84"%X %{o*} %{e*} %{N} %{n} \
f37ef985 85\t%{r} %{s} %{t} %{u*} %{z} %{Z}\
b9504307 86\t%{!nostdlib:%{!nostartfiles:%S}}\
4c0bcacd 87\t%{static:} %{L*} %D %o\
21eaebc3 88\t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
b9504307 89\t%{!nostdlib:%{!nostartfiles:%E}}\
a597770e 90\t-Tdjgpp.djl %{T*}}}}}}}\n\
4c0bcacd 91%{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
bde7c37c 92
93/* Always just link in 'libc.a'. */
94#undef LIB_SPEC
95#define LIB_SPEC "-lc"
96
97/* Pick the right startup code depending on the -pg flag. */
98#undef STARTFILE_SPEC
a597770e 99#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
bde7c37c 100
4c0bcacd 101/* Make sure that gcc will not look for .h files in /usr/local/include
102 unless user explicitly requests it. */
103#undef LOCAL_INCLUDE_DIR
104
2cb4ac60 105/* Switch into a generic section. */
106#define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
9363800b 107
013f7fc7 108/* This is how to output an assembler line
109 that says to advance the location counter
110 to a multiple of 2**LOG bytes. */
14962dd2 111
013f7fc7 112#undef ASM_OUTPUT_ALIGN
113#define ASM_OUTPUT_ALIGN(FILE,LOG) \
5d237b80 114 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
c478531c 115
bbf077af 116/* This is how to output a global symbol in the BSS section. */
117#undef ASM_OUTPUT_ALIGNED_BSS
118#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
119 asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
120
acb1c4c4 121/* Write the extra assembler code needed to declare a function properly. */
122
123#ifndef ASM_DECLARE_FUNCTION_NAME
124#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
125 do \
126 { \
127 ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
128 } \
129 while (0)
130#endif
131
8dd5a224 132/* This is how to tell assembler that a symbol is weak */
133#undef ASM_WEAKEN_LABEL
134#define ASM_WEAKEN_LABEL(FILE,NAME) \
135 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
136 fputc ('\n', FILE); } while (0)
137
a597770e 138/* djgpp automatically calls its own version of __main, so don't define one
139 in libgcc, nor call one in main(). */
140#define HAS_INIT_SECTION
6f933364 141
30f690e0 142#undef TARGET_LIBC_HAS_FUNCTION
143#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
144
4e79af62 145/* Definitions for types and sizes. Wide characters are 16-bits long so
146 Win32 compiler add-ons will be wide character compatible. */
4e79af62 147#undef WCHAR_TYPE_SIZE
6f933364 148#define WCHAR_TYPE_SIZE 16
4e79af62 149
150#undef WCHAR_TYPE
6f933364 151#define WCHAR_TYPE "short unsigned int"
152
4e79af62 153#undef WINT_TYPE
154#define WINT_TYPE "int"
155
156#undef SIZE_TYPE
157#define SIZE_TYPE "long unsigned int"
158
159#undef PTRDIFF_TYPE
160#define PTRDIFF_TYPE "int"
161
6f933364 162/* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
cb22f930 163#define LIBSTDCXX "stdcxx"
8dd5a224 164
ad6b8b1b 165/* Warn that -mbnu210 is now obsolete. */
166#undef SUBTARGET_OVERRIDE_OPTIONS
167#define SUBTARGET_OVERRIDE_OPTIONS \
168do \
169 { \
0c44645a 170 if (TARGET_BNU210) \
ad6b8b1b 171 { \
c3ceba8e 172 warning (0, "-mbnu210 is ignored (option is obsolete)"); \
ad6b8b1b 173 } \
174 } \
175while (0)
8dd5a224 176
177/* Support for C++ templates. */
178#undef MAKE_DECL_ONE_ONLY
179#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
d5957f0d 180
181#define IX86_MAYBE_NO_LIBGCC_TFMODE