-/* Configuration for a Mips ABI32 OpenBSD target.
- Copyright (C) 1999 Free Software Foundation, Inc.
+/* Configuration for a MIPS ABI32 OpenBSD target.
+ Copyright (C) 1999, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */
/* GAS must know this. */
-#define SUBTARGET_ASM_SPEC "%{fPIC:-KPIC} %|"
+#undef SUBTARGET_ASM_SPEC
+#define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
/* CPP specific OpenBSD specs. */
+#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
/* Needed for ELF (inspired by netbsd-elf). */
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
/* The profiling lib spec here is not really correct but we leave
it as it is until we have some kind of profiling working. */
#define LIB_SPEC OBSD_LIB_SPEC
-/* By default, OpenBSD mips is little endian. This is important to set
- here as mips/mips.h defaults to big endian unless DECSTATION. */
-#ifndef TARGET_ENDIAN_DEFAULT
-#define TARGET_ENDIAN_DEFAULT 0
-#endif
-
-#include <mips/mips.h>
-
-/* Get generic OpenBSD definitions. */
-#define OBSD_HAS_DECLARE_FUNCTION_NAME
-#define OBSD_HAS_DECLARE_OBJECT
-#define OBSD_HAS_CORRECT_SPECS
-#include <openbsd.h>
-
/* mips assembler uses .set for arcane purposes. __attribute__((alias))
and friends won't work until we get recent binutils with .weakext
support. */
#undef SET_ASM_OP
-/* Run-time target specifications. */
-#if TARGET_ENDIAN_DEFAULT != 0
-#define CPP_PREDEFINES "-D__SYSTYPE_BSD__ -D__NO_LEADING_UNDERSCORES__ \
--D__GP_SUPPORT__ -D__MIPSEB__ -D__unix__ -D__OpenBSD__ -D__mips__ \
--Asystem=unix -Asystem=OpenBSD -Acpu=mips -Amachine=mips -Aendian=big"
-#else
-#define CPP_PREDEFINES "-D__SYSTYPE_BSD__ -D__NO_LEADING_UNDERSCORES__ \
--D__GP_SUPPORT__ -D__MIPSEL__ -D__unix__ -D__OpenBSD__ -D__mips__ \
--Asystem=unix -Asystem=OpenBSD -Acpu=mips -Amachine=mips -Aendian=little"
-#endif
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__unix__"); \
+ builtin_define ("__SYSTYPE_BSD__"); \
+ builtin_define ("__NO_LEADING_UNDERSCORES__"); \
+ builtin_define ("__GP_SUPPORT__"); \
+ builtin_define ("__OpenBSD__"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=OpenBSD"); \
+} while (0)
/* Layout of source language data types. */
/* Controlling the compilation driver. */
-/* LINK_SPEC appropriate for OpenBSD: support for GCC options
+/* LINK_SPEC appropriate for OpenBSD: support for GCC options
-static, -assert, and -nostdlib. Dynamic loader control. */
#undef LINK_SPEC
#define LINK_SPEC \
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
-/* Not having TARGET_GAS here seems a mistake. If we actually need to
- be prepared for file switching, then we need a custom
- TARGET_ASM_NAMED_SECTION too. */
-
-#undef TEXT_SECTION
-#define TEXT_SECTION() \
-do { \
- if (TARGET_FILE_SWITCHING) \
- abort (); \
- fputs (TEXT_SECTION_ASM_OP, asm_out_file); \
- fputc ('\n', asm_out_file); \
-} while (0)
-
-/* collect2 support (Macros for initialization). */
-
-/* Mips default configuration is COFF-only, and confuses collect2. */
-#undef OBJECT_FORMAT_COFF
-#undef EXTENDED_COFF
+/* MIPS specific debugging info */
+#define MIPS_DEBUGGING_INFO 1