Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gcc / config / i386 / aix386ng.h
1 /* Definitions for IBM PS2 running AIX/386.
2    Copyright (C) 1988, 1996, 1998 Free Software Foundation, Inc.
3    Contributed by Minh Tran-Le <TRANLE@intellicorp.com>.
4
5 This file is part of GNU CC.
6
7 GNU CC 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 2, or (at your option)
10 any later version.
11
12 GNU CC 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.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 #include "i386/i386.h"
24
25 /* Get the generic definitions for system V.3.  */
26
27 #include "svr3.h"
28
29 /* Use the ATT assembler syntax.
30    This overrides at least one macro (USER_LABEL_PREFIX) from svr3.h.  */
31
32 #include "i386/att.h"
33
34 /* Use crt1.o as a startup file and crtn.o as a closing file.  */
35
36 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
37 #define ENDFILE_SPEC   "crtn.o%s"
38
39 #define LIB_SPEC "%{shlib:-lc_s} -lc"
40
41 /* Special flags for the linker.  I don't know what they do.  */
42
43 #define LINK_SPEC "%{K} %{!K:-K} %{T*} %{z:-lm}"
44
45 /* Specify predefined symbols in preprocessor.  */
46
47 #define CPP_PREDEFINES "-Dps2 -Dunix -Asystem(aix)"
48
49 #define CPP_SPEC "%(cpp_cpu) \
50   %{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS"
51
52 /* special flags for the aix assembler to generate the short form for all
53    qualifying forward reference */
54 /* The buggy /bin/as of aix ps/2 1.2.x cannot always handle it. */
55 #if 0
56 #define ASM_SPEC "-s2"
57 #endif /* 0 */
58
59 #undef ASM_FILE_START
60 #define ASM_FILE_START(FILE)                                    \
61   do { output_file_directive (FILE, main_input_filename);       \
62        if (optimize)                                            \
63           ASM_FILE_START_1 (FILE);                              \
64        else                                                     \
65           fprintf (FILE, "\t.noopt\n");                         \
66      } while (0)
67
68 /* This was suggested, but it shouldn't be right for DBX output. -- RMS
69    #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */
70
71 /* Writing `int' for a bitfield forces int alignment for the structure.  */
72
73 #define PCC_BITFIELD_TYPE_MATTERS 1
74
75 #ifndef USE_GAS
76 /* Don't write a `.optim' pseudo; this assembler
77    is said to have a bug when .optim is used.  */
78
79 #undef ASM_FILE_START_1
80 #define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.noopt\n")
81 #endif
82 \f
83 /* Output assembler code to FILE to increment profiler label # LABELNO
84    for profiling a function entry.  */
85
86 #undef FUNCTION_PROFILER
87 #define FUNCTION_PROFILER(FILE, LABELNO)  \
88    fprintf (FILE, "\tleal %sP%d,%%eax\n\tcall mcount\n", LPREFIX, (LABELNO));
89
90 /* Note that using bss_section here caused errors
91    in building shared libraries on system V.3.
92    but AIX 1.2 does not have yet shareable libraries on PS2 */
93 #undef ASM_OUTPUT_LOCAL
94 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
95   (bss_section (),                                      \
96    ASM_OUTPUT_LABEL ((FILE), (NAME)),                   \
97    fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)))
98
99
100 /* Undef all the .init and .fini section stuff if we are not using gas and
101  * gnu ld so that we can use collect because the standard /bin/as and /bin/ld
102  * cannot handle those.
103  */
104 #ifndef USE_GAS
105 # undef INIT_SECTION_ASM_OP
106 # undef FINI_SECTION_ASM_OP
107 # undef CTORS_SECTION_ASM_OP
108 # undef DTORS_SECTION_ASM_OP
109 # undef ASM_OUTPUT_CONSTRUCTOR
110 # undef ASM_OUTPUT_DESTRUCTOR
111 # undef DO_GLOBAL_CTORS_BODY
112
113 # undef CTOR_LIST_BEGIN
114 # define CTOR_LIST_BEGIN
115 # undef CTOR_LIST_END
116 # define CTOR_LIST_END
117 # undef DTOR_LIST_BEGIN
118 # define DTOR_LIST_BEGIN
119 # undef DTOR_LIST_END
120 # define DTOR_LIST_END
121
122 # undef CONST_SECTION_FUNCTION
123 # define CONST_SECTION_FUNCTION                                         \
124 void                                                                    \
125 const_section ()                                                        \
126 {                                                                       \
127   extern void text_section();                                           \
128   text_section();                                                       \
129 }
130
131 # undef EXTRA_SECTION_FUNCTIONS
132 # define EXTRA_SECTION_FUNCTIONS                                \
133   CONST_SECTION_FUNCTION
134
135 /* for collect2 */
136 # define OBJECT_FORMAT_COFF
137 # define MY_ISCOFF(magic) \
138   ((magic) == I386MAGIC || (magic) == I386SVMAGIC)
139
140 #endif /* !USE_GAS */