2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / i386 / sysv3.h
blobb2643b14eb371b6cfcfae72eaa94cea6bf5d7b54
1 /* Definitions for Intel 386 running system V.
2 Copyright (C) 1988, 1996, 2000, 2002 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC 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.
11 GCC 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 GCC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
23 /* Use crt1.o as a startup file and crtn.o as a closing file. */
25 #define STARTFILE_SPEC \
26 "%{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}} crtbegin.o%s\
27 %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}"
29 /* ??? There is a suggestion that -lg is needed here.
30 Does anyone know whether this is right? */
31 #define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc crtend.o%s crtn.o%s"
33 /* Specify predefined symbols in preprocessor. */
35 #define TARGET_OS_CPP_BUILTINS() \
36 do \
37 { \
38 builtin_define_std ("unix"); \
39 builtin_assert ("system=svr3"); \
40 } \
41 while (0)
43 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
45 /* Writing `int' for a bit-field forces int alignment for the structure. */
47 #define PCC_BITFIELD_TYPE_MATTERS 1
49 /* We want to be able to get DBX debugging information via -gstabs. */
51 #define DBX_DEBUGGING_INFO 1
53 #undef PREFERRED_DEBUGGING_TYPE
54 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
56 /* longjmp may fail to restore the registers if called from the same
57 function that called setjmp. To compensate, the compiler avoids
58 putting variables in registers in functions that use both setjmp
59 and longjmp. */
61 #define NON_SAVING_SETJMP \
62 (current_function_calls_setjmp && current_function_calls_longjmp)
64 /* longjmp may fail to restore the stack pointer if the saved frame
65 pointer is the same as the caller's frame pointer. Requiring a frame
66 pointer in any function that calls setjmp or longjmp avoids this
67 problem, unless setjmp and longjmp are called from the same function.
68 Since a frame pointer will be required in such a function, it is OK
69 that the stack pointer is not restored. */
71 #undef SUBTARGET_FRAME_POINTER_REQUIRED
72 #define SUBTARGET_FRAME_POINTER_REQUIRED \
73 (current_function_calls_setjmp || current_function_calls_longjmp)
75 /* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib. */
76 #undef ASM_OUTPUT_LOCAL
77 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
78 do { \
79 int align = exact_log2 (ROUNDED); \
80 if (align > 2) align = 2; \
81 if (TARGET_SVR3_SHLIB) \
82 data_section (); \
83 else \
84 bss_section (); \
85 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
86 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
87 fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED));\
88 } while (0)
90 /* Define a few machine-specific details of the implementation of
91 constructors.
93 The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
94 and CTOR_LIST_END to contribute to the .init section an instruction to
95 push a word containing 0 (or some equivalent of that). */
97 #undef INIT_SECTION_ASM_OP
98 #define INIT_SECTION_ASM_OP "\t.section .init,\"x\""
100 #define CTOR_LIST_BEGIN \
101 asm (INIT_SECTION_ASM_OP); \
102 asm ("pushl $0")
103 #define CTOR_LIST_END CTOR_LIST_BEGIN
105 #define TARGET_ASM_CONSTRUCTOR ix86_svr3_asm_out_constructor