mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
golang: set GOARM64 based on CONFIG_CPU_TYPE
Fixes: https://github.com/openwrt/packages/issues/26852 Signed-off-by: George Sapkin <george@sapk.in>
This commit is contained in:
@@ -147,6 +147,34 @@ GO_HOST_ARCH:=$(call go_arch,$(subst \
|
||||
i686,i386,$(HOST_ARCH)))))
|
||||
GO_HOST_OS_ARCH:=$(GO_HOST_OS)_$(GO_HOST_ARCH)
|
||||
|
||||
# Filter lists for ARM64 cores
|
||||
# See https://en.wikipedia.org/wiki/ARM_architecture_family#Cores
|
||||
GO_ARM64_V8_0_CORES= \
|
||||
cortex-a34 \
|
||||
cortex-a35 \
|
||||
cortex-a53 \
|
||||
cortex-a57 \
|
||||
cortex-a72 \
|
||||
cortex-a73
|
||||
GO_ARM64_V8_2_CORES= \
|
||||
cortex-a55 \
|
||||
cortex-a65 \
|
||||
cortex-a75 \
|
||||
cortex-a76 \
|
||||
cortex-a77 \
|
||||
cortex-a78 \
|
||||
cortex-x1
|
||||
GO_ARM64_V9_0_CORES= \
|
||||
cortex-a510 \
|
||||
cortex-a710 \
|
||||
cortex-a715 \
|
||||
cortex-x2 \
|
||||
cortex-x3
|
||||
GO_ARM64_V9_2_CORES= \
|
||||
cortex-a520 \
|
||||
cortex-a720 \
|
||||
cortex-x4
|
||||
|
||||
ifeq ($(GO_OS_ARCH),$(GO_HOST_OS_ARCH))
|
||||
GO_HOST_TARGET_SAME:=1
|
||||
else
|
||||
@@ -180,6 +208,22 @@ else ifeq ($(GO_ARCH),arm)
|
||||
GO_ARM:=7
|
||||
endif
|
||||
|
||||
else ifeq ($(GO_ARCH),arm64)
|
||||
GO_TARGET_CPU:=$(call qstrip,$(CONFIG_CPU_TYPE))
|
||||
|
||||
ifneq ($(filter $(GO_TARGET_CPU),$(GO_ARM64_V8_0_CORES)),)
|
||||
GO_ARM64:=v8.0
|
||||
else ifneq ($(filter $(GO_TARGET_CPU),$(GO_ARM64_V8_2_CORES)),)
|
||||
GO_ARM64:=v8.2
|
||||
else ifneq ($(filter $(GO_TARGET_CPU),$(GO_ARM64_V9_0_CORES)),)
|
||||
GO_ARM64:=v9.0
|
||||
else ifneq ($(filter $(GO_TARGET_CPU),$(GO_ARM64_V9_2_CORES)),)
|
||||
GO_ARM64:=v9.2
|
||||
else
|
||||
# Unknown CPU, assume baseline
|
||||
GO_ARM64:=v8.0
|
||||
endif
|
||||
|
||||
else ifneq ($(filter $(GO_ARCH),mips mipsle),)
|
||||
ifeq ($(CONFIG_HAS_FPU),y)
|
||||
GO_MIPS:=hardfloat
|
||||
|
||||
Reference in New Issue
Block a user