From bb7c596028807bca6d9bc4c87e110560f2491a41 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 27 May 2022 02:25:52 -0400 Subject: [PATCH] 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 --- lang/golang/golang/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index c13025cfee..ad75dd165f 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" \