]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/freebsd.h
gcc.c (trad_capable_cpp, [...]): Don't handle -ftraditional.
[thirdparty/gcc.git] / gcc / config / i386 / freebsd.h
CommitLineData
41e5a1f5 1/* Definitions for Intel 386 running FreeBSD with ELF format
d8a07487
JM
2 Copyright (C) 1996, 2000, 2002, 2004, 2007, 2010
3 Free Software Foundation, Inc.
41e5a1f5
DB
4 Contributed by Eric Youngdale.
5 Modified for stabs-in-ELF by H.J. Lu.
6 Adapted from GNU/Linux version by John Polstra.
7 Continued development by David O'Brien <obrien@freebsd.org>
0e3ce1df 8
e20285ad 9This file is part of GCC.
0e3ce1df 10
e20285ad 11GCC is free software; you can redistribute it and/or modify
0e3ce1df 12it under the terms of the GNU General Public License as published by
2f83c7d6 13the Free Software Foundation; either version 3, or (at your option)
0e3ce1df
RK
14any later version.
15
e20285ad 16GCC is distributed in the hope that it will be useful,
0e3ce1df
RK
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
2f83c7d6
NC
22along with GCC; see the file COPYING3. If not see
23<http://www.gnu.org/licenses/>. */
0e3ce1df 24
39ed301b 25
41e5a1f5 26#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
0e3ce1df 27
6981eacf 28/* Override the default comment-starter of "/". */
8634e925 29#undef ASM_COMMENT_START
6981eacf
JL
30#define ASM_COMMENT_START "#"
31
8634e925 32#undef ASM_APP_ON
0e3ce1df
RK
33#define ASM_APP_ON "#APP\n"
34
8634e925 35#undef ASM_APP_OFF
0e3ce1df 36#define ASM_APP_OFF "#NO_APP\n"
56f28b73 37
8634e925 38#undef DBX_REGISTER_NUMBER
0f7fa3d0
JH
39#define DBX_REGISTER_NUMBER(n) \
40 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
41e5a1f5 41
618ec0d7 42#undef NO_PROFILE_COUNTERS
9739c90c 43#define NO_PROFILE_COUNTERS 1
618ec0d7 44
41e5a1f5 45/* Tell final.c that we don't need a label passed to mcount. */
0e3ce1df 46
8634e925 47#undef MCOUNT_NAME
a5fa1ecd 48#define MCOUNT_NAME ".mcount"
0e3ce1df 49
41e5a1f5 50/* Make gcc agree with <machine/ansi.h>. */
0e3ce1df 51
8634e925 52#undef SIZE_TYPE
04b379ba 53#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
41e5a1f5 54
8634e925 55#undef PTRDIFF_TYPE
04b379ba 56#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
41e5a1f5 57
8634e925 58#undef WCHAR_TYPE_SIZE
04b379ba 59#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
2de2f846
DB
60
61#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */
62#define SUBTARGET_EXTRA_SPECS \
63 { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
41e5a1f5 64
41e5a1f5
DB
65/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
66 the magical crtbegin.o file (see crtstuff.c) which provides part
67 of the support for getting C++ file-scope static object constructed
892a2d68 68 before entering `main'. */
41e5a1f5
DB
69
70#undef STARTFILE_SPEC
71#define STARTFILE_SPEC \
72 "%{!shared: \
73 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
74 %{!p:%{profile:gcrt1.o%s} \
75 %{!profile:crt1.o%s}}}} \
76 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
77
78/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
79 the magical crtend.o file (see crtstuff.c) which provides part of
80 the support for getting C++ file-scope static object constructed
81 before entering `main', followed by a normal "finalizer" file,
82 `crtn.o'. */
83
84#undef ENDFILE_SPEC
85#define ENDFILE_SPEC \
86 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
87
88/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
89 for the special GCC options -static and -shared, which allow us to
90 link things in one of these three modes by applying the appropriate
91 combinations of options at link-time. We like to support here for
92 as many of the other GNU linker options as possible. But I don't
93 have the time to search for those flags. I am sure how to add
94 support for -soname shared_object_name. H.J.
95
96 I took out %{v:%{!V:-V}}. It is too much :-(. They can use
97 -Wl,-V.
98
99 When the -shared link option is used a final link is not being
100 done. */
101
102#undef LINK_SPEC
54e20385 103#define LINK_SPEC "\
d8a07487 104 %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
41e5a1f5
DB
105 %{v:-V} \
106 %{assert*} %{R*} %{rpath*} %{defsym*} \
107 %{shared:-Bshareable %{h*} %{soname*}} \
108 %{!shared: \
109 %{!static: \
110 %{rdynamic:-export-dynamic} \
2de2f846 111 %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
41e5a1f5
DB
112 %{static:-Bstatic}} \
113 %{symbolic:-Bsymbolic}"
114
115/* A C statement to output to the stdio stream FILE an assembler
116 command to advance the location counter to a multiple of 1<<LOG
117 bytes if it is within MAX_SKIP bytes.
118
119 This is used to align code labels according to Intel recommendations. */
120
121#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
9e68a9dc 122#undef ASM_OUTPUT_MAX_SKIP_ALIGN
41e5a1f5
DB
123#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
124 if ((LOG) != 0) { \
125 if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
126 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
127 }
0e3ce1df 128#endif
d360fd18
DB
129
130/* Don't default to pcc-struct-return, we want to retain compatibility with
131 older gcc versions AND pcc-struct-return is nonreentrant.
132 (even though the SVR4 ABI for the i386 says that records and unions are
133 returned in memory). */
134
135#undef DEFAULT_PCC_STRUCT_RETURN
136#define DEFAULT_PCC_STRUCT_RETURN 0
bfa0c519
RH
137
138/* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the
139 compiler get the contents of <float.h> and std::numeric_limits correct. */
cc69336f
RH
140#undef TARGET_96_ROUND_53_LONG_DOUBLE
141#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
2de710b9 142
282ac51f
UB
143/* Put all *tf routines in libgcc. */
144#undef LIBGCC2_HAS_TF_MODE
145#define LIBGCC2_HAS_TF_MODE 1
146#define LIBGCC2_TF_CEXT q
147#define TF_SIZE 113
148
2de710b9
EB
149/* Static stack checking is supported by means of probes. */
150#define STACK_CHECK_STATIC_BUILTIN 1
f52a39cd
TC
151
152/* Support for i386 has been removed from FreeBSD 6.0 onward. */
153#if FBSD_MAJOR >= 6
154#define SUBTARGET32_DEFAULT_CPU "i486"
155#endif