svn commit: r204888 - in user/jmallett/octeon: gnu/usr.bin/binutils/ld gnu/usr.bin/cc lib/libc sys/conf sys/mips/cavium sys/mips/conf

Juli Mallett jmallett at FreeBSD.org
Mon Mar 8 21:22:34 UTC 2010


Author: jmallett
Date: Mon Mar  8 21:22:34 2010
New Revision: 204888
URL: http://svn.freebsd.org/changeset/base/204888

Log:
  o) Add a TARGET_ABI flag which can be set to o32, n32 or n64.
  o) Select default ABI for GCC and emulation for binutils based on the value
     of TARGET_ABI at build time.
  o) Don't build quad support in libc for MIPS unless TARGET_ABI is o32.
  o) Don't specify emulation options gratuitously when building the kernel.
  o) Don't specify an ABI when building the kernel, though we are still stuck
     with ABI-specific loader scripts.
  o) Don't make any Octeon systems default to single user.
  
  Sponsored by:	Packet Forensics

Modified:
  user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips
  user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc
  user/jmallett/octeon/lib/libc/Makefile
  user/jmallett/octeon/sys/conf/Makefile.mips
  user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
  user/jmallett/octeon/sys/mips/conf/OCTEON1-32
  user/jmallett/octeon/sys/mips/conf/OCTEON1-o32

Modified: user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/gnu/usr.bin/binutils/ld/Makefile.mips	Mon Mar  8 21:22:34 2010	(r204888)
@@ -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}

Modified: user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Mon Mar  8 21:22:34 2010	(r204888)
@@ -30,10 +30,24 @@ CFLAGS+=	-DLONG_TYPE_SIZE=${LONG_TYPE_SI
 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}
+.endif
+
 .if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
 CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
 .endif

Modified: user/jmallett/octeon/lib/libc/Makefile
==============================================================================
--- user/jmallett/octeon/lib/libc/Makefile	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/lib/libc/Makefile	Mon Mar  8 21:22:34 2010	(r204888)
@@ -55,6 +55,10 @@ NOASM=
     ${MACHINE_ARCH} != "mips"
 .include "${.CURDIR}/quad/Makefile.inc"
 .endif
+.if ${MACHINE_ARCH} == "mips" && \
+    (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32")
+.include "${.CURDIR}/quad/Makefile.inc"
+.endif
 .include "${.CURDIR}/regex/Makefile.inc"
 .include "${.CURDIR}/resolv/Makefile.inc"
 .include "${.CURDIR}/stdio/Makefile.inc"
@@ -65,8 +69,7 @@ NOASM=
 .include "${.CURDIR}/rpc/Makefile.inc"
 .include "${.CURDIR}/uuid/Makefile.inc"
 .include "${.CURDIR}/xdr/Makefile.inc"
-.if ${MACHINE_ARCH} == "arm" || \
-    ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
 .include "${.CURDIR}/softfloat/Makefile.inc"
 .endif
 .if ${MK_NIS} != "no"

Modified: user/jmallett/octeon/sys/conf/Makefile.mips
==============================================================================
--- user/jmallett/octeon/sys/conf/Makefile.mips	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/sys/conf/Makefile.mips	Mon Mar  8 21:22:34 2010	(r204888)
@@ -48,42 +48,6 @@ ARCH_FLAGS?=-march=mips32
 EXTRA_FLAGS=-fno-pic -mno-abicalls -G0
 
 HACK_EXTRA_FLAGS=-shared
-.if defined(TARGET_BIG_ENDIAN)
-CFLAGS+=-EB
-SYSTEM_LD+=-EB
-EXTRA_FLAGS+=-EB 
-TRAMP_LDFLAGS+=-Wl,-EB 
-HACK_EXTRA_FLAGS+=-EB -Wl,-EB
-.if defined(TARGET_64BIT)
-SYSTEM_LD+=-m elf64btsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd
-.endif
-.if defined(TARGET_N32)
-SYSTEM_LD+=-m elf32btsmipn32_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf32btsmipn32_fbsd
-.else
-SYSTEM_LD+=-m elf32btsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf32btsmip_fbsd
-.endif
-.else
-CFLAGS+=-EL
-SYSTEM_LD+=-EL
-EXTRA_FLAGS+=-EL
-TRAMP_LDFLAGS+=-Wl,-EL
-HACK_EXTRA_FLAGS+=-EL -Wl,-EL
-.if defined(TARGET_64BIT)
-SYSTEM_LD+=-m elf64ltsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd
-.endif
-.if defined(TARGET_N32)
-SYSTEM_LD+=-m elf32ltsmipn32_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf32ltsmipn32_fbsd
-.else
-SYSTEM_LD+=-m elf32ltsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf32ltsmip_fbsd
-.endif
-.endif
-
 
 # We add the -fno-pic flag to kernels because otherwise performance
 # is extremely poor, as well as -mno-abicalls to force no ABI usage.

Modified: user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/sys/mips/cavium/octeon_machdep.c	Mon Mar  8 21:22:34 2010	(r204888)
@@ -730,10 +730,6 @@ platform_start(__register_t a0, __regist
 {
 	uint64_t platform_counter_freq;
 
-#if defined(__mips_o32)
-	boothowto |= RB_SINGLE;
-#endif
-
 	/* Initialize pcpu stuff */
 	mips_pcpu0_init();
 	mips_timer_early_init(OCTEON_CLOCK_DEFAULT);

Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-32
==============================================================================
--- user/jmallett/octeon/sys/mips/conf/OCTEON1-32	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/sys/mips/conf/OCTEON1-32	Mon Mar  8 21:22:34 2010	(r204888)
@@ -24,8 +24,7 @@ ident		OCTEON1
 # Don't build any modules yet.
 makeoptions	MODULES_OVERRIDE=""
 makeoptions     TARGET_BIG_ENDIAN=defined
-makeoptions	TARGET_N32=defined
-makeoptions	ARCH_FLAGS="-march=mips64 -mabi=n32"
+makeoptions	ARCH_FLAGS="-march=mips64"
 makeoptions     LDSCRIPT_NAME=ldscript.mips.octeon1.n32
 
 makeoptions	KERNLOADADDR=0xffffffff81000000

Modified: user/jmallett/octeon/sys/mips/conf/OCTEON1-o32
==============================================================================
--- user/jmallett/octeon/sys/mips/conf/OCTEON1-o32	Mon Mar  8 21:17:10 2010	(r204887)
+++ user/jmallett/octeon/sys/mips/conf/OCTEON1-o32	Mon Mar  8 21:22:34 2010	(r204888)
@@ -24,7 +24,7 @@ ident		OCTEON1
 # Don't build any modules yet.
 makeoptions	MODULES_OVERRIDE=""
 makeoptions     TARGET_BIG_ENDIAN=defined
-makeoptions	ARCH_FLAGS="-march=mips64 -mabi=32"
+makeoptions	ARCH_FLAGS="-march=mips64"
 makeoptions     LDSCRIPT_NAME=ldscript.mips.octeon1.32
 
 makeoptions	KERNLOADADDR=0xffffffff81000000


More information about the svn-src-user mailing list