Skip to content

Commit 3b518c4

Browse files
committed
Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb)
1 parent 28fe011 commit 3b518c4

18 files changed

+43
-24
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ _MAKE+= MK_META_MODE=no
197197
_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
198198
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
199199
${TARGET_ARCH} != ${MACHINE_ARCH}
200-
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/}
200+
_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/}
201201
.endif
202202
.if defined(TARGET) && !defined(_TARGET)
203203
_TARGET=${TARGET}
@@ -374,7 +374,7 @@ worlds:
374374
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
375375
TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64
376376
_UNIVERSE_TARGETS= ${TARGETS}
377-
TARGET_ARCHES_arm?= arm armeb armv6 armv6hf
377+
TARGET_ARCHES_arm?= arm armeb armv6
378378
TARGET_ARCHES_arm64?= aarch64
379379
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32
380380
TARGET_ARCHES_powerpc?= powerpc powerpc64

Makefile.inc1

-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ KNOWN_ARCHES?= aarch64/arm64 \
219219
arm \
220220
armeb/arm \
221221
armv6/arm \
222-
armv6hf/arm \
223222
i386 \
224223
i386/pc98 \
225224
mips \

UPDATING

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
3131
disable the most expensive debugging functionality run
3232
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
3333

34+
20160517:
35+
The armv6 port now defaults to hard float ABI. Limited support
36+
for running both hardfloat and soft float on the same system
37+
is available using the libraries installed with -DWITH_LIBSOFT.
38+
This has only been tested as an upgrade path for installworld
39+
and packages may fail or need manual intervention to run. New
40+
packages will be needed.
41+
3442
20160510:
3543
Kernel modules compiled outside of a kernel build now default to
3644
installing to /boot/modules instead of /boot/kernel. Many kernel

gnu/usr.bin/binutils/Makefile.inc0

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
VERSION= "2.17.50 [FreeBSD] 2007-07-03"
88

99
.if defined(TARGET_ARCH)
10-
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
10+
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
1111
.else
1212
TARGET_CPUARCH=${MACHINE_CPUARCH}
1313
.endif

gnu/usr.bin/cc/Makefile.tgt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# MACHINE_CPUARCH, but there's no easy way to export make functions...
55

66
.if defined(TARGET_ARCH)
7-
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
7+
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
88
.else
99
TARGET_CPUARCH=${MACHINE_CPUARCH}
1010
.endif

gnu/usr.bin/gdb/Makefile.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/readline
2323
# MACHINE_CPUARCH, but there's no easy way to export make functions...
2424

2525
.if defined(TARGET_ARCH)
26-
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
26+
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
2727
.else
2828
TARGET_CPUARCH=${MACHINE_CPUARCH}
2929
.endif

gnu/usr.bin/gdb/libgdb/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# MACHINE_CPUARCH, but there's no easy way to export make functions...
55

66
.if defined(TARGET_ARCH)
7-
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
7+
TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}
88
.else
99
TARGET_CPUARCH=${MACHINE_CPUARCH}
1010
.endif

lib/clang/clang.build.mk

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ CFLAGS+= -fno-strict-aliasing
2121
TARGET_ARCH?= ${MACHINE_ARCH}
2222
BUILD_ARCH?= ${MACHINE_ARCH}
2323

24-
.if ${TARGET_ARCH:Marm*hf*} != ""
24+
# Armv6 uses hard float abi, unless the CPUTYPE has soft in it.
25+
# arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
26+
# For all other targets, we stick with 'unknown'.
27+
.if ${TARGET_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
2528
TARGET_ABI= gnueabihf
26-
.elif ${TARGET_ARCH:Marm*} != ""
29+
.elif ${TARGET_ARCH:Marm*}
2730
TARGET_ABI= gnueabi
2831
.else
2932
TARGET_ABI= unknown
3033
.endif
3134

32-
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0
33-
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/:C/arm64/aarch64/}-unknown-freebsd11.0
35+
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${TARGET_ABI}-freebsd11.0
36+
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-unknown-freebsd11.0
3437
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
3538
-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
3639
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"

