1169689Skan/* Configuration for  a MIPS ABI32 OpenBSD target.
2169689Skan   Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
3169689Skan
4169689SkanThis file is part of GCC.
5169689Skan
6169689SkanGCC is free software; you can redistribute it and/or modify
7169689Skanit under the terms of the GNU General Public License as published by
8169689Skanthe Free Software Foundation; either version 2, or (at your option)
9169689Skanany later version.
10169689Skan
11169689SkanGCC is distributed in the hope that it will be useful,
12169689Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of
13169689SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14169689SkanGNU General Public License for more details.
15169689Skan
16169689SkanYou should have received a copy of the GNU General Public License
17169689Skanalong with GCC; see the file COPYING.  If not, write to
18169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
19169689SkanBoston, MA 02110-1301, USA.  */
20169689Skan
21169689Skan/* Definitions needed for OpenBSD, to avoid picking mips 'defaults'.  */
22169689Skan
23169689Skan/* GAS must know this.  */
24169689Skan#undef SUBTARGET_ASM_SPEC
25169689Skan#define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
26169689Skan
27169689Skan#define AS_NEEDS_DASH_FOR_PIPED_INPUT
28169689Skan
29169689Skan/* CPP specific OpenBSD specs.  */
30169689Skan#undef SUBTARGET_CPP_SPEC
31169689Skan#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
32169689Skan
33169689Skan/* Needed for ELF (inspired by netbsd-elf).  */
34169689Skan#undef LOCAL_LABEL_PREFIX
35169689Skan#define LOCAL_LABEL_PREFIX	"."
36169689Skan
37169689Skan/* The profiling lib spec here is not really correct but we leave
38169689Skan   it as it is until we have some kind of profiling working.  */
39169689Skan#define LIB_SPEC OBSD_LIB_SPEC
40169689Skan
41169689Skan/* mips assembler uses .set for arcane purposes.  __attribute__((alias))
42169689Skan   and friends won't work until we get recent binutils with .weakext
43169689Skan	support.  */
44169689Skan#undef SET_ASM_OP
45169689Skan
46169689Skan#define TARGET_OS_CPP_BUILTINS()			\
47169689Skan    do {						\
48169689Skan	builtin_define ("__unix__");			\
49169689Skan	builtin_define ("__SYSTYPE_BSD__");		\
50169689Skan	builtin_define ("__NO_LEADING_UNDERSCORES__");	\
51169689Skan	builtin_define ("__GP_SUPPORT__");		\
52169689Skan	builtin_define ("__OpenBSD__");			\
53169689Skan	builtin_assert ("system=unix");			\
54169689Skan	builtin_assert ("system=OpenBSD");		\
55169689Skan} while (0)
56169689Skan
57169689Skan/* Layout of source language data types.  */
58169689Skan
59169689Skan/* This must agree with <machine/ansi.h>.  */
60169689Skan#undef SIZE_TYPE
61169689Skan#define SIZE_TYPE "unsigned int"
62169689Skan
63169689Skan#undef PTRDIFF_TYPE
64169689Skan#define PTRDIFF_TYPE "int"
65169689Skan
66169689Skan#undef WCHAR_TYPE
67169689Skan#define WCHAR_TYPE "int"
68169689Skan
69169689Skan#undef WCHAR_TYPE_SIZE
70169689Skan#define WCHAR_TYPE_SIZE 32
71169689Skan
72169689Skan/* Controlling the compilation driver.  */
73169689Skan
74169689Skan/* LINK_SPEC appropriate for OpenBSD:  support for GCC options
75169689Skan   -static, -assert, and -nostdlib. Dynamic loader control.  */
76169689Skan#undef LINK_SPEC
77169689Skan#define LINK_SPEC \
78169689Skan  "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
79169689Skan   %{bestGnum} %{shared} %{non_shared} \
80169689Skan   %{call_shared} %{no_archive} %{exact_version} \
81169689Skan   %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
82169689Skan   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
83169689Skan   %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
84169689Skan   %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
85169689Skan
86169689Skan/* -G is incompatible with -KPIC which is the default, so only allow objects
87169689Skan   in the small data section if the user explicitly asks for it.  */
88169689Skan#undef MIPS_DEFAULT_GVALUE
89169689Skan#define MIPS_DEFAULT_GVALUE 0
90169689Skan
91169689Skan
92169689Skan/* Since gas and gld are standard on OpenBSD, we don't need these.  */
93169689Skan#undef ASM_FINAL_SPEC
94169689Skan#undef STARTFILE_SPEC
95169689Skan
96169689Skan/* Switch into a generic section.  */
97169689Skan#undef TARGET_ASM_NAMED_SECTION
98169689Skan#define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
99