Compare commits

..

43 Commits
19.x ... 25.x

Author SHA1 Message Date
gitea-action
654f5197b8 golang: bump to 1.25rc1 2025-06-17 15:00:17 +08:00
sbwml
bf6312a89f golang 1.25.x init
Signed-off-by: sbwml <admin@cooluc.com>
2025-06-17 14:58:17 +08:00
gitea-action
14bbacea4e golang: bump to 1.24.4 2025-06-06 03:00:15 +08:00
gitea-action
bf6b686752 golang: bump to 1.24.3 2025-05-07 03:00:16 +08:00
gitea-action
d0f586b961 golang: bump to 1.24.2 2025-04-02 01:00:23 +08:00
gitea-action
6fe3dcc385 golang: bump to 1.24.1 2025-03-05 04:00:19 +08:00
Bard
2487aedb45
Update README.md 2025-02-28 20:23:12 +08:00
sbwml
c2a6fcc272 golang: bump to 1.24.0
Signed-off-by: sbwml <admin@cooluc.com>
2025-02-26 20:28:51 +08:00
gitea-action
555474c3eb golang: bump to 1.23.6 2025-02-05 01:00:17 +08:00
gitea-action
d5df07f591 golang: bump to 1.23.5 2025-01-17 05:00:26 +08:00
gitea-action
7a80f55817 golang: bump to 1.23.4 2024-12-04 03:00:18 +08:00
gitea-action
34ff63baba golang: bump to 1.23.3 2024-11-07 07:00:23 +08:00
gitea-action
65120f6a29 golang: bump to 1.23.2
Signed-off-by: gitea-action <git@cooluc.com>
2024-10-02 08:48:05 +08:00
sbwml
6b97afc8da golang: bump to 1.23.1 2024-09-06 00:00:27 +08:00
sbwml
fb7c0c512b golang: bump to 1.23.0 2024-08-14 02:18:45 +08:00
sbwml
dc76eb7ec9 golang: bump to 1.23rc2
Signed-off-by: sbwml <admin@cooluc.com>
2024-07-28 01:37:36 +08:00
actions
ed2c530698 golang: bump to 1.22.5 2024-07-03 04:00:19 +08:00
actions
5f47662dbb golang: bump to 1.22.4 2024-06-05 06:05:06 +08:00
actions
f82d4dde52 golang: bump to 1.22.3 2024-05-08 06:05:07 +08:00
actions
de98b9b6d3 golang: bump to 1.22.2 2024-04-04 00:05:07 +08:00
actions
e61be40a34 golang: bump to 1.22.1 2024-03-06 06:14:04 +08:00
actions
8af50ec406 golang: bump to 1.22.0
Signed-off-by: actions <action@github.com>
2024-02-26 11:01:22 +08:00
actions
5f1e7e6d6f golang: bump to 1.21.7 2024-02-07 06:00:06 +08:00
actions
cf0f4c1239 golang: bump to 1.21.6 2024-01-10 06:00:06 +08:00
actions
38b8096a81 golang: bump to 1.21.5 2023-12-06 06:00:07 +08:00
actions
e9dfb8bb01 golang: bump to 1.21.4 2023-11-08 06:00:07 +08:00
actions
41cefb9566 golang: bump to 1.21.3 2023-10-11 06:00:06 +08:00
Bard
034d17a98a
golang: bump to 1.21.2 2023-10-07 07:44:17 -05:00
sbwml
1bf93c9a6f update from upstream 2023-09-15 04:08:12 +08:00
Bard
e04d714126
golang: bump to 1.21.1 2023-09-07 02:29:25 +08:00
sbwml
584b340de9 golang: bump to 1.21.0 2023-08-19 10:40:13 +08:00
Bard
a329fe126e
golang: bump to 1.20.7 2023-08-05 08:25:13 +08:00
Bard
ff07745507
golang: bump to 1.20.6 2023-07-19 17:51:10 +08:00
Bard
584c3c9044
golang: bump to 1.20.5 2023-06-08 07:42:01 +08:00
Bard
51b4eb29db
golang: bump to 1.20.4 2023-05-13 16:25:53 +08:00
Bard
95bb90611c
golang: bump to 1.20.3 2023-04-14 15:52:24 +08:00
sbwml
56b6d276da svn -> git 2023-03-23 04:25:09 +08:00
sbwml
654787fe39 bootstrap: add BOOTSTRAP_HASH 2023-03-23 04:23:05 +08:00
Bard
b8364d8e2b
golang 1.20.2 2023-03-14 17:36:35 +08:00
Bard
65fd70b810
golang: bump to 1.20.1 2023-02-21 02:44:53 +08:00
sbwml
4d5f77bd76 bump to golang 1.20 2023-02-03 23:06:22 +08:00
Bard
d8d5e05fa4
golang 1.19.5 2023-01-20 11:07:20 +08:00
Bard
3bfbdf1622
golang 1.19.4 2022-12-10 17:51:42 +08:00
8 changed files with 69 additions and 89 deletions

