Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / config / mips / openbsd.h
blob5b27e07be8704ffbe4794b2d058a0a23bb574862
1 /* Configuration for a Mips ABI32 OpenBSD target.
2 Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */
23 /* GAS must know this. */
24 #undef SUBTARGET_ASM_SPEC
25 #define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
27 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
29 /* CPP specific OpenBSD specs. */
30 #undef SUBTARGET_CPP_SPEC
31 #define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
33 /* Needed for ELF (inspired by netbsd-elf). */
34 #undef LOCAL_LABEL_PREFIX
35 #define LOCAL_LABEL_PREFIX "."
37 /* The profiling lib spec here is not really correct but we leave
38 it as it is until we have some kind of profiling working. */
39 #define LIB_SPEC OBSD_LIB_SPEC
41 /* mips assembler uses .set for arcane purposes. __attribute__((alias))
42 and friends won't work until we get recent binutils with .weakext
43 support. */
44 #undef SET_ASM_OP
46 #define TARGET_OS_CPP_BUILTINS() \
47 do { \
48 builtin_define ("__unix__"); \
49 builtin_define ("__SYSTYPE_BSD__"); \
50 builtin_define ("__NO_LEADING_UNDERSCORES__"); \
51 builtin_define ("__GP_SUPPORT__"); \
52 builtin_define ("__OpenBSD__"); \
53 builtin_assert ("system=unix"); \
54 builtin_assert ("system=OpenBSD"); \
55 } while (0)
57 /* Layout of source language data types. */
59 /* This must agree with <machine/ansi.h>. */
60 #undef SIZE_TYPE
61 #define SIZE_TYPE "unsigned int"
63 #undef PTRDIFF_TYPE
64 #define PTRDIFF_TYPE "int"
66 #undef WCHAR_TYPE
67 #define WCHAR_TYPE "int"
69 #undef WCHAR_TYPE_SIZE
70 #define WCHAR_TYPE_SIZE 32
72 /* Controlling the compilation driver. */
74 /* LINK_SPEC appropriate for OpenBSD: support for GCC options
75 -static, -assert, and -nostdlib. Dynamic loader control. */
76 #undef LINK_SPEC
77 #define LINK_SPEC \
78 "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
79 %{bestGnum} %{shared} %{non_shared} \
80 %{call_shared} %{no_archive} %{exact_version} \
81 %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
82 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
83 %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
84 %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
86 /* -G is incompatible with -KPIC which is the default, so only allow objects
87 in the small data section if the user explicitly asks for it. */
88 #undef MIPS_DEFAULT_GVALUE
89 #define MIPS_DEFAULT_GVALUE 0
92 /* Since gas and gld are standard on OpenBSD, we don't need these. */
93 #undef ASM_FINAL_SPEC
94 #undef STARTFILE_SPEC
96 /* Switch into a generic section. */
97 #undef TARGET_ASM_NAMED_SECTION
98 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section