golang: do not rely on Go script host detection

for some use cases, for example:
a system with 64 bit kernel
and 32 bit userspace programs

the local Go installation is "detected"
using the kernel "uname",
causing build failure if they happen to differ

by adding the argument GOHOSTARCH using the corresponding make variable
it would be fully controlled in the openwrt git tree
based on the HOST_ARCH make variable.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
This commit is contained in:
Michael Pratt 2022-05-27 02:25:52 -04:00
parent b99164aff4
commit bb7c596028
1 changed files with 2 additions and 0 deletions

View File

@ -202,6 +202,7 @@ endif
$(eval $(call GoCompiler/AddProfile,Host,$(HOST_BUILD_DIR),$(HOST_GO_PREFIX),$(HOST_GO_VERSION_ID),$(GO_HOST_OS_ARCH),$(HOST_GO_INSTALL_SUFFIX)))
HOST_GO_VARS= \
GOHOSTARCH="$(GO_HOST_ARCH)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOENV=off \
CC="$(HOSTCC_NOCACHE)" \
@ -273,6 +274,7 @@ PKG_GO_ZBOOTSTRAP_MODS:= \
PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go
PKG_GO_VARS= \
GOHOSTARCH="$(GO_HOST_ARCH)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOENV=off \
GO_GCC_HELPER_PATH="$$$$PATH" \