1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.

This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
 * WITH_ARM_EABI
 * WITHOUT_GCC
 * WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
 * WITH_CLANG
 * WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.
This commit is contained in:
Andrew Turner 2014-03-23 12:49:25 +00:00
parent 4e3f1ce854
commit 73279d4113
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263660
17 changed files with 30 additions and 20 deletions

View File

@ -164,7 +164,7 @@ _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=$
_TARGET_ARCH= ${TARGET:S/pc98/i386/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH}
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/}
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/}
.endif
# Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1
.if defined(TARGET) && defined(TARGET_ARCH) && \
@ -374,7 +374,7 @@ kernel-toolchains:
#
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
TARGET_ARCHES_arm?= arm armeb armv6
TARGET_ARCHES_arm?= arm armeb armv6 armv6hf
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32
TARGET_ARCHES_powerpc?= powerpc powerpc64
TARGET_ARCHES_pc98?= i386

View File

@ -139,7 +139,7 @@ SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
.endif
KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
.if ${TARGET} == ${TARGET_ARCH}
_t= ${TARGET}
.else
@ -351,6 +351,8 @@ XFLAGS+= -B${WORLDTMP}/usr/bin
.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
${MK_ARM_EABI} != "no"
TARGET_ABI= gnueabi
.elif ${TARGET_ARCH} == "armv6hf"
TARGET_ABI= gnueabihf
.else
TARGET_ABI= unknown
.endif

View File

@ -281,7 +281,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_bigarm_vec
targ_selvecs=bfd_elf32_littlearm_vec
;;
armv6-*-freebsd*)
armv6-*-freebsd* | armv6hf-*-freebsd*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;

View File

@ -7,7 +7,7 @@
VERSION= "2.17.50 [FreeBSD] 2007-07-03"
.if defined(TARGET_ARCH)
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
.else
TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif

View File

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

View File

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

View File

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

View File

@ -23,12 +23,14 @@ BUILD_ARCH?= ${MACHINE_ARCH}
.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
${MK_ARM_EABI} != "no"
TARGET_ABI= gnueabi
.elif ${TARGET_ARCH} == "armv6hf"
TARGET_ABI= gnueabihf
.else
TARGET_ABI= unknown
.endif
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd11.0
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-${TARGET_ABI}-freebsd11.0
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-unknown-freebsd11.0
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"

View File

@ -98,7 +98,8 @@ NOASM=
.include "${LIBC_SRCTOP}/rpc/Makefile.inc"
.include "${LIBC_SRCTOP}/uuid/Makefile.inc"
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
.if ${LIBC_ARCH} == "arm" || ${LIBC_ARCH} == "mips"
.if (${LIBC_ARCH} == "arm" && ${MACHINE_ARCH} != "armv6hf") ||\
${LIBC_ARCH} == "mips"
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
.endif
.if ${MK_NIS} != "no"

View File

@ -3,9 +3,11 @@
.PATH: ${LIBC_SRCTOP}/arm/aeabi
SRCS+= aeabi_atexit.c \
aeabi_double.c \
aeabi_float.c \
aeabi_unwind_cpp.c
.if ${MACHINE_ARCH} != "armv6hf"
SRCS+= aeabi_double.c \
aeabi_float.c
.endif
.if ${MACHINE_ARCH:Marmv6*}
SRCS+= aeabi_vfp_double.S \
aeabi_vfp_float.S

View File

@ -165,7 +165,9 @@ SRCF+= stdatomic
.endif
.for file in ${SRCF}
. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S)
. if ${MACHINE_ARCH} == "armv6hf" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
SRCS+= ${file}vfp.S
. elif (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH} == "armv6hf") && exists(${CRTSRC}/${CRTARCH}/${file}.S)
SRCS+= ${file}.S
. else
SRCS+= ${file}.c

View File

@ -3,7 +3,7 @@
.if defined(TARGET_ARCH) && !defined(COMPAT_32BIT)
KVM_XARCH=${TARGET_ARCH}
KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
.else
KVM_XARCH=${MACHINE_ARCH}
KVM_XCPUARCH=${MACHINE_CPUARCH}

View File

@ -5,6 +5,7 @@
${MACHINE_ARCH} == "ia64" || \
${MACHINE_ARCH} == "arm" || \
${MACHINE_ARCH} == "armv6" || \
${MACHINE_ARCH} == "armv6hf" || \
${MACHINE_ARCH:Mmips*el} != ""
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \

View File

@ -400,7 +400,7 @@ __TT=${MACHINE}
# Clang is only for x86, powerpc and little-endian arm right now, by default.
.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
.elif ${__T} == "arm" || ${__T} == "armv6"
.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
__DEFAULT_YES_OPTIONS+=CLANG
# GCC is unable to build the full clang on arm, disable it by default.
__DEFAULT_NO_OPTIONS+=CLANG_FULL
@ -409,7 +409,7 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
.endif
# Clang the default system compiler only on little-endian arm and x86.
.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
${__T} == "i386"
${__T} == "armv6hf" || ${__T} == "i386"
__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
# for pc98 for now.

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
# for something different in FreeBSD.
#
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
.endif
# Set any local definitions first. Place this early, but it needs

View File

@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1100015 /* Master, propagated to newvers */
#define __FreeBSD_version 1100016 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

View File

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