golang: Optimized values to suit golang 1.23
authorMilinda Brantini <redacted>
Sun, 29 Sep 2024 15:36:35 +0000 (23:36 +0800)
committerTianling Shen <redacted>
Tue, 1 Oct 2024 10:18:11 +0000 (18:18 +0800)
Added GOARM64 and GORISCV64 in golang-build.sh.
Drop deprecated GOROOT_FINAL in GoCompiler/Default/Make.
Updated environment vars in golang-values.mk for GOARM64 and GORISCV64.
Refined host build in golang/Makefile for openbsd_riscv64.

Co-authored-by: Tianling Shen <redacted>
Signed-off-by: Milinda Brantini <redacted>
lang/golang/golang-build.sh
lang/golang/golang-compiler.mk
lang/golang/golang-values.mk
lang/golang/golang/Makefile

index fe8718ee761eb8f219bf7c48ba17ddfc96dee632..01df4aa427a5b865078a76a17f83cacd33ed7673 100644 (file)
@@ -120,7 +120,7 @@ build() {
        if [ "$GO_GO_GENERATE" = 1 ]; then
                log "Calling go generate"
                # shellcheck disable=SC2086
-               GOOS='' GOARCH='' GO386='' GOARM='' GOMIPS='' GOMIPS64='' \
+               GOOS='' GOARCH='' GO386='' GOARM='' GOARM64='' GOMIPS='' GOMIPS64='' GORISCV64=''\
                go generate -v $targets
                log
        fi
index 50cc44905165c81c99ca1ea00cf4d7a9255505bf..44defed7b4442af40e6bcb29b03988472d072ffb 100644 (file)
@@ -19,14 +19,11 @@ define GoCompiler/Default/CheckHost
 endef
 
 # $(1) source go root
-# $(2) destination prefix
-# $(3) go version id
-# $(4) additional environment variables (optional)
+# $(2) additional environment variables (optional)
 define GoCompiler/Default/Make
        ( \
                cd "$(1)/src" ; \
-               $(if $(2),GOROOT_FINAL="$(2)/lib/go-$(3)") \
-               $(4) \
+               $(2) \
                $(BASH) make.bash \
                $(if $(findstring s,$(OPENWRT_VERBOSE)),-v) \
                --no-banner \
@@ -156,7 +153,7 @@ define GoCompiler/AddProfile
 
   # $$(1) additional environment variables (optional)
   define GoCompiler/$(1)/Make
-       $$(call GoCompiler/Default/Make,$(2),$(3),$(4),$$(1))
+       $$(call GoCompiler/Default/Make,$(2),$$(1))
   endef
 
   # $$(1) override install prefix (optional)
index a2a10f04d33c260a11044e853a11ddbbcdc411c4..d57de5f3256cb2165fcefc85ba467bdd02ebc390 100644 (file)
@@ -59,11 +59,13 @@ unexport \
 # Architecture-specific environment variables:
 unexport \
   GOARM \
+  GOARM64 \
   GO386 \
   GOAMD64 \
   GOMIPS \
   GOMIPS64 \
   GOPPC64 \
+  GORISCV64 \
   GOWASM
 
 # Environment variables for use with code coverage:
index 601b320701dc3d7357d15465f7a1502507886dac..adc47a4361bae9fa3a3df8ea2c83f2f9b2f4ded3 100644 (file)
@@ -34,7 +34,6 @@ PKG_BUILD_FLAGS:=no-mips16
 
 PKG_GO_PREFIX:=/usr
 PKG_GO_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR)
-PKG_GO_ROOT:=$(PKG_GO_PREFIX)/lib/go-$(PKG_GO_VERSION_ID)
 
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/go-$(PKG_VERSION)
 HOST_BUILD_PARALLEL:=1
@@ -65,6 +64,7 @@ HOST_GO_VALID_OS_ARCH:= \
   wasip1_wasm \
   \
   freebsd_riscv64 \
+  openbsd_riscv64 \
   \
   linux_ppc64 linux_ppc64le \
   linux_mips linux_mipsle linux_mips64 linux_mips64le \
@@ -394,7 +394,6 @@ define Build/Compile
                cd "$(PKG_BUILD_DIR)/bin" ; \
                export $(GO_PKG_TARGET_VARS) ; \
                $(CP) go go-host ; \
-               GOROOT_FINAL="$(PKG_GO_ROOT)" \
                GO_GCC_HELPER_CC="$(TARGET_CC)" \
                GO_GCC_HELPER_CXX="$(TARGET_CXX)" \
                $(PKG_GO_VARS) \
git clone https://git.99rst.org/PROJECT