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