summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libgcc/Makefile6
-rw-r--r--gnu/lib/libgomp/Makefile3
-rw-r--r--gnu/usr.bin/binutils/Makefile.inc03
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.mips17
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.mips18
-rw-r--r--gnu/usr.bin/binutils/libbfd/bfd.h2
-rw-r--r--gnu/usr.bin/cc/Makefile.inc23
7 files changed, 63 insertions, 9 deletions
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 8c89236..b54e0bd 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -118,6 +118,12 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.if ${TARGET_ARCH} == "mips"
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
+.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
+LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
+LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
+LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c
+LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
+.endif
.endif
.if ${TARGET_ARCH} == "ia64"
diff --git a/gnu/lib/libgomp/Makefile b/gnu/lib/libgomp/Makefile
index c8052d5..0974516 100644
--- a/gnu/lib/libgomp/Makefile
+++ b/gnu/lib/libgomp/Makefile
@@ -24,7 +24,8 @@ VERSION_MAP= ${SRCDIR}/libgomp.map
# Target-specific OpenMP configuration
.if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == i386 || \
- ${MACHINE_ARCH} == mips || ${MACHINE_ARCH} == powerpc
+ ${MACHINE_ARCH} == powerpc || \
+ (${MACHINE_ARCH} == mips && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
OMP_LOCK_ALIGN = 4
OMP_LOCK_KIND= 4
OMP_LOCK_SIZE= 4
diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0
index 945c933..5999a2e 100644
--- a/gnu/usr.bin/binutils/Makefile.inc0
+++ b/gnu/usr.bin/binutils/Makefile.inc0
@@ -23,7 +23,8 @@ RELSRC= ${RELTOP}/../../../contrib/binutils
SRCDIR= ${.CURDIR}/${RELSRC}
.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || \
- ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "mips"
+ ${TARGET_ARCH} == "powerpc" || \
+ (${TARGET_ARCH} == "mips" && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
.else
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
diff --git a/gnu/usr.bin/binutils/ld/Makefile.mips b/gnu/usr.bin/binutils/ld/Makefile.mips
index d1e25ef..e0d0582 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.mips
+++ b/gnu/usr.bin/binutils/ld/Makefile.mips
@@ -1,15 +1,22 @@
# $FreeBSD$
-#xxxIMPxxx: size?
#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention
# of mipsel and mips.
-_sz?=32
-.if defined(TARGET_BIG_ENDIAN)
-NATIVE_EMULATION=elf${_sz}btsmip_fbsd
+.if !defined(TARGET_BIG_ENDIAN)
+_EMULATION_ENDIAN=l
.else
-NATIVE_EMULATION=elf${_sz}ltsmip_fbsd
+_EMULATION_ENDIAN=b
.endif
+.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
+.if ${TARGET_ABI} == "n32"
+NATIVE_EMULATION=elf32${_EMULATION_ENDIAN}tsmipn32_fbsd
+.elif ${TARGET_ABI} == "n64"
+NATIVE_EMULATION=elf64${_EMULATION_ENDIAN}tsmip_fbsd
+.endif
+.endif
+NATIVE_EMULATION?=elf32${_EMULATION_ENDIAN}tsmip_fbsd
+
MIPS_ABIS=elf32btsmip_fbsd elf32ltsmip_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd \
elf32btsmipn32_fbsd elf32ltsmipn32_fbsd
.for abi in ${MIPS_ABIS}
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.mips b/gnu/usr.bin/binutils/libbfd/Makefile.mips
index 6f03eb7..cb1e370 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.mips
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.mips
@@ -1,8 +1,24 @@
# $FreeBSD$
-#xxxIMPxxx: endian and size
+#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention
+# of mipsel and mips.
+.if !defined(TARGET_BIG_ENDIAN)
+_EMULATION_ENDIAN=little
+.else
+_EMULATION_ENDIAN=big
+.endif
+
DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec
+.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
+.if ${TARGET_ABI} == "n32"
+DEFAULT_VECTOR= bfd_elf32_ntrad${_EMULATION_ENDIAN}mips_vec
+.elif ${TARGET_ABI} == "n64"
+DEFAULT_VECTOR= bfd_elf64_trad${_EMULATION_ENDIAN}mips_vec
+.endif
+.endif
+DEFAULT_VECTOR?=bfd_elf32_trad${_EMULATION_ENDIAN}mips_vec
+
SRCS+= coff-mips.c \
cpu-mips.c \
ecoff.c \
diff --git a/gnu/usr.bin/binutils/libbfd/bfd.h b/gnu/usr.bin/binutils/libbfd/bfd.h
index 6b152d5..5812ceb 100644
--- a/gnu/usr.bin/binutils/libbfd/bfd.h
+++ b/gnu/usr.bin/binutils/libbfd/bfd.h
@@ -1546,10 +1546,12 @@ enum bfd_architecture
#define bfd_mach_mips6000 6000
#define bfd_mach_mips7000 7000
#define bfd_mach_mips8000 8000
+#define bfd_mach_mips9000 9000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips12000 12000
#define bfd_mach_mips16 16
#define bfd_mach_mips5 5
+#define bfd_mach_mips_octeon 6502
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
#define bfd_mach_mipsisa32 32
#define bfd_mach_mipsisa32r2 33
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index 1b7cbce..3f03d26 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -32,10 +32,31 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
CFLAGS+= -DCROSS_COMPILE
.endif
-.if ${TARGET_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN)
+.if ${TARGET_ARCH} == "mips"
+# XXX This is backwards, MIPS should default to BE.
+.if !defined(TARGET_BIG_ENDIAN)
CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
.endif
+.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32"
+.if ${TARGET_ABI} == "n32"
+MIPS_ABI_DEFAULT=ABI_N32
+.elif ${TARGET_ABI} == "n64"
+MIPS_ABI_DEFAULT=ABI_64
+.endif
+.endif
+
+MIPS_ABI_DEFAULT?=ABI_32
+CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
+
+# GCC by default takes the ISA from the ABI's requirements. If world is built
+# with a superior ISA, since we lack multilib, we have to set the right
+# default ISA to be able to link against what's in /usr/lib. Terrible stuff.
+.if defined(TARGET_CPUTYPE)
+CFLAGS += -DMIPS_CPU_STRING_DEFAULT=\"${TARGET_CPUTYPE}\"
+.endif
+.endif
+
.if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
.endif
OpenPOWER on IntegriCloud