mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update golang and enable MPTCP by default
This commit is contained in:
parent
e22b863f26
commit
dfaa6ba1f0
5 changed files with 31 additions and 56 deletions
|
@ -213,7 +213,7 @@ GO_PKG_BUILD_VARS= \
|
|||
GOPATH="$(GO_PKG_BUILD_DIR)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOMODCACHE="$(GO_MOD_CACHE_DIR)" \
|
||||
GOENV=off
|
||||
GOENV=off GOPROXY="direct"
|
||||
|
||||
GO_PKG_VARS= \
|
||||
$(GO_PKG_TARGET_VARS) \
|
||||
|
|
|
@ -30,7 +30,7 @@ unexport \
|
|||
GOPATH \
|
||||
GOROOT \
|
||||
GOTMPDIR \
|
||||
GOWORK
|
||||
GOWORK GOPROXY
|
||||
# Unmodified:
|
||||
# GOINSECURE
|
||||
# GOPRIVATE
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
#GO_VERSION_MAJOR_MINOR:=1.20
|
||||
#GO_VERSION_PATCH:=3
|
||||
GO_VERSION_MAJOR_MINOR:=1.20
|
||||
GO_VERSION_PATCH:=3
|
||||
GO_VERSION_PATCH:=999
|
||||
|
||||
PKG_NAME:=golang
|
||||
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
|
||||
|
@ -18,9 +20,14 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
|
|||
https://mirrors.ustc.edu.cn/golang/ \
|
||||
https://mirrors.nju.edu.cn/golang/
|
||||
|
||||
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
|
||||
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
PKG_HASH:=e447b498cde50215c4f7619e5124b0fc4e25fb5d16ea47271c47f278e7aa763a
|
||||
#PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
|
||||
#PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
#PKG_HASH:=e447b498cde50215c4f7619e5124b0fc4e25fb5d16ea47271c47f278e7aa763a
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/golang/go.git
|
||||
PKG_SOURCE_VERSION:=a5350558e6e2db16bfe09f2ba8104549c6598c46
|
||||
PKG_SOURCE_DATE:=2023-05-05
|
||||
PKG_SOURCE_SUBDIR:=go-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
@ -100,7 +107,7 @@ include ../golang-compiler.mk
|
|||
include ../golang-package.mk
|
||||
|
||||
PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
HOST_UNPACK:=$(HOST_TAR) -C "$(HOST_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
#HOST_UNPACK:=$(HOST_TAR) -C "$(HOST_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
BOOTSTRAP_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_SOURCE)"
|
||||
BOOTSTRAP_1_17_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_1_17_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_1_17_SOURCE)"
|
||||
|
||||
|
@ -234,10 +241,13 @@ HOST_GO_VARS= \
|
|||
CXX="$(HOSTCXX_NOCACHE)"
|
||||
|
||||
define Host/Configure
|
||||
sed -i 's/1\.21/1.20/g' $(HOST_BUILD_DIR)/src/go.mod
|
||||
sed -i 's/21/20/g' $(HOST_BUILD_DIR)/src/internal/goversion/goversion.go
|
||||
$(call GoCompiler/Bootstrap/CheckHost,$(BOOTSTRAP_GO_VALID_OS_ARCH))
|
||||
$(call GoCompiler/Host/CheckHost,$(HOST_GO_VALID_OS_ARCH))
|
||||
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
echo "go$(PKG_VERSION)" > $(HOST_BUILD_DIR)/VERSION
|
||||
endef
|
||||
|
||||
define Host/Compile
|
||||
|
@ -334,12 +344,14 @@ PKG_GO_INSTALL_ARGS= \
|
|||
$(if $(filter $(GO_PKG_ENABLE_PIE),1),-buildmode pie)
|
||||
|
||||
define Build/Configure
|
||||
sed -i 's/1\.21/1.20/g' $(HOST_BUILD_DIR)/src/go.mod
|
||||
sed -i 's/21/20/g' $(HOST_BUILD_DIR)/src/internal/goversion/goversion.go
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
echo "go$(PKG_VERSION)" > $(PKG_BUILD_DIR)/VERSION
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo "Building target Go first stage"
|
||||
|
||||
$(call GoCompiler/Package/Make, \
|
||||
GOROOT_BOOTSTRAP="$(HOST_GO_ROOT)" \
|
||||
GO_GCC_HELPER_CC="$(HOSTCC)" \
|
||||
|
|
|
@ -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
|
||||
@@ -1535,25 +1535,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"
|
||||
}
|
||||
}
|
||||
}
|
11
golang/golang/patches/001-default-enable-mptcp.patch
Normal file
11
golang/golang/patches/001-default-enable-mptcp.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- a/src/net/dial.go 2023-05-06 10:33:54.275030044 +0200
|
||||
+++ b/src/net/dial.go 2023-05-06 10:34:29.218440686 +0200
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
// For the moment, MultiPath TCP is not used by default
|
||||
// See go.dev/issue/56539
|
||||
- defaultMPTCPEnabled = false
|
||||
+ defaultMPTCPEnabled = true
|
||||
)
|
||||
|
||||
// mptcpStatus is a tristate for Multipath TCP, see go.dev/issue/56539
|
Loading…
Add table
Add a link
Reference in a new issue