Browse Source

golang: Update to 1.17

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lilik-openwrt-22.03
Jeffery To 3 years ago
parent
commit
d0aab6b8bc
No known key found for this signature in database GPG Key ID: C616D9E719E868E4
3 changed files with 25 additions and 19 deletions
  1. +0
    -2
      lang/golang/golang-compiler.mk
  2. +8
    -11
      lang/golang/golang-values.mk
  3. +17
    -6
      lang/golang/golang/Makefile

+ 0
- 2
lang/golang/golang-compiler.mk View File

@ -95,8 +95,6 @@ define GoCompiler/Default/Install/Doc
$(call GoCompiler/Default/Install/make-dirs,$(2),$(3)) $(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc) $(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc)
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),favicon.ico)
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),robots.txt)
endef endef
# $(1) source go root # $(1) source go root


+ 8
- 11
lang/golang/golang-values.mk View File

@ -13,10 +13,11 @@ endif
# Unset environment variables # Unset environment variables
# There are more magic variables to track down, but ain't nobody got time for that # There are more magic variables to track down, but ain't nobody got time for that
# From https://golang.org/cmd/go/#hdr-Environment_variables
# From https://pkg.go.dev/cmd/go#hdr-Environment_variables
# General-purpose environment variables: # General-purpose environment variables:
unexport \ unexport \
GO111MODULE \
GCCGO \ GCCGO \
GOARCH \ GOARCH \
GOBIN \ GOBIN \
@ -64,23 +65,20 @@ unexport \
# Special-purpose environment variables: # Special-purpose environment variables:
unexport \ unexport \
GCCGOTOOLDIR \ GCCGOTOOLDIR \
GOEXPERIMENT \
GOROOT_FINAL \ GOROOT_FINAL \
GO_EXTLINK_ENABLED GO_EXTLINK_ENABLED
# Unmodified: # Unmodified:
# GIT_ALLOW_PROTOCOL # GIT_ALLOW_PROTOCOL
# From https://golang.org/cmd/go/#hdr-Module_support
unexport \
GO111MODULE
# From https://golang.org/pkg/runtime/#hdr-Environment_Variables
# From https://pkg.go.dev/runtime#hdr-Environment_Variables
unexport \ unexport \
GOGC \ GOGC \
GOMAXPROCS \ GOMAXPROCS \
GORACE \ GORACE \
GOTRACEBACK GOTRACEBACK
# From https://golang.org/cmd/cgo/#hdr-Using_cgo_with_the_go_command
# From https://pkg.go.dev/cmd/cgo#hdr-Using_cgo_with_the_go_command
unexport \ unexport \
CC_FOR_TARGET \ CC_FOR_TARGET \
CXX_FOR_TARGET CXX_FOR_TARGET
@ -112,10 +110,6 @@ unexport \
BOOT_GO_GCFLAGS \ BOOT_GO_GCFLAGS \
BOOT_GO_LDFLAGS BOOT_GO_LDFLAGS
# From https://golang.org/src/cmd/dist/buildruntime.go
unexport \
GOEXPERIMENT
# From https://golang.org/src/cmd/dist/buildtool.go # From https://golang.org/src/cmd/dist/buildtool.go
unexport \ unexport \
GOBOOTSTRAP_TOOLEXEC GOBOOTSTRAP_TOOLEXEC
@ -199,6 +193,7 @@ GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||pow
# ASLR/PIE # ASLR/PIE
# From https://golang.org/src/cmd/internal/sys/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 \
@ -206,6 +201,7 @@ GO_PIE_SUPPORTED_OS_ARCH:= \
windows_386 windows_amd64 windows_arm \ windows_386 windows_amd64 windows_arm \
\ \
darwin_amd64 darwin_arm64 \ darwin_amd64 darwin_arm64 \
ios_amd64 ios_arm64 \
\ \
freebsd_amd64 \ freebsd_amd64 \
\ \
@ -213,6 +209,7 @@ GO_PIE_SUPPORTED_OS_ARCH:= \
\ \
linux_ppc64le linux_riscv64 linux_s390x linux_ppc64le linux_riscv64 linux_s390x
# From https://golang.org/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),,shared)
ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),) ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)


+ 17
- 6
lang/golang/golang/Makefile View File

@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
GO_VERSION_MAJOR_MINOR:=1.16
GO_VERSION_PATCH:=7
GO_VERSION_MAJOR_MINOR:=1.17
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:=1a9f2894d3d878729f7045072f30becebe243524cf2fce4e0a7b248b1e0654ac
PKG_HASH:=3a70e5055509f347c0fb831ca07a2bf3b531068f349b14a3c652e9b5b67beb5d
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
@ -49,9 +49,9 @@ HOST_GO_VALID_OS_ARCH:= \
linux_386 linux_amd64 linux_arm linux_arm64 \ linux_386 linux_amd64 linux_arm linux_arm64 \
openbsd_386 openbsd_amd64 openbsd_arm openbsd_arm64 \ openbsd_386 openbsd_amd64 openbsd_arm openbsd_arm64 \
netbsd_386 netbsd_amd64 netbsd_arm netbsd_arm64 \ netbsd_386 netbsd_amd64 netbsd_arm netbsd_arm64 \
windows_386 windows_amd64 windows_arm windows_arm64 \
\ \
plan9_386 plan9_amd64 plan9_arm \ plan9_386 plan9_amd64 plan9_arm \
windows_386 windows_amd64 windows_arm \
\ \
darwin_amd64 darwin_arm64 \ darwin_amd64 darwin_arm64 \
ios_amd64 ios_arm64 \ ios_amd64 ios_arm64 \
@ -267,6 +267,8 @@ PKG_GO_ZBOOTSTRAP_MODS:= \
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \ s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `power8`/; s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `power8`/;
PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go
PKG_GO_VARS= \ PKG_GO_VARS= \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \ GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOENV=off \ GOENV=off \
@ -309,8 +311,17 @@ define Build/Compile
$(PKG_GO_VARS) \ $(PKG_GO_VARS) \
) )
$(SED) '$(PKG_GO_ZBOOTSTRAP_MODS)' \
"$(PKG_BUILD_DIR)/src/cmd/internal/objabi/zbootstrap.go"
$(SED) '$(PKG_GO_ZBOOTSTRAP_MODS)' "$(PKG_GO_ZBOOTSTRAP_PATH)"
( \
if echo 'int main() { return 0; }' | $(TARGET_CC) -o $(PKG_BUILD_DIR)/test-ldso -x c - > /dev/null 2>&1; then \
LDSO=$$$$( \
readelf -l $(PKG_BUILD_DIR)/test-ldso | \
sed -n -e 's/^.*interpreter: \(.*\)[]]/\1/p' \
) ; \
fi ; \
$(SED) "s,defaultGO_LDSO = \`[^\`]*\`,defaultGO_LDSO = \`$$$$LDSO\`," "$(PKG_GO_ZBOOTSTRAP_PATH)" ; \
)
@echo "Building target Go second stage" @echo "Building target Go second stage"


Loading…
Cancel
Save