mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34: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:
@@ -200,6 +200,7 @@ GO_PKG_TARGET_VARS= \
|
|||||||
GO386="$(GO_386)" \
|
GO386="$(GO_386)" \
|
||||||
GOAMD64="$(GO_AMD64)" \
|
GOAMD64="$(GO_AMD64)" \
|
||||||
GOARM="$(GO_ARM)" \
|
GOARM="$(GO_ARM)" \
|
||||||
|
GOARM64="$(GO_ARM64)" \
|
||||||
GOMIPS="$(GO_MIPS)" \
|
GOMIPS="$(GO_MIPS)" \
|
||||||
GOMIPS64="$(GO_MIPS64)" \
|
GOMIPS64="$(GO_MIPS64)" \
|
||||||
GOPPC64="$(GO_PPC64)" \
|
GOPPC64="$(GO_PPC64)" \
|
||||||
|
|||||||
@@ -147,6 +147,34 @@ GO_HOST_ARCH:=$(call go_arch,$(subst \
|
|||||||
i686,i386,$(HOST_ARCH)))))
|
i686,i386,$(HOST_ARCH)))))
|
||||||
GO_HOST_OS_ARCH:=$(GO_HOST_OS)_$(GO_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))
|
ifeq ($(GO_OS_ARCH),$(GO_HOST_OS_ARCH))
|
||||||
GO_HOST_TARGET_SAME:=1
|
GO_HOST_TARGET_SAME:=1
|
||||||
else
|
else
|
||||||
@@ -180,6 +208,22 @@ else ifeq ($(GO_ARCH),arm)
|
|||||||
GO_ARM:=7
|
GO_ARM:=7
|
||||||
endif
|
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),)
|
else ifneq ($(filter $(GO_ARCH),mips mipsle),)
|
||||||
ifeq ($(CONFIG_HAS_FPU),y)
|
ifeq ($(CONFIG_HAS_FPU),y)
|
||||||
GO_MIPS:=hardfloat
|
GO_MIPS:=hardfloat
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ GO_VERSION_PATCH:=4
|
|||||||
|
|
||||||
PKG_NAME:=golang
|
PKG_NAME:=golang
|
||||||
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
|
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
GO_SOURCE_URLS:=https://dl.google.com/go/ \
|
GO_SOURCE_URLS:=https://dl.google.com/go/ \
|
||||||
https://mirrors.ustc.edu.cn/golang/ \
|
https://mirrors.ustc.edu.cn/golang/ \
|
||||||
@@ -357,6 +357,7 @@ PKG_GO_ZBOOTSTRAP_MODS:= \
|
|||||||
s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \
|
s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \
|
||||||
s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \
|
s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \
|
||||||
s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),7)`/; \
|
s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),7)`/; \
|
||||||
|
s/defaultGOARM64 = `[^`]*`/defaultGOARM64 = `$(or $(GO_ARM64),v8.0)`/; \
|
||||||
s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \
|
s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \
|
||||||
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
|
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
|
||||||
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/;
|
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/;
|
||||||
|
|||||||
Reference in New Issue
Block a user