Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.

This makes our naming scheme more closely match other systems and the
expectations of much third-party software.  MIPS builds which are little-endian
should require and exhibit no changes.  Big-endian TARGET_ARCHes must be
changed:
	From:		To:
	mipseb		mips
	mipsn32eb	mipsn32
	mips64eb	mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.
This commit is contained in:
Juli Mallett 2012-03-29 02:54:35 +00:00
parent d31f470d15
commit 84db023ec1
31 changed files with 54 additions and 47 deletions

View File

@ -132,20 +132,19 @@ _MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${
# Guess machine architecture from machine type, and vice versa. # Guess machine architecture from machine type, and vice versa.
.if !defined(TARGET_ARCH) && defined(TARGET) .if !defined(TARGET_ARCH) && defined(TARGET)
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/mips/mipsel/} _TARGET_ARCH= ${TARGET:S/pc98/i386/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \ .elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH} ${TARGET_ARCH} != ${MACHINE_ARCH}
_TARGET= ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/} _TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/}
.endif .endif
# Legacy names, for a transition period mips:mips -> mipsel:mips # Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1
.if defined(TARGET) && defined(TARGET_ARCH) && \ .if defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} == "mips" && ${TARGET} == "mips" ${TARGET} == "mips" && ${TARGET_ARCH:Mmips*eb}
.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" _TARGET_ARCH= ${TARGET_ARCH:C/eb$//}
.if defined(TARGET_BIG_ENDIAN) .warning "TARGET_ARCH of ${TARGET_ARCH} is deprecated in favor of ${_TARGET_ARCH}"
_TARGET_ARCH=mipseb
.else
_TARGET_ARCH=mipsel
.endif .endif
.if defined(TARGET) && ${TARGET} == "mips" && defined(TARGET_BIG_ENDIAN)
.warning "TARGET_BIG_ENDIAN is no longer necessary for MIPS. Big-endian is not the default."
.endif .endif
# arm with TARGET_BIG_ENDIAN -> armeb # arm with TARGET_BIG_ENDIAN -> armeb
.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) .if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
@ -331,7 +330,7 @@ kernel-toolchains:
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
TARGET_ARCHES_arm?= arm armeb TARGET_ARCHES_arm?= arm armeb
TARGET_ARCHES_mips?= mipsel mipseb mips64el mips64eb mipsn32eb TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32
TARGET_ARCHES_powerpc?= powerpc powerpc64 TARGET_ARCHES_powerpc?= powerpc powerpc64
TARGET_ARCHES_pc98?= i386 TARGET_ARCHES_pc98?= i386
.for target in ${TARGETS} .for target in ${TARGETS}

View File

@ -136,7 +136,7 @@ VERSION!= uname -srp
VERSION+= ${OSRELDATE} VERSION+= ${OSRELDATE}
.endif .endif
KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mips/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
.if ${TARGET} == ${TARGET_ARCH} .if ${TARGET} == ${TARGET_ARCH}
_t= ${TARGET} _t= ${TARGET}
.else .else

View File

@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
machines to maximize performance. (To disable malloc debugging, run machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.) ln -s aj /etc/malloc.conf.)
20120328:
Big-endian MIPS TARGET_ARCH values no longer end in "eb". mips64eb
is now spelled mips64. mipsn32eb is now spelled mipsn32. mipseb is
now spelled mips. This is to aid compatibility with third-party
software that expects this naming scheme in uname(3). Little-endian
settings are unchanged.
20120306: 20120306:
Disable by default the option VFS_ALLOW_NONMPSAFE for all supported Disable by default the option VFS_ALLOW_NONMPSAFE for all supported
platforms. platforms.

View File

@ -122,7 +122,7 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.if ${TARGET_CPUARCH} == mips .if ${TARGET_CPUARCH} == mips
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
# ABIs other than o32 need this # ABIs other than o32 need this
.if ${TARGET_ARCH:Mmipse[lb]} == "" .if ${TARGET_ARCH} != "mips" && ${TARGET_ARCH} != "mipsel"
LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c
LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c
LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c

View File

