1 /* Configuration for a MIPS ABI32 OpenBSD target.
2 Copyright (C) 1999, 2003, 2004, 2007, 2008, 2009, 2010, 2011
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
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 /* CPP specific OpenBSD specs. */
28 #undef SUBTARGET_CPP_SPEC
29 #define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
31 /* Needed for ELF (inspired by netbsd-elf). */
32 #undef LOCAL_LABEL_PREFIX
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 /* mips assembler uses .set for arcane purposes. __attribute__((alias))
40 and friends won't work until we get recent binutils with .weakext
44 #define TARGET_OS_CPP_BUILTINS() \
46 builtin_define ("__unix__"); \
47 builtin_define ("__SYSTYPE_BSD__"); \
48 builtin_define ("__NO_LEADING_UNDERSCORES__"); \
49 builtin_define ("__GP_SUPPORT__"); \
50 builtin_define ("__OpenBSD__"); \
51 builtin_assert ("system=unix"); \
52 builtin_assert ("system=OpenBSD"); \
55 /* Layout of source language data types. */
57 /* This must agree with <machine/ansi.h>. */
59 #define SIZE_TYPE "long unsigned int"
62 #define PTRDIFF_TYPE "long int"
65 #define WCHAR_TYPE "int"
67 #undef WCHAR_TYPE_SIZE
68 #define WCHAR_TYPE_SIZE 32
71 #define WINT_TYPE "int"
73 /* Controlling the compilation driver. */
75 /* LINK_SPEC appropriate for OpenBSD: support for GCC options
76 -static, -assert, and -nostdlib. Dynamic loader control. */
79 "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
81 %{!shared: -non_shared} \
82 -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. */
96 /* Switch into a generic section. */
97 #undef TARGET_ASM_NAMED_SECTION
98 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
100 /* MIPS specific debugging info */
101 #define MIPS_DEBUGGING_INFO 1