summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-06 09:01:07 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-06 09:01:07 +0000
commit3ff3f39d72a254b38018a7580f24e96e80533f40 (patch)
treef36a1e53258b97c7a35c3debd2b040696860b124 /gnu/usr.bin/gcc
parentf7ee07b974f672013e7cf2b68122db8fd5b75639 (diff)
Add t-openbsd64 to handle some libgcc.a build issues (needed functions)
Change configuration to mips64 with default ABI = N64 (enhanced 64 bit ABI) we also support the older O32 and N32 abi for building boot stuff.
Diffstat (limited to 'gnu/usr.bin/gcc')
-rw-r--r--gnu/usr.bin/gcc/Makefile.bsd-wrapper6
-rw-r--r--gnu/usr.bin/gcc/gcc/config.gcc18
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/openbsd.h104
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/t-openbsd6414
4 files changed, 81 insertions, 61 deletions
diff --git a/gnu/usr.bin/gcc/Makefile.bsd-wrapper b/gnu/usr.bin/gcc/Makefile.bsd-wrapper
index 5890698bcc0..8b385b9ac68 100644
--- a/gnu/usr.bin/gcc/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/gcc/Makefile.bsd-wrapper
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.48 2004/02/27 17:40:15 deraadt Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.49 2004/09/06 09:01:05 pefo Exp $
MAN= gcc.1 cpp.1 gcov.1 protoize.1
MLINKS+= protoize.1 unprotoize.1
@@ -57,10 +57,6 @@ CLEANFILES= .gdbinit */.gdbinit *.info* \
.if ${MACHINE} == "amd64"
M_ARCH= x86_64
-.elif ${MACHINE} == "arc" || ${MACHINE} == "pmax" || ${MACHINE} == "wgrisc"
-M_ARCH= mipsel
-.elif ${MACHINE} == "hkmips" || ${MACHINE} == "sgi"
-M_ARCH= mips
.else
M_ARCH= ${MACHINE_ARCH}
.endif
diff --git a/gnu/usr.bin/gcc/gcc/config.gcc b/gnu/usr.bin/gcc/gcc/config.gcc
index d53f1ea2ab3..57c201d208e 100644
--- a/gnu/usr.bin/gcc/gcc/config.gcc
+++ b/gnu/usr.bin/gcc/gcc/config.gcc
@@ -1928,14 +1928,18 @@ mips*-*-linux*) # Linux MIPS, either endian.
esac
tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux"
;;
-mips*el-*-openbsd*) # mips little endian
+mips*-*-openbsd*)
target_cpu_default="MASK_GAS|MASK_ABICALLS"
- tm_file="${tm_file} exec-stack.h"
- ;;
-mips*-*-openbsd*) # mips big endian
- target_cpu_default="MASK_GAS|MASK_ABICALLS"
- tm_file="mips/openbsd-be.h ${tm_file}"
- tm_file="${tm_file} exec-stack.h"
+ tm_file="elfos.h ${tm_file}"
+ case $machine in
+ mips64*-*)
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64"
+ tmake_file="mips/t-openbsd64"
+ ;;
+ mips*-*)
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
+ ;;
+ esac
;;
mips-*-ecoff* | mipsel-*-ecoff*)
if test x$stabs = xyes; then
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h b/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
index 02a8f224e57..16e45ed2818 100644
--- a/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
+++ b/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
@@ -27,20 +27,25 @@ Boston, MA 02111-1307, USA. */
#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
/* Needed for ELF (inspired by netbsd-elf). */
+#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#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
+#define ASM_FINAL_SPEC ""
+#include <mips/mips.h>
-/* By default, OpenBSD mips is little endian. This is important to set
- here as mips/mips.h defaults to big endian. */
-#ifndef TARGET_ENDIAN_DEFAULT
-#define TARGET_ENDIAN_DEFAULT 0
-#endif
+#undef MDEBUG_ASM_SPEC
+#define MDEBUG_ASM_SPEC ""
-#include <mips/mips.h>
+#include <mips/elf.h>
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+ %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
+ crtbegin%O%s} %{shared:crtbeginS%O%s}"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+#undef LIB_SPEC
+#define LIB_SPEC OBSD_LIB_SPEC
/* Get generic OpenBSD definitions. */
#define OBSD_HAS_DECLARE_FUNCTION_NAME
@@ -53,26 +58,52 @@ Boston, MA 02111-1307, USA. */
support. */
#undef SET_ASM_OP
+#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define ("__unix__"); \
- builtin_define ("__SYSTYPE_BSD__"); \
+ OPENBSD_OS_CPP_BUILTINS_ELF(); \
builtin_define ("__NO_LEADING_UNDERSCORES__"); \
builtin_define ("__GP_SUPPORT__"); \
- builtin_define ("__OpenBSD__"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=OpenBSD"); \
- builtin_assert ("machine=mips"); \
+ builtin_assert ("machine=mips"); \
+ if (TARGET_LONG64) \
+ builtin_define ("__LONG64"); \
+ if (TARGET_64BIT) \
+ OPENBSD_OS_CPP_BUILTINS_LP64(); \
+ if (TARGET_ABICALLS) \
+ builtin_define ("__ABICALLS__"); \
+ if (mips_abi == ABI_EABI) \
+ builtin_define ("__mips_eabi"); \
+ else if (mips_abi == ABI_N32) \
+ builtin_define ("__mips_n32"); \
+ else if (mips_abi == ABI_64) \
+ builtin_define ("__mips_n64"); \
+ else if (mips_abi == ABI_O64) \
+ builtin_define ("__mips_o64"); \
+ /* Needed to make libgcc to build properly */ \
+ if (mips_abi == ABI_N32) \
+ { \
+ builtin_define ("_ABIN32=2"); \
+ builtin_define ("_MIPS_SIM=_ABIN32"); \
+ builtin_define ("_MIPS_SZLONG=32"); \
+ builtin_define ("_MIPS_SZPTR=32"); \
+ } \
+ else if (mips_abi == ABI_64) \
+ { \
+ builtin_define ("_ABI64=3"); \
+ builtin_define ("_MIPS_SIM=_ABI64"); \
+ builtin_define ("_MIPS_SZLONG=64"); \
+ builtin_define ("_MIPS_SZPTR=64"); \
+ } \
+ else \
+ { \
+ builtin_define ("_MIPS_SIM=_MIPS_SIM_ABI32"); \
+ builtin_define ("_MIPS_SZLONG=32"); \
+ builtin_define ("_MIPS_SZPTR=32"); \
+ } \
} while (0)
-/* Layout of source language data types. */
-
-/* This must agree with <machine/ansi.h>. */
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
+/* Layout of source language data types. */
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
@@ -86,7 +117,8 @@ Boston, MA 02111-1307, USA. */
-static, -assert, and -nostdlib. Dynamic loader control. */
#undef LINK_SPEC
#define LINK_SPEC \
- "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
+ "%(endian_spec) \
+ %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} \
%{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
@@ -100,29 +132,3 @@ Boston, MA 02111-1307, USA. */
#define MIPS_DEFAULT_GVALUE 0
-/* Since gas and gld are standard on OpenBSD, we don't need these. */
-#undef ASM_FINAL_SPEC
-#undef STARTFILE_SPEC
-
-/* Switch into a generic section. */
-#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
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/t-openbsd64 b/gnu/usr.bin/gcc/gcc/config/mips/t-openbsd64
new file mode 100644
index 00000000000..3a77684186e
--- /dev/null
+++ b/gnu/usr.bin/gcc/gcc/config/mips/t-openbsd64
@@ -0,0 +1,14 @@
+
+LIB2FUNCS_EXTRA = $(srcdir)/config/mips/_tilib.c
+
+TPBIT = tp-bit.c
+
+tp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#ifdef __MIPSEL__' > tp-bit.c
+ echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
+ echo '#endif' >> tp-bit.c
+ echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
+ echo '# define TFLOAT' >> tp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> tp-bit.c
+ echo '#endif' >> tp-bit.c
+