1/* Definitions for Intel 386 running system V.
2   Copyright (C) 1988, 1996, 2000, 2002 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING.  If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA.  */
20
21#define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
22
23/* Use crt1.o as a startup file and crtn.o as a closing file.  */
24
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}"
28
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"
32
33/* Specify predefined symbols in preprocessor.  */
34
35#define TARGET_OS_CPP_BUILTINS()		\
36  do						\
37    {						\
38	builtin_define_std ("unix");		\
39	builtin_assert ("system=svr3");		\
40    }						\
41  while (0)
42
43#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
44
45/* Writing `int' for a bit-field forces int alignment for the structure.  */
46
47#define PCC_BITFIELD_TYPE_MATTERS 1
48
49/* Don't write a `.optim' pseudo; this assembler doesn't handle them.  */
50
51#undef ASM_FILE_START_1
52#define ASM_FILE_START_1(FILE)
53
54/* We want to be able to get DBX debugging information via -gstabs.  */
55
56#define DBX_DEBUGGING_INFO 1
57
58#undef PREFERRED_DEBUGGING_TYPE
59#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
60
61/* longjmp may fail to restore the registers if called from the same
62   function that called setjmp.  To compensate, the compiler avoids
63   putting variables in registers in functions that use both setjmp
64   and longjmp.  */
65
66#define NON_SAVING_SETJMP \
67  (current_function_calls_setjmp && current_function_calls_longjmp)
68
69/* longjmp may fail to restore the stack pointer if the saved frame
70   pointer is the same as the caller's frame pointer.  Requiring a frame
71   pointer in any function that calls setjmp or longjmp avoids this
72   problem, unless setjmp and longjmp are called from the same function.
73   Since a frame pointer will be required in such a function, it is OK
74   that the stack pointer is not restored.  */
75
76#undef SUBTARGET_FRAME_POINTER_REQUIRED
77#define SUBTARGET_FRAME_POINTER_REQUIRED \
78  (current_function_calls_setjmp || current_function_calls_longjmp)
79
80/* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib.  */
81#undef ASM_OUTPUT_LOCAL
82#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)	\
83  do {							\
84    int align = exact_log2 (ROUNDED);			\
85    if (align > 2) align = 2;				\
86    if (TARGET_SVR3_SHLIB)				\
87      data_section ();					\
88    else						\
89      bss_section ();					\
90    ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align);	\
91    ASM_OUTPUT_LABEL ((FILE), (NAME));			\
92    fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED));	\
93  } while (0)
94
95/* Define a few machine-specific details of the implementation of
96   constructors.
97
98   The __CTORS_LIST__ goes in the .init section.  Define CTOR_LIST_BEGIN
99   and CTOR_LIST_END to contribute to the .init section an instruction to
100   push a word containing 0 (or some equivalent of that).  */
101
102#undef INIT_SECTION_ASM_OP
103#define INIT_SECTION_ASM_OP     "\t.section .init,\"x\""
104
105#define CTOR_LIST_BEGIN				\
106  asm (INIT_SECTION_ASM_OP);			\
107  asm ("pushl $0")
108#define CTOR_LIST_END CTOR_LIST_BEGIN
109
110#define TARGET_ASM_CONSTRUCTOR  ix86_svr3_asm_out_constructor
111