lib/libc/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ NOASM=
105105
.include "${LIBC_SRCTOP}/rpc/Makefile.inc"
106106
.include "${LIBC_SRCTOP}/uuid/Makefile.inc"
107107
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
108-
.if (${LIBC_ARCH} == "arm" && ${MACHINE_ARCH} != "armv6hf") ||\
108+
.if (${LIBC_ARCH} == "arm" && \
109+
(${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
109110
${LIBC_ARCH} == "mips"
110111
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
111112
.endif

lib/libc/arm/Makefile.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map
1111

1212
.include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc"
1313

14-
.if ${MACHINE_ARCH:Marm*hf*} != ""
14+
.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
1515
SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map
1616
.endif
1717

lib/libc/arm/aeabi/Makefile.inc

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
SRCS+= aeabi_atexit.c \
66
aeabi_unwind_cpp.c \
77
aeabi_unwind_exidx.c
8-
.if ${MACHINE_ARCH:Marm*hf*} == ""
8+
.if (${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \
9+
${MACHINE_ARCH:Marmv6*} == ""
910
SRCS+= aeabi_asm_double.S \
1011
aeabi_asm_float.S \
1112
aeabi_double.c \
1213
aeabi_float.c
1314
.endif
14-
.if ${MACHINE_ARCH:Marmv6*}
15+
.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
1516
SRCS+= aeabi_vfp_double.S \
1617
aeabi_vfp_float.S
1718
.endif

lib/libc/arm/gen/Makefile.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
77
arm_initfini.c \
88
trivial-getcontextx.c
99

10-
.if ${MACHINE_ARCH} == "armv6hf"
10+
.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
1111
SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \
1212
fpsetround_vfp.c fpsetsticky_vfp.c
1313
.endif

lib/libcompiler_rt/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ SRCF+= stdatomic
199199
.endif
200200

201201
.for file in ${SRCF}
202-
. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
202+
.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") && \
203+
exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
203204
SRCS+= ${file}vfp.S
204-
. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S)
205+
. elif exists(${CRTSRC}/${CRTARCH}/${file}.S)
205206
SRCS+= ${file}.S
206207
. else
207208
SRCS+= ${file}.c

lib/msun/arm/Makefile.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
LDBL_PREC = 53
44
SYM_MAPS += ${.CURDIR}/arm/Symbol.map
55

6-
.if ${TARGET_ARCH} == "armv6"
6+
.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
77
ARCH_SRCS = fenv-softfp.c fenv-vfp.c
88
.endif
99

lib/msun/arm/fenv-vfp.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#define FENV_MANGLE(x) __vfp_ ##x
3030
#include "fenv-mangle.h"
31-
#define __ARM_PCS_VFP
31+
#ifndef __ARM_PCS_VFP
32+
#define __ARM_PCS_VFP 1
33+
#endif
3234
#include "fenv.c"
3335

share/mk/bsd.cpu.mk

+6-2
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,18 @@ MACHINE_CPU += arm
309309
. if ${MACHINE_ARCH:Marmv6*} != ""
310310
MACHINE_CPU += armv6
311311
. endif
312-
# armv6 is a hybrid. It uses the softfp ABI, but doesn't emulate
312+
# armv6 is a hybrid. It can use the softfp ABI, but doesn't emulate
313313
# floating point in the general case, so don't define softfp for
314314
# it at this time. arm and armeb are pure softfp, so define it
315315
# for them.
316316
. if ${MACHINE_ARCH:Marmv6*} == ""
317317
MACHINE_CPU += softfp
318318
. endif
319-
.if ${MACHINE_ARCH} == "armv6"
319+
# Normally armv6 is hard float ABI from FreeBSD 11 onwards. However
320+
# when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow
321+
# building of soft-float ABI libraries. In this case, we have to
322+
# add the -mfloat-abi=softfp to force that.
323+
.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
320324
# Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI
321325
# not a nice optimization.
322326
CFLAGS += -mfloat-abi=softfp

share/mk/local.meta.sys.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T}
4343
.endif
4444

4545
# from src/Makefile (for universe)
46-
TARGET_ARCHES_arm?= arm armeb armv6 armv6hf
46+
TARGET_ARCHES_arm?= arm armeb armv6
4747
TARGET_ARCHES_arm64?= aarch64
4848
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el
4949
TARGET_ARCHES_powerpc?= powerpc powerpc64

share/mk/sys.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX.
1313
# and/or endian. This is called MACHINE_CPU in NetBSD, but that's used
1414
# for something different in FreeBSD.
1515
#
16-
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/}
16+
MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/}
1717
.endif
1818

1919

0 commit comments

Comments
 (0)