]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007,
3 2010, 2011, 2012 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Support generation of DWARF2 debugging info. */
22 #define DWARF2_DEBUGGING_INFO 1
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
27 #undef BSS_SECTION_ASM_OP
28 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
30 /* Define the name of the .data section. */
31 #undef DATA_SECTION_ASM_OP
32 #define DATA_SECTION_ASM_OP "\t.section .data"
34 /* Enable alias attribute support. */
36 #define SET_ASM_OP "\t.set\t"
39 /* Define the name of the .text section. */
40 #undef TEXT_SECTION_ASM_OP
41 #define TEXT_SECTION_ASM_OP "\t.section .text"
43 /* Define standard DJGPP installation paths. */
44 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
45 /* points to actual DJGPP installation directory. */
47 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
49 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
51 /* Standard DJGPP library and startup files */
52 #undef MD_STARTFILE_PREFIX
53 #define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
55 /* Correctly handle absolute filename detection in cp/xref.c */
56 #define FILE_NAME_ABSOLUTE_P(NAME) \
57 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
58 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
60 #define TARGET_OS_CPP_BUILTINS() \
63 builtin_define_std ("MSDOS"); \
64 builtin_define_std ("GO32"); \
65 builtin_assert ("system=msdos"); \
69 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
71 #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
72 -imacros %s../include/sys/version.h"
74 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
75 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
76 before library search directories are known by the linker.
77 This avoids problems when specs file is not available. An alternate way,
78 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
81 #undef LINK_COMMAND_SPEC
82 #define LINK_COMMAND_SPEC \
84 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{e*} %{N} %{n} \
85 \t%{r} %{s} %{t} %{u*} %{z} %{Z}\
86 \t%{!nostdlib:%{!nostartfiles:%S}}\
87 \t%{static:} %{L*} %D %o\
88 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
89 \t%{!nostdlib:%{!nostartfiles:%E}}\
90 \t-Tdjgpp.djl %{T*}}}}}}}\n\
91 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
93 /* Always just link in 'libc.a'. */
95 #define LIB_SPEC "-lc"
97 /* Pick the right startup code depending on the -pg flag. */
99 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
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
105 /* Switch into a generic section. */
106 #define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
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. */
112 #undef ASM_OUTPUT_ALIGN
113 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
114 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
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))
121 /* This is how to tell assembler that a symbol is weak */
122 #undef ASM_WEAKEN_LABEL
123 #define ASM_WEAKEN_LABEL(FILE,NAME) \
124 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
125 fputc ('\n', FILE); } while (0)
127 /* djgpp automatically calls its own version of __main, so don't define one
128 in libgcc, nor call one in main(). */
129 #define HAS_INIT_SECTION
131 /* Definitions for types and sizes. Wide characters are 16-bits long so
132 Win32 compiler add-ons will be wide character compatible. */
133 #undef WCHAR_TYPE_SIZE
134 #define WCHAR_TYPE_SIZE 16
137 #define WCHAR_TYPE "short unsigned int"
140 #define WINT_TYPE "int"
143 #define SIZE_TYPE "long unsigned int"
146 #define PTRDIFF_TYPE "int"
148 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
149 #define LIBSTDCXX "stdcxx"
151 /* Warn that -mbnu210 is now obsolete. */
152 #undef SUBTARGET_OVERRIDE_OPTIONS
153 #define SUBTARGET_OVERRIDE_OPTIONS \
158 warning (0, "-mbnu210 is ignored (option is obsolete)"); \
163 /* Support for C++ templates. */
164 #undef MAKE_DECL_ONE_ONLY
165 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)