1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC 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 2, or (at your option)
11 GNU CC 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.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
27 #define HANDLE_SYSV_PRAGMA
29 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
30 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
32 #define YES_UNDERSCORES
36 /* Enable alias attribute support. */
38 #define SET_ASM_OP "\t.set"
41 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
42 #define MD_EXEC_PREFIX "$DJDIR/bin/"
44 /* Correctly handle absolute filename detection in cp/xref.c */
45 #define FILE_NAME_ABSOLUTE_P(NAME) \
46 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
47 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
52 #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS \
53 -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
55 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
56 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
57 before library search directories are known by the linker.
58 This avoids problems when specs file is not available. An alternate way,
59 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
62 #undef LINK_COMMAND_SPEC
63 #define LINK_COMMAND_SPEC \
65 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
66 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
67 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
68 \t%{static:} %{L*} %D %o\
69 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
70 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
71 \t-Tdjgpp.djl %{T*}}}}}}}\n\
72 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
74 /* Always just link in 'libc.a'. */
76 #define LIB_SPEC "-lc"
78 /* Pick the right startup code depending on the -pg flag. */
80 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
82 /* Make sure that gcc will not look for .h files in /usr/local/include
83 unless user explicitly requests it. */
84 #undef LOCAL_INCLUDE_DIR
87 #define EXTRA_SECTIONS in_ctor, in_dtor
89 #undef EXTRA_SECTION_FUNCTIONS
90 #define EXTRA_SECTION_FUNCTIONS \
91 CTOR_SECTION_FUNCTION \
94 #define CTOR_SECTION_FUNCTION \
98 if (in_section != in_ctor) \
100 fprintf (asm_out_file, "\t.section .ctor\n"); \
101 in_section = in_ctor; \
105 #define DTOR_SECTION_FUNCTION \
109 if (in_section != in_dtor) \
111 fprintf (asm_out_file, "\t.section .dtor\n"); \
112 in_section = in_dtor; \
116 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
119 fprintf (FILE, "%s\t", ASM_LONG); \
120 assemble_name (FILE, NAME); \
121 fprintf (FILE, "\n"); \
124 /* Allow (eg) __attribute__((section "locked")) to work */
125 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
127 fprintf (FILE, "\t.section %s\n", NAME); \
130 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
133 fprintf (FILE, "%s\t", ASM_LONG); \
134 assemble_name (FILE, NAME); \
135 fprintf (FILE, "\n"); \
138 /* Output at beginning of assembler file. */
139 /* The .file command should always begin the output. */
141 #undef ASM_FILE_START
142 #define ASM_FILE_START(FILE) \
144 output_file_directive (FILE, main_input_filename); \
147 /* This is how to output an assembler line
148 that says to advance the location counter
149 to a multiple of 2**LOG bytes. */
151 #undef ASM_OUTPUT_ALIGN
152 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
153 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
155 /* djgpp has atexit (). */
159 /* djgpp automatically calls its own version of __main, so don't define one
160 in libgcc, nor call one in main(). */
161 #define HAS_INIT_SECTION