78b7e0c1d5a061f7a9a130e13c8043e0ee762891
[pkgsrc.git] / wip / gcc44 / files / i386-dragonfly.h
1 /* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/i386/dragonfly.h,v 1.1 2006/09/27 12:10:34 corecode 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       (TARGET_64BIT ? "long unsigned int" : "unsigned int")
61  
62 #undef  PTRDIFF_TYPE
63 #define PTRDIFF_TYPE    (TARGET_64BIT ? "long int" : "int")
64   
65 #undef  WCHAR_TYPE_SIZE
66 #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
67
68 #undef  SUBTARGET_EXTRA_SPECS   /* i386.h bogusly defines it.  */
69 #define SUBTARGET_EXTRA_SPECS \
70   { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
71     
72 /* Provide a STARTFILE_SPEC appropriate for DragonFly.  Here we add
73    the magical crtbegin.o file (see crtstuff.c) which provides part 
74         of the support for getting C++ file-scope static object constructed 
75         before entering `main'.  */
76    
77 #undef  STARTFILE_SPEC
78 #define STARTFILE_SPEC \
79   "%{!shared: \
80      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
81                        %{!p:%{profile:gcrt1.o%s} \
82                          %{!profile:crt1.o%s}}}} \
83    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
84
85 /* Provide a ENDFILE_SPEC appropriate for DragonFly.  Here we tack on
86    the magical crtend.o file (see crtstuff.c) which provides part of 
87         the support for getting C++ file-scope static object constructed 
88         before entering `main', followed by a normal "finalizer" file, 
89         `crtn.o'.  */
90
91 #undef  ENDFILE_SPEC
92 #define ENDFILE_SPEC \
93   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
94
95 /* Provide a LINK_SPEC appropriate for DragonFly.  Here we provide support
96    for the special GCC options -static and -shared, which allow us to
97    link things in one of these three modes by applying the appropriate
98    combinations of options at link-time. We like to support here for
99    as many of the other GNU linker options as possible. But I don't
100    have the time to search for those flags. I am sure how to add
101    support for -soname shared_object_name. H.J.
102
103    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
104    -Wl,-V.
105
106    When the -shared link option is used a final link is not being
107    done.  */
108
109 #undef  LINK_SPEC
110 #define LINK_SPEC "\
111   %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
112   %{v:-V} \
113   %{assert*} %{R*} %{rpath*} %{defsym*} \
114   %{shared:-Bshareable %{h*} %{soname*}} \
115     %{!shared: \
116       %{!static: \
117         %{rdynamic:-export-dynamic} \
118         %{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
119     %{static:-Bstatic}} \
120   %{symbolic:-Bsymbolic}"
121
122 /* A C statement to output to the stdio stream FILE an assembler
123    command to advance the location counter to a multiple of 1<<LOG
124    bytes if it is within MAX_SKIP bytes.
125
126    This is used to align code labels according to Intel recommendations.  */
127
128 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
129 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
130 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                  \
131   if ((LOG) != 0) {                                                                                                             \
132     if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));    \
133     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
134   }
135 #endif
136
137 /* Don't default to pcc-struct-return, we want to retain compatibility with
138    older gcc versions AND pcc-struct-return is nonreentrant.
139    (even though the SVR4 ABI for the i386 says that records and unions are
140    returned in memory).  */
141
142 #undef  DEFAULT_PCC_STRUCT_RETURN
143 #define DEFAULT_PCC_STRUCT_RETURN 0
144
145 /* DragonFly sets the rounding precision of the FPU to 53 bits.  Let the
146    compiler get the contents of <float.h> and std::numeric_limits correct.  */
147 #undef TARGET_96_ROUND_53_LONG_DOUBLE
148 #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)