c7762609a960826faef2659be3fbea30c6efcc07
[dragonfly.git] / gnu / usr.bin / cc44 / cc_prep / config / i386 / dragonfly.h
1 /* Definitions for Intel 386 running FreeBSD with ELF format
2    Copyright (C) 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
3    Contributed by Eric Youngdale.
4    Modified for stabs-in-ELF by H.J. Lu.
5    Adapted from GNU/Linux version by John Polstra.
6    Continued development by David O'Brien <obrien@freebsd.org>
7    Adapted from the FreeBSD version.
8
9
10 This file is part of GCC.
11
12 GCC is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3, or (at your option)
15 any later version.
16
17 GCC is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with GCC; see the file COPYING3.  If not see
24 <http://www.gnu.org/licenses/>.  */
25
26
27 #define TARGET_VERSION fprintf (stderr, " (i386 DragonFly/ELF)");
28
29 /* Override the default comment-starter of "/".  */
30 #undef  ASM_COMMENT_START
31 #define ASM_COMMENT_START "#"
32
33 #undef  ASM_APP_ON
34 #define ASM_APP_ON "#APP\n"
35
36 #undef  ASM_APP_OFF
37 #define ASM_APP_OFF "#NO_APP\n"
38
39 #undef  DBX_REGISTER_NUMBER
40 #define DBX_REGISTER_NUMBER(n) \
41   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
42
43 #undef  NO_PROFILE_COUNTERS
44 #define NO_PROFILE_COUNTERS     1
45
46 /* Tell final.c that we don't need a label passed to mcount.  */
47
48 #undef  MCOUNT_NAME
49 #define MCOUNT_NAME ".mcount"
50
51 /* Make gcc agree with <machine/ansi.h>.  */
52
53 #undef  SIZE_TYPE
54 #define SIZE_TYPE       (TARGET_64BIT ? "long unsigned int" : "unsigned int")
55  
56 #undef  PTRDIFF_TYPE
57 #define PTRDIFF_TYPE    "long int"
58   
59 #undef  WCHAR_TYPE_SIZE
60 #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
61
62 #undef  SUBTARGET_EXTRA_SPECS   /* i386.h bogusly defines it.  */
63 #define SUBTARGET_EXTRA_SPECS \
64   { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
65     
66 #undef  STARTFILE_SPEC
67 #define STARTFILE_SPEC DFBSD_STARTFILE_SPEC
68
69 #undef  ENDFILE_SPEC
70 #define ENDFILE_SPEC DFBSD_ENDFILE_SPEC
71
72 /* Provide a LINK_SPEC appropriate for DragonFly.  Here we provide support
73    for the special GCC options -static and -shared, which allow us to
74    link things in one of these three modes by applying the appropriate
75    combinations of options at link-time. We like to support here for
76    as many of the other GNU linker options as possible. But I don't
77    have the time to search for those flags. I am sure how to add
78    support for -soname shared_object_name. H.J.
79
80    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
81    -Wl,-V.
82
83    When the -shared link option is used a final link is not being
84    done.  */
85
86 #undef  LINK_SPEC
87 #define LINK_SPEC "\
88   %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
89   %{v:-V} \
90   %{assert*} %{R*} %{rpath*} %{defsym*} \
91   %{shared:-Bshareable %{h*} %{soname*}} \
92     %{!shared: \
93       %{!static: \
94         %{rdynamic:-export-dynamic} \
95         %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
96     %{static:-Bstatic}} \
97   %{symbolic:-Bsymbolic}" \
98   DFBSD_NATIVE_LINK_SPEC
99
100 /* A C statement to output to the stdio stream FILE an assembler
101    command to advance the location counter to a multiple of 1<<LOG
102    bytes if it is within MAX_SKIP bytes.
103
104    This is used to align code labels according to Intel recommendations.  */
105
106 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
107 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
108 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                  \
109   if ((LOG) != 0) {                                                                                                             \
110     if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));    \
111     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
112   }
113 #endif
114
115 /* Don't default to pcc-struct-return, we want to retain compatibility with
116    older gcc versions AND pcc-struct-return is nonreentrant.
117    (even though the SVR4 ABI for the i386 says that records and unions are
118    returned in memory).  */
119
120 #undef  DEFAULT_PCC_STRUCT_RETURN
121 #define DEFAULT_PCC_STRUCT_RETURN 0
122
123 /* DragonFly sets the rounding precision of the FPU to 53 bits.  Let the
124    compiler get the contents of <float.h> and std::numeric_limits correct.  */
125 #undef TARGET_96_ROUND_53_LONG_DOUBLE
126 #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)