]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
* i386/djgpp.h (SET_ASM_OP): Define.
[thirdparty/gcc.git] / gcc / config / i386 / djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
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)
9 any later version.
10
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.
15
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. */
20
21
22 #include "dbxcoff.h"
23
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
26
27 #define HANDLE_SYSV_PRAGMA
28
29 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
30 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
31
32 #define YES_UNDERSCORES
33
34 #include "i386/gas.h"
35
36 /* Enable alias attribute support. */
37 #ifndef SET_ASM_OP
38 #define SET_ASM_OP "\t.set"
39 #endif
40
41 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
42 #define MD_EXEC_PREFIX "$DJDIR/bin/"
43
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] == ':')))
48
49 #ifdef CPP_PREDEFINES
50 #undef CPP_PREDEFINES
51 #endif
52 #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS \
53 -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
54
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.
60 */
61
62 #undef LINK_COMMAND_SPEC
63 #define LINK_COMMAND_SPEC \
64 "%{!fsyntax-only: \
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} }}}}}"
73
74 /* Make sure that gcc will not look for .h files in /usr/local/include
75 unless user explicitly requests it. */
76 #undef LOCAL_INCLUDE_DIR
77
78 #undef EXTRA_SECTIONS
79 #define EXTRA_SECTIONS in_ctor, in_dtor
80
81 #undef EXTRA_SECTION_FUNCTIONS
82 #define EXTRA_SECTION_FUNCTIONS \
83 CTOR_SECTION_FUNCTION \
84 DTOR_SECTION_FUNCTION
85
86 #define CTOR_SECTION_FUNCTION \
87 void \
88 ctor_section () \
89 { \
90 if (in_section != in_ctor) \
91 { \
92 fprintf (asm_out_file, "\t.section .ctor\n"); \
93 in_section = in_ctor; \
94 } \
95 }
96
97 #define DTOR_SECTION_FUNCTION \
98 void \
99 dtor_section () \
100 { \
101 if (in_section != in_dtor) \
102 { \
103 fprintf (asm_out_file, "\t.section .dtor\n"); \
104 in_section = in_dtor; \
105 } \
106 }
107
108 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
109 do { \
110 ctor_section (); \
111 fprintf (FILE, "%s\t", ASM_LONG); \
112 assemble_name (FILE, NAME); \
113 fprintf (FILE, "\n"); \
114 } while (0)
115
116 /* Allow (eg) __attribute__((section "locked")) to work */
117 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
118 do { \
119 fprintf (FILE, "\t.section %s\n", NAME); \
120 } while (0)
121
122 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
123 do { \
124 dtor_section (); \
125 fprintf (FILE, "%s\t", ASM_LONG); \
126 assemble_name (FILE, NAME); \
127 fprintf (FILE, "\n"); \
128 } while (0)
129
130 /* Output at beginning of assembler file. */
131 /* The .file command should always begin the output. */
132
133 #undef ASM_FILE_START
134 #define ASM_FILE_START(FILE) \
135 do { \
136 output_file_directive (FILE, main_input_filename); \
137 } while (0)
138
139 /* This is how to output an assembler line
140 that says to advance the location counter
141 to a multiple of 2**LOG bytes. */
142
143 #undef ASM_OUTPUT_ALIGN
144 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
145 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
146
147 /* djgpp has atexit (). */
148 #undef HAVE_ATEXIT
149 #define HAVE_ATEXIT
150
151 /* djgpp automatically calls its own version of __main, so don't define one
152 in libgcc, nor call one in main(). */
153 #define HAS_INIT_SECTION