OSDN Git Service

6ca833bb3722a3966fc43140812e288fb32b9036
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / openbsd.h
1 /* Configuration for  a Mips ABI32 OpenBSD target.
2    Copyright (C) 1999, 2003 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC 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 GNU CC 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 GNU CC; 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 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
35 #undef LOCAL_LABEL_PREFIX
36 #define LOCAL_LABEL_PREFIX      "."
37
38 /* The profiling lib spec here is not really correct but we leave
39    it as it is until we have some kind of profiling working.  */
40 #define LIB_SPEC OBSD_LIB_SPEC
41
42 /* mips assembler uses .set for arcane purposes.  __attribute__((alias))
43    and friends won't work until we get recent binutils with .weakext
44         support.  */
45 #undef SET_ASM_OP
46
47 #define TARGET_OS_CPP_BUILTINS()                        \
48     do {                                                \
49         builtin_define ("__unix__");                    \
50         builtin_define ("__SYSTYPE_BSD__");             \
51         builtin_define ("__NO_LEADING_UNDERSCORES__");  \
52         builtin_define ("__GP_SUPPORT__");              \
53         builtin_define ("__OpenBSD__");                 \
54         builtin_assert ("system=unix");                 \
55         builtin_assert ("system=OpenBSD");              \
56         builtin_assert ("machine=mips");                        \
57 } while (0)
58
59 /* Layout of source language data types.  */
60
61 /* This must agree with <machine/ansi.h>.  */
62 #undef SIZE_TYPE
63 #define SIZE_TYPE "unsigned int"
64
65 #undef PTRDIFF_TYPE
66 #define PTRDIFF_TYPE "int"
67
68 #undef WCHAR_TYPE
69 #define WCHAR_TYPE "int"
70
71 #undef WCHAR_TYPE_SIZE
72 #define WCHAR_TYPE_SIZE 32
73
74 /* Controlling the compilation driver.  */
75
76 /* LINK_SPEC appropriate for OpenBSD:  support for GCC options
77    -static, -assert, and -nostdlib. Dynamic loader control.  */
78 #undef LINK_SPEC
79 #define LINK_SPEC \
80   "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
81    %{bestGnum} %{shared} %{non_shared} \
82    %{call_shared} %{no_archive} %{exact_version} \
83    %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
84    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
85    %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
86    %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
87
88 /* -G is incompatible with -KPIC which is the default, so only allow objects
89    in the small data section if the user explicitly asks for it.  */
90 #undef MIPS_DEFAULT_GVALUE
91 #define MIPS_DEFAULT_GVALUE 0
92
93
94 /* Since gas and gld are standard on OpenBSD, we don't need these.  */
95 #undef ASM_FINAL_SPEC
96 #undef STARTFILE_SPEC
97
98 /* Switch into a generic section.  */
99 #undef TARGET_ASM_NAMED_SECTION
100 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section