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.
5 This file is part of GNU CC.
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)
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.
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. */
23 /* Define default target values. */
25 #ifndef TARGET_ENDIAN_DEFAULT
26 #define TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN
30 #if TARGET_ENDIAN_DEFAULT != 0
31 #define MACHINE_TYPE "NetBSD/mipseb ELF"
33 #define MACHINE_TYPE "NetBSD/mipsel ELF"
37 #define TARGET_DEFAULT (MASK_GAS|MASK_ABICALLS)
40 /* XXX Don't use DWARF-2 debugging info, for now. */
41 #undef DBX_DEBUGGING_INFO
42 #define DBX_DEBUGGING_INFO
43 #undef PREFERRED_DEBUGGING_TYPE
44 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
47 /* Include the generic MIPS ELF configuration. */
50 /* Now clean up after it. */
51 #undef OBJECT_FORMAT_COFF
53 #undef MD_STARTFILE_PREFIX
54 #undef US_SOFTWARE_GOFAST
55 #undef INIT_SUBTARGET_OPTABS
56 #define INIT_SUBTARGET_OPTABS
59 /* Get generic NetBSD definitions. */
63 /* Get generic NetBSD ELF definitions. */
64 #include <netbsd-elf.h>
67 /* Provide CPP predefines appropriate for NetBSD. We default to
71 #if TARGET_ENDIAN_DEFAULT != 0
72 #define CPP_PREDEFINES \
73 "-D__NetBSD__ -D__ELF__ -D__mips__ -D__mips=1 -D__MIPSEB__ \
74 -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ \
75 -Asystem=unix -Asystem=NetBSD -Amachine=mips"
77 #define CPP_PREDEFINES \
78 "-D__NetBSD__ -D__ELF__ -D__mips__ -D__mips=1 -D__MIPSEL__ \
79 -D__NO_LEADING_UNDERSCORES__ -D__GP_SUPPORT__ \
80 -Asystem=unix -Asystem=NetBSD -Amachine=mips"
84 /* Provide a CPP_SPEC appropriate for NetBSD. This is a simplified
85 CPP_SPEC from <mips/mips.h>. We use the SUBTARGET_CPP_SPEC to
86 deal with NetBSD-specific CPP options. */
90 "%(subtarget_cpp_size_spec) \
91 %{mips3:-U__mips -D__mips=3 -D__mips64} \
92 %{mips4:-U__mips -D__mips=4 -D__mips64} \
93 %{mips32:-U__mips -D__mips=32} \
94 %{mips64:-U__mips -D__mips=64 -D__mips64} \
95 %{mgp32:-U__mips64} %{mgp64:-D__mips64} \
96 %{mfp32:-D__mips_fpr=32} %{mfp64:-D__mips_fpr=64} \
99 %{mgp32:-D__mips_fpr=32} \
100 %{!mgp32: %(cpp_fpr_spec)}}} \
102 %{!msoft-float:-D__mips_single_float}} \
104 %{!msoft-float:-D__mips_single_float}} \
105 %{msoft-float:-D__mips_soft_float} \
106 %{mabi=eabi:-D__mips_eabi} \
107 %{mips16:%{!mno-mips16:-D__mips16}} \
108 %{EB:-U__MIPSEL__ -D__MIPSEB__} \
109 %{EL:-U__MIPSEB__ -D__MIPSEL__} \
110 %(subtarget_cpp_spec) "
113 /* Provide a SUBTARGET_CPP_SIZE_SPEC appropriate for NetBSD. In
114 addition to the normal work done by this spec, we also define
115 __LONG64 or not (so that <machine/ansi.h> can tell). */
117 #undef SUBTARGET_CPP_SIZE_SPEC
118 #define SUBTARGET_CPP_SIZE_SPEC \
122 %{!mips32:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int -D__LONG64}}}} \
123 %{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int -U__LONG64}"
126 /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. Currently,
127 we just deal with the GCC option '-posix'. */
129 #undef SUBTARGET_CPP_SPEC
130 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
133 /* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
134 This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
139 "%{assert*} %{R*} %{rpath*} \
143 %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \
144 %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \
150 %{!e*:-e __start}}} \
152 %{rdynamic:-export-dynamic} \
153 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
157 #undef SUBTARGET_ASM_SPEC
158 #define SUBTARGET_ASM_SPEC \
159 "%{fpic:-KPIC} %{fPIC:-KPIC}"
162 /* -G is incompatible with -KPIC which is the default, so only allow objects
163 in the small data section if the user explicitly asks for it. */
165 #undef MIPS_DEFAULT_GVALUE
166 #define MIPS_DEFAULT_GVALUE 0
169 /* This defines which switch letters take arguments. -G is a MIPS
172 #undef SWITCH_TAKES_ARG
173 #define SWITCH_TAKES_ARG(CHAR) \
174 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
179 #undef ASM_FINAL_SPEC
183 /* Make gcc agree with <machine/ansi.h> */
186 #define WCHAR_TYPE "int"
188 #undef WCHAR_UNSIGNED
189 #define WCHAR_UNSIGNED 0
191 #undef WCHAR_TYPE_SIZE
192 #define WCHAR_TYPE_SIZE 32
195 #define WINT_TYPE "int"