FSF GCC merge 02/23/03
[official-gcc.git] / gcc / config / mips / openbsd.h
blob73a81926be4879801b00c8136aaabb7ecfdbdc77
1 /* Configuration for a Mips ABI32 OpenBSD target.
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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.
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.
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. */
21 /* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */
23 /* GAS must know this. */
24 #define SUBTARGET_ASM_SPEC "%{fPIC:-KPIC}"
26 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
28 /* CPP specific OpenBSD specs. */
29 #define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
31 /* Needed for ELF (inspired by netbsd-elf). */
32 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
33 #define LOCAL_LABEL_PREFIX "."
35 /* The profiling lib spec here is not really correct but we leave
36 it as it is until we have some kind of profiling working. */
37 #define LIB_SPEC OBSD_LIB_SPEC
39 /* By default, OpenBSD mips is little endian. This is important to set
40 here as mips/mips.h defaults to big endian. */
41 #ifndef TARGET_ENDIAN_DEFAULT
42 #define TARGET_ENDIAN_DEFAULT 0
43 #endif
45 #include <mips/mips.h>
47 /* Get generic OpenBSD definitions. */
48 #define OBSD_HAS_DECLARE_FUNCTION_NAME
49 #define OBSD_HAS_DECLARE_OBJECT
50 #define OBSD_HAS_CORRECT_SPECS
51 #include <openbsd.h>
53 /* mips assembler uses .set for arcane purposes. __attribute__((alias))
54 and friends won't work until we get recent binutils with .weakext
55 support. */
56 #undef SET_ASM_OP
58 #define TARGET_OS_CPP_BUILTINS() \
59 do { \
60 builtin_define ("__unix__"); \
61 builtin_define ("__SYSTYPE_BSD__"); \
62 builtin_define ("__NO_LEADING_UNDERSCORES__"); \
63 builtin_define ("__GP_SUPPORT__"); \
64 builtin_define ("__OpenBSD__"); \
65 builtin_assert ("system=unix"); \
66 builtin_assert ("system=OpenBSD"); \
67 builtin_assert ("machine=mips"); \
68 } while (0)
70 /* Layout of source language data types. */
72 /* This must agree with <machine/ansi.h>. */
73 #undef SIZE_TYPE
74 #define SIZE_TYPE "unsigned int"
76 #undef PTRDIFF_TYPE
77 #define PTRDIFF_TYPE "int"
79 #undef WCHAR_TYPE
80 #define WCHAR_TYPE "int"
82 #undef WCHAR_TYPE_SIZE
83 #define WCHAR_TYPE_SIZE 32
85 /* Controlling the compilation driver. */
87 /* LINK_SPEC appropriate for OpenBSD: support for GCC options
88 -static, -assert, and -nostdlib. Dynamic loader control. */
89 #undef LINK_SPEC
90 #define LINK_SPEC \
91 "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
92 %{bestGnum} %{shared} %{non_shared} \
93 %{call_shared} %{no_archive} %{exact_version} \
94 %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
95 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
96 %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
97 %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
99 /* -G is incompatible with -KPIC which is the default, so only allow objects
100 in the small data section if the user explicitly asks for it. */
101 #undef MIPS_DEFAULT_GVALUE
102 #define MIPS_DEFAULT_GVALUE 0
105 /* Since gas and gld are standard on OpenBSD, we don't need these. */
106 #undef ASM_FINAL_SPEC
107 #undef STARTFILE_SPEC
109 /* Switch into a generic section. */
110 #undef TARGET_ASM_NAMED_SECTION
111 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
113 /* Not having TARGET_GAS here seems a mistake. If we actually need to
114 be prepared for file switching, then we need a custom
115 TARGET_ASM_NAMED_SECTION too. */
117 #undef TEXT_SECTION
118 #define TEXT_SECTION() \
119 do { \
120 if (TARGET_FILE_SWITCHING) \
121 abort (); \
122 fputs (TEXT_SECTION_ASM_OP, asm_out_file); \
123 fputc ('\n', asm_out_file); \
124 } while (0)
126 /* collect2 support (Macros for initialization). */
128 /* Mips default configuration is COFF-only, and confuses collect2. */
129 #undef OBJECT_FORMAT_COFF
130 #undef EXTENDED_COFF