View File

@ -2,7 +2,9 @@
## How to use? ## How to use?
After the `./scripts/feeds install -a` operation is completed, execute the following command:
```shell ```shell
rm -rf feeds/packages/lang/golang rm -rf feeds/packages/lang/golang
git clone https://github.com/sbwml/packages_lang_golang -b 19.x feeds/packages/lang/golang git clone https://github.com/sbwml/packages_lang_golang -b 25.x feeds/packages/lang/golang
``` ```

8
golang-build.sh Normal file → Executable file
View File

@ -1,4 +1,10 @@
#!/bin/sh #!/bin/sh
#
# Copyright (C) 2020, 2022 Jeffery To
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
nl=" nl="
" "
@ -114,7 +120,7 @@ build() {
if [ "$GO_GO_GENERATE" = 1 ]; then if [ "$GO_GO_GENERATE" = 1 ]; then
log "Calling go generate" log "Calling go generate"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
GOOS='' GOARCH='' GO386='' GOARM='' GOMIPS='' GOMIPS64='' \ GOOS='' GOARCH='' GO386='' GOARM='' GOARM64='' GOMIPS='' GOMIPS64='' GORISCV64=''\
go generate -v $targets go generate -v $targets
log log
fi fi

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2018, 2020 Jeffery To # Copyright (C) 2018, 2020-2021, 2023 Jeffery To
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -19,15 +19,15 @@ define GoCompiler/Default/CheckHost
endef endef
# $(1) source go root # $(1) source go root
# $(2) destination prefix # $(2) additional environment variables (optional)
# $(3) go version id
# $(4) additional environment variables (optional)
define GoCompiler/Default/Make define GoCompiler/Default/Make
( \ ( \
cd "$(1)/src" ; \ cd "$(1)/src" ; \
$(if $(2),GOROOT_FINAL="$(2)/lib/go-$(3)") \ $(2) \
$(4) \ $(BASH) make.bash \
$(BASH) make.bash --no-banner ; \ $(if $(findstring s,$(OPENWRT_VERBOSE)),-v) \
--no-banner \
; \
) )
endef endef
@ -57,9 +57,10 @@ define GoCompiler/Default/Install/Bin
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),api) $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),api)
$(INSTALL_DATA) -p "$(1)/go.env" "$(2)/lib/go-$(3)/"
$(INSTALL_DATA) -p "$(1)/VERSION" "$(2)/lib/go-$(3)/" $(INSTALL_DATA) -p "$(1)/VERSION" "$(2)/lib/go-$(3)/"
for file in AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE PATENTS README.md SECURITY.md; do \ for file in CONTRIBUTING.md LICENSE PATENTS README.md SECURITY.md; do \
if [ -f "$(1)/$$$$file" ]; then \ if [ -f "$(1)/$$$$file" ]; then \
$(INSTALL_DATA) -p "$(1)/$$$$file" "$(2)/share/go-$(3)/" ; \ $(INSTALL_DATA) -p "$(1)/$$$$file" "$(2)/share/go-$(3)/" ; \
fi ; \ fi ; \
@ -73,8 +74,10 @@ define GoCompiler/Default/Install/Bin
$(INSTALL_BIN) -p "$(1)/bin/$(4)"/* "$(2)/lib/go-$(3)/bin/" $(INSTALL_BIN) -p "$(1)/bin/$(4)"/* "$(2)/lib/go-$(3)/bin/"
endif endif
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" if [ -d "$(1)/pkg/$(4)$(if $(5),_$(5))" ]; then \
$(CP) "$(1)/pkg/$(4)$(if $(5),_$(5))" "$(2)/lib/go-$(3)/pkg/" $(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" ; \
$(CP) "$(1)/pkg/$(4)$(if $(5),_$(5))" "$(2)/lib/go-$(3)/pkg/" ; \
fi
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg/tool/$(4)" $(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg/tool/$(4)"
$(INSTALL_BIN) -p "$(1)/pkg/tool/$(4)"/* "$(2)/lib/go-$(3)/pkg/tool/$(4)/" $(INSTALL_BIN) -p "$(1)/pkg/tool/$(4)"/* "$(2)/lib/go-$(3)/pkg/tool/$(4)/"
@ -150,7 +153,7 @@ define GoCompiler/AddProfile
# $$(1) additional environment variables (optional) # $$(1) additional environment variables (optional)
define GoCompiler/$(1)/Make define GoCompiler/$(1)/Make
$$(call GoCompiler/Default/Make,$(2),$(3),$(4),$$(1)) $$(call GoCompiler/Default/Make,$(2),$$(1))
endef endef
# $$(1) override install prefix (optional) # $$(1) override install prefix (optional)

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2020 Jeffery To # Copyright (C) 2020, 2022 Jeffery To
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2018-2020 Jeffery To # Copyright (C) 2018-2022 Jeffery To
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -215,7 +215,8 @@ GO_PKG_BUILD_VARS= \
GOPATH="$(GO_PKG_BUILD_DIR)" \ GOPATH="$(GO_PKG_BUILD_DIR)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \ GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOMODCACHE="$(GO_MOD_CACHE_DIR)" \ GOMODCACHE="$(GO_MOD_CACHE_DIR)" \
GOENV=off GOENV=off \
GOTOOLCHAIN=local
GO_PKG_VARS= \ GO_PKG_VARS= \
$(GO_PKG_TARGET_VARS) \ $(GO_PKG_TARGET_VARS) \

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2018, 2020 Jeffery To # Copyright (C) 2018-2023 Jeffery To
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -29,6 +29,7 @@ unexport \
GOOS \ GOOS \
GOPATH \ GOPATH \
GOROOT \ GOROOT \
GOTOOLCHAIN \
GOTMPDIR \ GOTMPDIR \
GOWORK GOWORK
# Unmodified: # Unmodified:
@ -58,13 +59,19 @@ unexport \
# Architecture-specific environment variables: # Architecture-specific environment variables:
unexport \ unexport \
GOARM \ GOARM \
GOARM64 \
GO386 \ GO386 \
GOAMD64 \ GOAMD64 \
GOMIPS \ GOMIPS \
GOMIPS64 \ GOMIPS64 \
GOPPC64 \ GOPPC64 \
GORISCV64 \
GOWASM GOWASM
# Environment variables for use with code coverage:
unexport \
GOCOVERDIR
# Special-purpose environment variables: # Special-purpose environment variables:
unexport \ unexport \
GCCGOTOOLDIR \ GCCGOTOOLDIR \
@ -77,6 +84,7 @@ unexport \
# From https://pkg.go.dev/runtime#hdr-Environment_Variables # From https://pkg.go.dev/runtime#hdr-Environment_Variables
unexport \ unexport \
GOGC \ GOGC \
GOMEMLIMIT \
GOMAXPROCS \ GOMAXPROCS \
GORACE \ GORACE \
GOTRACEBACK GOTRACEBACK
@ -122,10 +130,11 @@ unexport \
go_arch=$(subst \ go_arch=$(subst \
aarch64,arm64,$(subst \ aarch64,arm64,$(subst \
i386,386,$(subst \ i386,386,$(subst \
loongarch64,loong64,$(subst \
mipsel,mipsle,$(subst \ mipsel,mipsle,$(subst \
mips64el,mips64le,$(subst \ mips64el,mips64le,$(subst \
powerpc64,ppc64,$(subst \ powerpc64,ppc64,$(subst \
x86_64,amd64,$(1))))))) x86_64,amd64,$(1))))))))
GO_OS:=linux GO_OS:=linux
GO_ARCH:=$(call go_arch,$(ARCH)) GO_ARCH:=$(call go_arch,$(ARCH))
@ -196,17 +205,16 @@ endif
# Target Go # Target Go
GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||powerpc64||x86_64) GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||loongarch64||mips||mips64||mips64el||mipsel||powerpc64||riscv64||x86_64)
# ASLR/PIE # ASLR/PIE
# From https://go.dev/src/cmd/internal/sys/supported.go # From https://go.dev/src/internal/platform/supported.go
GO_PIE_SUPPORTED_OS_ARCH:= \ GO_PIE_SUPPORTED_OS_ARCH:= \
android_386 android_amd64 android_arm android_arm64 \ android_386 android_amd64 android_arm android_arm64 \
linux_386 linux_amd64 linux_arm linux_arm64 \ linux_386 linux_amd64 linux_arm linux_arm64 \
\ windows_386 windows_amd64 windows_arm windows_arm64 \
windows_386 windows_amd64 windows_arm \
\ \
darwin_amd64 darwin_arm64 \ darwin_amd64 darwin_arm64 \
ios_amd64 ios_arm64 \ ios_amd64 ios_arm64 \
@ -215,10 +223,10 @@ GO_PIE_SUPPORTED_OS_ARCH:= \
\ \
aix_ppc64 \ aix_ppc64 \
\ \
linux_ppc64le linux_riscv64 linux_s390x linux_loong64 linux_ppc64le linux_riscv64 linux_s390x
# From https://go.dev/src/cmd/go/internal/work/init.go # From https://go.dev/src/cmd/go/internal/work/init.go
go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm),,shared) go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm windows_arm64),,shared)
ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),) ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
GO_HOST_PIE_SUPPORTED:=1 GO_HOST_PIE_SUPPORTED:=1

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2018, 2020 Jeffery To # Copyright (C) 2018-2023 Jeffery To
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
GO_VERSION_MAJOR_MINOR:=1.19 GO_VERSION_MAJOR_MINOR:=1.25rc1
GO_VERSION_PATCH:=12 GO_VERSION_PATCH:=
PKG_NAME:=golang PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS) PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=ee5d50e0a7fd74ba1b137cb879609aaaef9880bf72b5d1742100e38ae72bb557 PKG_HASH:=0cd6772fe133a784fbb7a09d6da3089897fef48d03a21721434bf88188a58629
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com> PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
@ -30,11 +30,10 @@ PKG_CPE_ID:=cpe:/a:golang:go
PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_DIR:=$(BUILD_DIR)/go-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/go-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0 PKG_BUILD_FLAGS:=no-mips16
PKG_GO_PREFIX:=/usr PKG_GO_PREFIX:=/usr
PKG_GO_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR) 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_DIR:=$(BUILD_DIR_HOST)/go-$(PKG_VERSION)
HOST_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1
@ -62,16 +61,29 @@ HOST_GO_VALID_OS_ARCH:= \
\ \
aix_ppc64 \ aix_ppc64 \
js_wasm \ js_wasm \
wasip1_wasm \
\
freebsd_riscv64 \
openbsd_riscv64 \
\ \
linux_ppc64 linux_ppc64le \ linux_ppc64 linux_ppc64le \
linux_mips linux_mipsle linux_mips64 linux_mips64le \ linux_mips linux_mipsle linux_mips64 linux_mips64le \
linux_riscv64 linux_s390x \ linux_loong64 linux_riscv64 linux_s390x \
\ \
openbsd_mips64 openbsd_mips64
BOOTSTRAP_SOURCE:=go1.4-bootstrap-20171003.tar.gz ifeq ($(HOST_ARCH),x86_64)
PKG_ARCH:=amd64
BOOTSTRAP_HASH:=999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616
endif
ifeq ($(HOST_ARCH),aarch64)
PKG_ARCH:=arm64
BOOTSTRAP_HASH:=c15fa895341b8eaf7f219fada25c36a610eb042985dc1a912410c1c90098eaf2
endif
BOOTSTRAP_SOURCE:=go1.22.6.linux-$(PKG_ARCH).tar.gz
BOOTSTRAP_SOURCE_URL:=$(GO_SOURCE_URLS) BOOTSTRAP_SOURCE_URL:=$(GO_SOURCE_URLS)
BOOTSTRAP_HASH:=f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52
BOOTSTRAP_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap BOOTSTRAP_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap
@ -181,8 +193,7 @@ ifeq ($(BOOTSTRAP_ROOT_DIR),)
$(eval $(call Download,golang-bootstrap)) $(eval $(call Download,golang-bootstrap))
define Bootstrap/Prepare define Bootstrap/Prepare
mkdir -p "$(BOOTSTRAP_BUILD_DIR)" mkdir -p "$(BOOTSTRAP_BUILD_DIR)" && $(BOOTSTRAP_UNPACK) ;
$(BOOTSTRAP_UNPACK)
endef endef
Hooks/HostPrepare/Post+=Bootstrap/Prepare Hooks/HostPrepare/Post+=Bootstrap/Prepare
@ -202,6 +213,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))) $(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= \ HOST_GO_VARS= \
GOHOSTARCH="$(GO_HOST_ARCH)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \ GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOENV=off \ GOENV=off \
CC="$(HOSTCC_NOCACHE)" \ CC="$(HOSTCC_NOCACHE)" \
@ -213,10 +225,6 @@ define Host/Compile
mkdir -p "$(GO_BUILD_CACHE_DIR)" mkdir -p "$(GO_BUILD_CACHE_DIR)"
$(call GoCompiler/Bootstrap/Make, \
$(HOST_GO_VARS) \
)
$(call GoCompiler/Host/Make, \ $(call GoCompiler/Host/Make, \
GOROOT_BOOTSTRAP="$(BOOTSTRAP_ROOT_DIR)" \ GOROOT_BOOTSTRAP="$(BOOTSTRAP_ROOT_DIR)" \
$(if $(HOST_GO_ENABLE_PIE),GO_LDFLAGS="-buildmode pie") \ $(if $(HOST_GO_ENABLE_PIE),GO_LDFLAGS="-buildmode pie") \
@ -263,7 +271,7 @@ $(eval $(call GoCompiler/AddProfile,Package,$(PKG_BUILD_DIR),$(PKG_GO_PREFIX),$(
PKG_GO_ZBOOTSTRAP_MODS:= \ PKG_GO_ZBOOTSTRAP_MODS:= \
s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \ s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \
s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \ s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \
s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),5)`/; \ s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),7)`/; \
s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \ s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \ s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/; s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/;
@ -271,6 +279,7 @@ PKG_GO_ZBOOTSTRAP_MODS:= \
PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go
PKG_GO_VARS= \ PKG_GO_VARS= \
GOHOSTARCH="$(GO_HOST_ARCH)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \ GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOENV=off \ GOENV=off \
GO_GCC_HELPER_PATH="$$$$PATH" \ GO_GCC_HELPER_PATH="$$$$PATH" \
@ -330,7 +339,6 @@ define Build/Compile
cd "$(PKG_BUILD_DIR)/bin" ; \ cd "$(PKG_BUILD_DIR)/bin" ; \
export $(GO_PKG_TARGET_VARS) ; \ export $(GO_PKG_TARGET_VARS) ; \
$(CP) go go-host ; \ $(CP) go go-host ; \
GOROOT_FINAL="$(PKG_GO_ROOT)" \
GO_GCC_HELPER_CC="$(TARGET_CC)" \ GO_GCC_HELPER_CC="$(TARGET_CC)" \
GO_GCC_HELPER_CXX="$(TARGET_CXX)" \ GO_GCC_HELPER_CXX="$(TARGET_CXX)" \
$(PKG_GO_VARS) \ $(PKG_GO_VARS) \

View File

@ -1,48 +0,0 @@
From 5ccf9f47bf4f5ba53e0ab7338a7fd4626714cfb2 Mon Sep 17 00:00:00 2001
From: Jeffery To <jeffery.to@gmail.com>
Date: Tue, 23 Nov 2021 15:05:37 +0800
Subject: [PATCH] cmd/link: use gold on ARM/ARM64 only if gold is available
COPY relocation handling on ARM/ARM64 has been fixed in recent versions
of the GNU linker. This switches to gold only if gold is available.
Fixes #22040.
---
src/cmd/link/internal/ld/lib.go | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1393,25 +1393,20 @@ func (ctxt *Link) hostlink() {
}
if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" {
- // On ARM, the GNU linker will generate COPY relocations
- // even with -znocopyreloc set.
+ // On ARM, older versions of the GNU linker will generate
+ // COPY relocations even with -znocopyreloc set.
// https://sourceware.org/bugzilla/show_bug.cgi?id=19962
//
- // On ARM64, the GNU linker will fail instead of
- // generating COPY relocations.
+ // On ARM64, older versions of the GNU linker will fail
+ // instead of generating COPY relocations.
//
- // In both cases, switch to gold.
- altLinker = "gold"
-
- // If gold is not installed, gcc will silently switch
- // back to ld.bfd. So we parse the version information
- // and provide a useful error if gold is missing.
+ // In both cases, switch to gold if gold is available.
name, args := flagExtld[0], flagExtld[1:]
args = append(args, "-fuse-ld=gold", "-Wl,--version")
cmd := exec.Command(name, args...)
if out, err := cmd.CombinedOutput(); err == nil {
- if !bytes.Contains(out, []byte("GNU gold")) {
- log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out)
+ if bytes.Contains(out, []byte("GNU gold")) {
+ altLinker = "gold"
}
}
}