@ -7,7 +7,7 @@
VERSION= "2.17.50 [FreeBSD] 2007-07-03" VERSION= "2.17.50 [FreeBSD] 2007-07-03"
.if defined(TARGET_ARCH) .if defined(TARGET_ARCH)
TARGET_CPUARCH=${TARGET_ARCH:C/mips.*e[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else .else
TARGET_CPUARCH=${MACHINE_CPUARCH} TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif .endif
@ -16,7 +16,8 @@ TARGET_VENDOR?= unknown
TARGET_OS?= freebsd TARGET_OS?= freebsd
BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/} BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS} TARGET_TUPLE?= ${BINUTILS_ARCH}-${TARGET_VENDOR}-${TARGET_OS}
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH:Mmips*eb} != "" .if ${TARGET_ARCH} == "armeb" || \
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el} == "")
TARGET_BIG_ENDIAN=t TARGET_BIG_ENDIAN=t
.endif .endif

View File

@ -4,7 +4,7 @@
# MACHINE_CPUARCH, but there's no easy way to export make functions... # MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH) .if defined(TARGET_ARCH)
TARGET_CPUARCH=${TARGET_ARCH:C/mips.*e[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else .else
TARGET_CPUARCH=${MACHINE_CPUARCH} TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif .endif
@ -17,7 +17,8 @@ TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
.if ${TARGET_ARCH} == "sparc64" .if ${TARGET_ARCH} == "sparc64"
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
.endif .endif
.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH:Mmips*eb} != "" .if ${TARGET_ARCH} == "armeb" || \
(${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips*el} == "")
TARGET_BIG_ENDIAN=t TARGET_BIG_ENDIAN=t
.endif .endif
.if ${TARGET_ARCH} == "powerpc64" .if ${TARGET_ARCH} == "powerpc64"

View File

@ -20,7 +20,7 @@ OBJ_GDB= ${OBJ_ROOT}/gdb
# MACHINE_CPUARCH, but there's no easy way to export make functions... # MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH) .if defined(TARGET_ARCH)
TARGET_CPUARCH=${TARGET_ARCH:C/mips.*e[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else .else
TARGET_CPUARCH=${MACHINE_CPUARCH} TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif .endif

View File

@ -4,7 +4,7 @@
# MACHINE_CPUARCH, but there's no easy way to export make functions... # MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH) .if defined(TARGET_ARCH)
TARGET_CPUARCH=${TARGET_ARCH:C/mips.*e[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else .else
TARGET_CPUARCH=${MACHINE_CPUARCH} TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif .endif

View File

@ -10,8 +10,7 @@ MAN= kafs5.3
# Linking with libkrb5 uncovers a bug in binutils. # Linking with libkrb5 uncovers a bug in binutils.
# See http://repo.or.cz/w/binutils.git/commit/ee05170bf71819c99cb5a36a44735c231ae03c56 . # See http://repo.or.cz/w/binutils.git/commit/ee05170bf71819c99cb5a36a44735c231ae03c56 .
# #
.if ${MACHINE_ARCH} != "mipsn32eb" && ${MACHINE_ARCH} != "mipsel" && \ .if ${MACHINE} != "mips"
${MACHINE_ARCH} != "mipseb" && ${MACHINE_ARCH} != "mips"
LDADD+= -lkrb5 LDADD+= -lkrb5
LDFLAGS= -Wl,--no-undefined LDFLAGS= -Wl,--no-undefined
.endif .endif

View File

@ -270,7 +270,7 @@ When set, it also enforces the following options:
Set to not build the Clang C/C++ compiler. Set to not build the Clang C/C++ compiler.
.Pp .Pp
It is a default setting on It is a default setting on
arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb and sparc64/sparc64. arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32eb and sparc64/sparc64.
When set, it also enforces the following options: When set, it also enforces the following options:
.Pp .Pp
.Bl -item -compact .Bl -item -compact
@ -384,7 +384,7 @@ Set to build Flattened Device Tree support as part of the base system.
This includes the device tree compiler (dtc) and libfdt support library. This includes the device tree compiler (dtc) and libfdt support library.
.Pp .Pp
It is a default setting on It is a default setting on
arm/arm, arm/armeb, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc and powerpc/powerpc64. arm/arm, arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64.
.It Va WITHOUT_FLOPPY .It Va WITHOUT_FLOPPY
.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru
Set to not build or install programs Set to not build or install programs

View File

@ -10,6 +10,6 @@ TARGET_ENDIANNESS= 1234
${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "powerpc64" || \
${MACHINE_ARCH} == "sparc64" || \ ${MACHINE_ARCH} == "sparc64" || \
${MACHINE_ARCH} == "armeb" || \ ${MACHINE_ARCH} == "armeb" || \
${MACHINE_ARCH:Mmips*eb} != "" ${MACHINE_ARCH:Mmips*} != ""
TARGET_ENDIANNESS= 4321 TARGET_ENDIANNESS= 4321
.endif .endif

View File

@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX.
# and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used
# for something different in FreeBSD. # for something different in FreeBSD.
# #
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.endif .endif
# If the special target .POSIX appears (without prerequisites or # If the special target .POSIX appears (without prerequisites or

View File

@ -6,7 +6,7 @@
.include <bsd.own.mk> .include <bsd.own.mk>
# backwards compat option for older systems. # backwards compat option for older systems.
MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
# Can be overridden by makeoptions or /etc/make.conf # Can be overridden by makeoptions or /etc/make.conf
KERNEL_KO?= kernel KERNEL_KO?= kernel

View File

@ -61,7 +61,7 @@
# #
# backwards compat option for older systems. # backwards compat option for older systems.
MACHINE_CPUARCH?=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
AWK?= awk AWK?= awk
KMODLOAD?= /sbin/kldload KMODLOAD?= /sbin/kldload

View File

@ -4,5 +4,5 @@
files "../atheros/files.ar71xx" files "../atheros/files.ar71xx"
machine mips mipseb machine mips mips
cpu CPU_MIPS4KC cpu CPU_MIPS4KC

View File

@ -5,5 +5,5 @@
# $FreeBSD$ # $FreeBSD$
# #
files "../cavium/files.octeon1" files "../cavium/files.octeon1"
machine mips mips64eb machine mips mips64
cpu CPU_CNMIPS cpu CPU_CNMIPS

View File

@ -7,7 +7,7 @@
# $FreeBSD$ # $FreeBSD$
# #
machine mips mipseb machine mips mips
ident AR71XX_BASE ident AR71XX_BASE
cpu CPU_MIPS4KC cpu CPU_MIPS4KC
makeoptions KERNLOADADDR=0x80050000 makeoptions KERNLOADADDR=0x80050000

View File

@ -10,7 +10,7 @@
# $FreeBSD$ # $FreeBSD$
# #
machine mips mipseb machine mips mips
ident AR91XX_BASE ident AR91XX_BASE
cpu CPU_MIPS4KC cpu CPU_MIPS4KC
makeoptions KERNLOADADDR=0x80050000 makeoptions KERNLOADADDR=0x80050000

View File

@ -6,7 +6,7 @@ include "std.SWARM"
ident SWARM ident SWARM
machine mips mipseb machine mips mips
makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" makeoptions ARCH_FLAGS="-mabi=32 -march=mips32"
makeoptions LDSCRIPT_NAME= ldscript.mips.cfe makeoptions LDSCRIPT_NAME= ldscript.mips.cfe

View File

@ -6,7 +6,7 @@ include "std.SWARM"
ident SWARM64 ident SWARM64
machine mips mips64eb machine mips mips64
makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" makeoptions ARCH_FLAGS="-mabi=64 -march=mips64"
makeoptions LDSCRIPT_NAME=ldscript.mips.cfe makeoptions LDSCRIPT_NAME=ldscript.mips.cfe
makeoptions KERNLOADADDR=0xffffffff80001000 makeoptions KERNLOADADDR=0xffffffff80001000

View File

@ -9,7 +9,7 @@ ident SWARM64_SMP
options SMP options SMP
options PRINTF_BUFR_SIZE=128 options PRINTF_BUFR_SIZE=128
machine mips mips64eb machine mips mips64
makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" makeoptions ARCH_FLAGS="-mabi=64 -march=mips64"
makeoptions LDSCRIPT_NAME=ldscript.mips.cfe makeoptions LDSCRIPT_NAME=ldscript.mips.cfe
makeoptions KERNLOADADDR=0xffffffff80001000 makeoptions KERNLOADADDR=0xffffffff80001000

View File

@ -9,7 +9,7 @@ ident SWARM_SMP
options SMP options SMP
options PRINTF_BUFR_SIZE=128 options PRINTF_BUFR_SIZE=128
machine mips mipseb machine mips mips
makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" makeoptions ARCH_FLAGS="-mabi=32 -march=mips32"
makeoptions LDSCRIPT_NAME= ldscript.mips.cfe makeoptions LDSCRIPT_NAME= ldscript.mips.cfe

View File

@ -17,7 +17,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mipseb machine mips mips
ident XLP ident XLP
makeoptions KERNLOADADDR=0x80100000 makeoptions KERNLOADADDR=0x80100000

View File

@ -17,7 +17,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mips64eb machine mips mips64
ident XLP64 ident XLP64
makeoptions ARCH_FLAGS="-march=mips64r2 -mabi=64" makeoptions ARCH_FLAGS="-march=mips64r2 -mabi=64"

View File

@ -17,7 +17,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mipsn32eb machine mips mipsn32
ident XLPN32 ident XLPN32
makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32"

View File

@ -45,7 +45,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mipseb machine mips mips
ident XLR ident XLR
include "../rmi/std.xlr" include "../rmi/std.xlr"

View File

@ -17,7 +17,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mips64eb machine mips mips64
ident XLR64 ident XLR64
include "../rmi/std.xlr" include "../rmi/std.xlr"

View File

@ -17,7 +17,7 @@
# #
# $FreeBSD$ # $FreeBSD$
machine mips mipsn32eb machine mips mipsn32
ident XLRN32 ident XLRN32
include "../rmi/std.xlr" include "../rmi/std.xlr"

View File

@ -59,14 +59,14 @@
#ifndef MACHINE_ARCH #ifndef MACHINE_ARCH
#if _BYTE_ORDER == _BIG_ENDIAN #if _BYTE_ORDER == _BIG_ENDIAN
#ifdef __mips_n64 #ifdef __mips_n64
#define MACHINE_ARCH "mips64eb" #define MACHINE_ARCH "mips64"
#ifndef MACHINE_ARCH32 #ifndef MACHINE_ARCH32
#define MACHINE_ARCH32 "mipseb" #define MACHINE_ARCH32 "mips"
#endif #endif
#elif defined(__mips_n32) #elif defined(__mips_n32)
#define MACHINE_ARCH "mipsn32eb" #define MACHINE_ARCH "mipsn32"
#else #else
#define MACHINE_ARCH "mipseb" #define MACHINE_ARCH "mips"
#endif #endif
#else #else
#ifdef __mips_n64 #ifdef __mips_n64

View File

@ -8,7 +8,7 @@ WARNS?= 0
# These assignments duplicate much of the functionality of # These assignments duplicate much of the functionality of
# MACHINE_CPUARCH, but there's no easy way to export make functions... # MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH) .if defined(TARGET_ARCH)
TARGET_CPUARCH= ${TARGET_ARCH:C/mips.*e[bl]/mips/:C/armeb/arm/} TARGET_CPUARCH= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/}
.else .else
TARGET_CPUARCH= ${MACHINE_CPUARCH} TARGET_CPUARCH= ${MACHINE_CPUARCH}
TARGET_ARCH= ${MACHINE_ARCH} TARGET_ARCH= ${MACHINE_ARCH}

View File

@ -1,6 +1,6 @@
# $FreeBSD$ # $FreeBSD$
# uathload broken for n32 and n64 due to toolchain issues # uathload broken for n32 and n64 due to toolchain issues, only build for o32
.if ${MACHINE_ARCH:Mmipse[lb]} == "" .if ${MACHINE_ARCH} != "mips" && ${MACHINE_ARCH} != "mipsel"
SUBDIR:= ${SUBDIR:Nuathload} SUBDIR:= ${SUBDIR:Nuathload}
.endif .endif