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)
39 #define TARGET_OS_CPP_BUILTINS() \
42 NETBSD_OS_CPP_BUILTINS_ELF(); \
43 builtin_define ("__NO_LEADING_UNDERSCORES__"); \
44 builtin_define ("__GP_SUPPORT__"); \
45 builtin_assert ("machine=mips"); \
47 builtin_define ("__LONG64"); \
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
59 /* Include the generic MIPS ELF configuration. */
62 /* Now clean up after it. */
63 #undef OBJECT_FORMAT_COFF
65 #undef MD_STARTFILE_PREFIX
66 #undef US_SOFTWARE_GOFAST
67 #undef INIT_SUBTARGET_OPTABS
68 #define INIT_SUBTARGET_OPTABS
71 /* Get generic NetBSD definitions. */
75 /* Get generic NetBSD ELF definitions. */
76 #include <netbsd-elf.h>
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 },
87 #if TARGET_ENDIAN_DEFAULT != 0
88 #define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEB__"
90 #define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEL__"
93 /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. */
95 #undef SUBTARGET_CPP_SPEC
96 #define SUBTARGET_CPP_SPEC "%(netbsd_cpp_spec)"
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
104 "%{EL:-m elf32lmip} \
107 %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \
108 %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \
111 #define NETBSD_ENTRY_POINT "__start"
113 #undef SUBTARGET_ASM_SPEC
114 #define SUBTARGET_ASM_SPEC \
115 "%{fpic:-KPIC} %{fPIC:-KPIC}"
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. */
121 #undef MIPS_DEFAULT_GVALUE
122 #define MIPS_DEFAULT_GVALUE 0
125 /* This defines which switch letters take arguments. -G is a MIPS
128 #undef SWITCH_TAKES_ARG
129 #define SWITCH_TAKES_ARG(CHAR) \
130 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
135 #undef ASM_FINAL_SPEC
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"
145 /* Make gcc agree with <machine/ansi.h> */
148 #define WCHAR_TYPE "int"
150 #undef WCHAR_TYPE_SIZE
151 #define WCHAR_TYPE_SIZE 32
154 #define WINT_TYPE "int"