OSDN Git Service

2002-06-11 Eric Christopher <echristo@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / netbsd.h
1 /* Definitions of target machine for GNU compiler, for MIPS NetBSD systems.
2    Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 /* Define default target values. */
24
25 #ifndef TARGET_ENDIAN_DEFAULT
26 #define TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN
27 #endif
28
29 #ifndef MACHINE_TYPE
30 #if TARGET_ENDIAN_DEFAULT != 0
31 #define MACHINE_TYPE "NetBSD/mipseb ELF"
32 #else
33 #define MACHINE_TYPE "NetBSD/mipsel ELF"
34 #endif
35 #endif
36
37 #define TARGET_DEFAULT (MASK_GAS|MASK_ABICALLS)
38
39 #define TARGET_OS_CPP_BUILTINS()                        \
40   do                                                    \
41     {                                                   \
42       NETBSD_OS_CPP_BUILTINS_ELF();                     \
43       builtin_define ("__NO_LEADING_UNDERSCORES__");    \
44       builtin_define ("__GP_SUPPORT__");                \
45       builtin_assert ("machine=mips");                  \
46       if (TARGET_LONG64)                                \
47         builtin_define ("__LONG64");                    \
48     }                                                   \
49   while (0)
50
51
52 /* XXX Don't use DWARF-2 debugging info, for now.  */
53 #undef DBX_DEBUGGING_INFO
54 #define DBX_DEBUGGING_INFO
55 #undef PREFERRED_DEBUGGING_TYPE
56 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
57
58
59 /* Include the generic MIPS ELF configuration.  */
60 #include <mips/elf.h>
61
62 /* Now clean up after it.  */
63 #undef OBJECT_FORMAT_COFF
64 #undef MD_EXEC_PREFIX
65 #undef MD_STARTFILE_PREFIX
66 #undef US_SOFTWARE_GOFAST
67 #undef INIT_SUBTARGET_OPTABS
68 #define INIT_SUBTARGET_OPTABS
69
70
71 /* Get generic NetBSD definitions.  */
72 #include <netbsd.h>
73
74
75 /* Get generic NetBSD ELF definitions.  */
76 #include <netbsd-elf.h>
77
78
79 /* Extra specs we need.  */
80 #undef SUBTARGET_EXTRA_SPECS
81 #define SUBTARGET_EXTRA_SPECS                                           \
82   { "subtarget_endian_default", SUBTARGET_ENDIAN_DEFAULT_SPEC },        \
83   { "netbsd_cpp_spec",          NETBSD_CPP_SPEC },                      \
84   { "netbsd_link_spec",         NETBSD_LINK_SPEC_ELF },                 \
85   { "netbsd_entry_point",       NETBSD_ENTRY_POINT },
86
87 #if TARGET_ENDIAN_DEFAULT != 0
88 #define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEB__"
89 #else
90 #define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEL__"
91 #endif
92
93 /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD.  */
94
95 #undef SUBTARGET_CPP_SPEC
96 #define SUBTARGET_CPP_SPEC "%(netbsd_cpp_spec)"
97
98 /* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
99    This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
100    the MIPS target.  */
101
102 #undef LINK_SPEC
103 #define LINK_SPEC \
104   "%{EL:-m elf32lmip} \
105    %{EB:-m elf32bmip} \
106    %(endian_spec) \
107    %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \
108    %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \
109    %(netbsd_link_spec)"
110
111 #define NETBSD_ENTRY_POINT "__start"
112
113 #undef SUBTARGET_ASM_SPEC
114 #define SUBTARGET_ASM_SPEC                                              \
115   "%{fpic:-KPIC} %{fPIC:-KPIC}"
116
117
118 /* -G is incompatible with -KPIC which is the default, so only allow objects
119    in the small data section if the user explicitly asks for it.  */
120
121 #undef MIPS_DEFAULT_GVALUE
122 #define MIPS_DEFAULT_GVALUE 0
123
124
125 /* This defines which switch letters take arguments.  -G is a MIPS
126    special.  */
127
128 #undef SWITCH_TAKES_ARG
129 #define SWITCH_TAKES_ARG(CHAR)                                          \
130   (DEFAULT_SWITCH_TAKES_ARG (CHAR)                                      \
131    || (CHAR) == 'R'                                                     \
132    || (CHAR) == 'G')
133
134
135 #undef ASM_FINAL_SPEC
136 #undef SET_ASM_OP
137
138
139 /* NetBSD hasn't historically provided _flush_cache(), but rather
140    _cacheflush(), which takes the same arguments as the former.  */
141 #undef CACHE_FLUSH_FUNC
142 #define CACHE_FLUSH_FUNC "_cacheflush"
143
144
145 /* Make gcc agree with <machine/ansi.h> */
146
147 #undef WCHAR_TYPE
148 #define WCHAR_TYPE "int"
149
150 #undef WCHAR_TYPE_SIZE
151 #define WCHAR_TYPE_SIZE 32
152
153 #undef WINT_TYPE
154 #define WINT_TYPE "int"