OSDN Git Service

2004-12-08 Eric Christopher <echristo@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / openbsd.h
1 /* Configuration for  a Mips ABI32 OpenBSD target.
2    Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
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.
10
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.
15
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.  */
20
21 /* Definitions needed for OpenBSD, to avoid picking mips 'defaults'.  */
22
23 /* GAS must know this.  */
24 #undef SUBTARGET_ASM_SPEC
25 #define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
26
27 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
28
29 /* CPP specific OpenBSD specs.  */
30 #undef SUBTARGET_CPP_SPEC
31 #define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
32
33 /* Needed for ELF (inspired by netbsd-elf).  */
34 #undef LOCAL_LABEL_PREFIX
35 #define LOCAL_LABEL_PREFIX      "."
36
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
40
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
45
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         builtin_assert ("machine=mips");                        \
56 } while (0)
57
58 /* Layout of source language data types.  */
59
60 /* This must agree with <machine/ansi.h>.  */
61 #undef SIZE_TYPE
62 #define SIZE_TYPE "unsigned int"
63
64 #undef PTRDIFF_TYPE
65 #define PTRDIFF_TYPE "int"
66
67 #undef WCHAR_TYPE
68 #define WCHAR_TYPE "int"
69
70 #undef WCHAR_TYPE_SIZE
71 #define WCHAR_TYPE_SIZE 32
72
73 /* Controlling the compilation driver.  */
74
75 /* LINK_SPEC appropriate for OpenBSD:  support for GCC options
76    -static, -assert, and -nostdlib. Dynamic loader control.  */
77 #undef LINK_SPEC
78 #define LINK_SPEC \
79   "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
80    %{bestGnum} %{shared} %{non_shared} \
81    %{call_shared} %{no_archive} %{exact_version} \
82    %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
83    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
84    %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
85    %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
86
87 /* -G is incompatible with -KPIC which is the default, so only allow objects
88    in the small data section if the user explicitly asks for it.  */
89 #undef MIPS_DEFAULT_GVALUE
90 #define MIPS_DEFAULT_GVALUE 0
91
92
93 /* Since gas and gld are standard on OpenBSD, we don't need these.  */
94 #undef ASM_FINAL_SPEC
95 #undef STARTFILE_SPEC
96
97 /* Switch into a generic section.  */
98 #undef TARGET_ASM_NAMED_SECTION
99 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section