From: Michael Pratt Date: Fri, 27 May 2022 06:25:52 +0000 (-0400) Subject: golang: do not rely on Go script host detection X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=bb7c596028807bca6d9bc4c87e110560f2491a41;p=openwrt-packages.git 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 --- diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index c13025cfe..ad75dd165 100644 --- a/lang/golang/golang/Makefile +++ b/lang/golang/golang/Makefile @@ -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" \