golang: Add option to enable Spectre mitigations

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2020-08-25 01:01:52 +08:00
parent 3d6df5d7d9
commit d5dc30fe80
4 changed files with 53 additions and 1 deletions

View File

@@ -221,6 +221,19 @@ ifneq ($(filter $(GO_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
endif
# Spectre mitigations
GO_SPECTRE_SUPPORTED_ARCH:=amd64
ifneq ($(filter $(GO_HOST_ARCH),$(GO_SPECTRE_SUPPORTED_ARCH)),)
GO_HOST_SPECTRE_SUPPORTED:=1
endif
ifneq ($(filter $(GO_ARCH),$(GO_SPECTRE_SUPPORTED_ARCH)),)
GO_TARGET_SPECTRE_SUPPORTED:=1
endif
# General build info
GO_BUILD_CACHE_DIR:=$(or $(call qstrip,$(CONFIG_GOLANG_BUILD_CACHE_DIR)),$(TOPDIR)/.go-build)