1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-15 20:03:57 +02:00

golang: Blacklist older (or no) FPUs rather than whitelist newer FPUs

This should be more future-proof (presumably all future ARM FPUs will be
at least VFPv3).

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To 2020-05-13 02:35:28 +08:00
parent 25a7f0045e
commit 74b02ca24c

View File

@ -156,32 +156,15 @@ ifeq ($(GO_ARCH),386)
else ifeq ($(GO_ARCH),arm)
GO_TARGET_FPU:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
# FPU names from https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/ARM-Options.html#index-mfpu-1
# see also https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/arm/arm-cpus.in
#
# Assumptions:
#
# * -d16 variants (16 instead of 32 double-precision registers) acceptable
# Go doesn't appear to check the HWCAP_VFPv3D16 flag in
# https://github.com/golang/go/blob/release-branch.go1.13/src/runtime/os_linux_arm.go
#
# * Double-precision required
# Based on no evidence(!)
# Excludes vfpv3xd, vfpv3xd-fp16, fpv4-sp-d16, fpv5-sp-d16
# FPU names from https://gcc.gnu.org/onlinedocs/gcc-8.4.0/gcc/ARM-Options.html#index-mfpu-1
# see also https://github.com/gcc-mirror/gcc/blob/releases/gcc-8.4.0/gcc/config/arm/arm-cpus.in
GO_ARM_7_FPUS:= \
vfpv3 vfpv3-fp16 vfpv3-d16 vfpv3-d16-fp16 neon neon-vfpv3 neon-fp16 \
vfpv4 vfpv4-d16 neon-vfpv4 \
fpv5-d16 fp-armv8 neon-fp-armv8 crypto-neon-fp-armv8
GO_ARM_6_FPUS:=vfp vfpv2
ifneq ($(filter $(GO_TARGET_FPU),$(GO_ARM_7_FPUS)),)
GO_ARM:=7
else ifneq ($(filter $(GO_TARGET_FPU),$(GO_ARM_6_FPUS)),)
ifeq ($(GO_TARGET_FPU),)
GO_ARM:=5
else ifneq ($(filter $(GO_TARGET_FPU),vfp vfpv2),)
GO_ARM:=6
else
GO_ARM:=5
GO_ARM:=7
endif
else ifneq ($(filter $(GO_ARCH),mips mipsle),)