summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 13:14:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 13:14:25 +0000
commit398739326c6a75c0e091cb7be0df48f4a813a4f5 (patch)
treebc890762d77f42f8840c214c1a1b8f70060e6308 /debian/patches
parentAdding upstream version 1.16.10. (diff)
downloadgolang-1.16-398739326c6a75c0e091cb7be0df48f4a813a4f5.tar.xz
golang-1.16-398739326c6a75c0e091cb7be0df48f4a813a4f5.zip
Adding debian version 1.16.10-1.debian/1.16.10-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-Disable-test-for-UserHomeDir.patch22
-rw-r--r--debian/patches/0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch99
-rw-r--r--debian/patches/0003-cmd-go-cmd-cgo-pass-mfp32-and-mhard-soft-float-to-MI.patch100
-rw-r--r--debian/patches/0005-cmd-dist-increase-default-timeout-scale-for-arm.patch29
-rw-r--r--debian/patches/0006-skip-userns-test-in-schroot-as-well.patch35
-rw-r--r--debian/patches/series5
6 files changed, 290 insertions, 0 deletions
diff --git a/debian/patches/0001-Disable-test-for-UserHomeDir.patch b/debian/patches/0001-Disable-test-for-UserHomeDir.patch
new file mode 100644
index 0000000..9be557a
--- /dev/null
+++ b/debian/patches/0001-Disable-test-for-UserHomeDir.patch
@@ -0,0 +1,22 @@
+From: "Dr. Tobias Quathamer" <toddy@debian.org>
+Date: Wed, 19 Dec 2018 14:25:06 +0100
+Subject: Disable test for UserHomeDir.
+
+On Debian buildds, the user home dir does not exist, so this test fails.
+---
+ src/os/os_test.go | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/os/os_test.go b/src/os/os_test.go
+index e8c6451..8485c85 100644
+--- a/src/os/os_test.go
++++ b/src/os/os_test.go
+@@ -2446,6 +2446,8 @@ func TestUserHomeDir(t *testing.T) {
+ if err != nil {
+ t.Skipf("UserHomeDir failed: %v", err)
+ }
++ // On Debian buildds, the user home dir does not exist.
++ t.Skip("UserHomeDir does not exist on Debian buildds.")
+ fi, err := Stat(dir)
+ if err != nil {
+ t.Fatal(err)
diff --git a/debian/patches/0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch b/debian/patches/0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch
new file mode 100644
index 0000000..c1813ea
--- /dev/null
+++ b/debian/patches/0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch
@@ -0,0 +1,99 @@
+From: "Dr. Tobias Quathamer" <toddy@debian.org>
+Date: Thu, 1 Aug 2019 13:50:48 +0200
+Subject: Fix Lintian warnings about wrong interpreter path
+
+The command used for this change is as follows:
+
+grep -rH "/usr/bin/env perl" * | cut -d: -f1 | xargs -n1 sed -i -e "s,/usr/bin/env perl,/usr/bin/perl,"
+---
+ src/syscall/mksyscall.pl | 2 +-
+ src/syscall/mksyscall_libc.pl | 2 +-
+ src/syscall/mksysctl_openbsd.pl | 2 +-
+ src/syscall/mksysnum_darwin.pl | 2 +-
+ src/syscall/mksysnum_dragonfly.pl | 2 +-
+ src/syscall/mksysnum_freebsd.pl | 2 +-
+ src/syscall/mksysnum_linux.pl | 2 +-
+ src/syscall/mksysnum_netbsd.pl | 2 +-
+ src/syscall/mksysnum_openbsd.pl | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/syscall/mksyscall.pl b/src/syscall/mksyscall.pl
+index 25b40d7..007d03c 100755
+--- a/src/syscall/mksyscall.pl
++++ b/src/syscall/mksyscall.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksyscall_libc.pl b/src/syscall/mksyscall_libc.pl
+index 5ceedc8..405033c 100755
+--- a/src/syscall/mksyscall_libc.pl
++++ b/src/syscall/mksyscall_libc.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksysctl_openbsd.pl b/src/syscall/mksysctl_openbsd.pl
+index ea462a7..7e8a3e2 100755
+--- a/src/syscall/mksysctl_openbsd.pl
++++ b/src/syscall/mksysctl_openbsd.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+
+ # Copyright 2011 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+diff --git a/src/syscall/mksysnum_dragonfly.pl b/src/syscall/mksysnum_dragonfly.pl
+index e9a634b..a8df18d 100755
+--- a/src/syscall/mksysnum_dragonfly.pl
++++ b/src/syscall/mksysnum_dragonfly.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksysnum_freebsd.pl b/src/syscall/mksysnum_freebsd.pl
+index c04ada9..f9b7b91 100755
+--- a/src/syscall/mksysnum_freebsd.pl
++++ b/src/syscall/mksysnum_freebsd.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksysnum_linux.pl b/src/syscall/mksysnum_linux.pl
+index 5fb1d0e..ebeb9a8 100755
+--- a/src/syscall/mksysnum_linux.pl
++++ b/src/syscall/mksysnum_linux.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksysnum_netbsd.pl b/src/syscall/mksysnum_netbsd.pl
+index 4f5150a..53783ff 100755
+--- a/src/syscall/mksysnum_netbsd.pl
++++ b/src/syscall/mksysnum_netbsd.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+diff --git a/src/syscall/mksysnum_openbsd.pl b/src/syscall/mksysnum_openbsd.pl
+index 0b0c9df..41e8f47 100755
+--- a/src/syscall/mksysnum_openbsd.pl
++++ b/src/syscall/mksysnum_openbsd.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ # Copyright 2009 The Go Authors. All rights reserved.
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
diff --git a/debian/patches/0003-cmd-go-cmd-cgo-pass-mfp32-and-mhard-soft-float-to-MI.patch b/debian/patches/0003-cmd-go-cmd-cgo-pass-mfp32-and-mhard-soft-float-to-MI.patch
new file mode 100644
index 0000000..ba0e33c
--- /dev/null
+++ b/debian/patches/0003-cmd-go-cmd-cgo-pass-mfp32-and-mhard-soft-float-to-MI.patch
@@ -0,0 +1,100 @@
+From: YunQiang Su <wzssyqa@gmail.com>
+Date: Tue, 9 Jun 2020 04:09:58 +0000
+Subject: cmd/go, cmd/cgo: pass -mfp32 and -mhard/soft-float to MIPS GCC
+
+For mips32 currently, we are using FP32, while the gcc may be FPXX,
+which may generate .MIPS.abiflags and .gnu.attributes section with
+value as FPXX. So the kernel will treat the exe as FPXX, and may
+choose to use FR=1 FPU mode for it.
+Currently, in Go, we use 2 lwc1 to load both half of a double value
+to a pair of even-odd FPR. This behavior can only work with FR=0 mode.
+
+In FR=1 mode, all of 32 FPR are 64bit. If we lwc1 the high-half of a double
+value to an odd FPR, and try to use the previous even FPR to compute, the
+real high-half of even FPR will be unpredicatable.
+We set -mfp32 to force the gcc generate FP32 code and section value.
+
+More details about FP32/FPXX/FP64 are explained in:
+https://web.archive.org/web/20180828210612/https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
+
+When GOMIPS/GOMIPS64 is set as softfloat, we should also pass
+ -msoft-float to gcc.
+
+Here we also add -mno-odd-spreg option, since Loongson's CPU cannot use
+odd-number FR in FR=0 mode.
+
+Fixes #39435
+
+Change-Id: I54026ad416a815fe43a9261ebf6d02e5519c3930
+---
+ src/cmd/cgo/gcc.go | 12 ++++++++++--
+ src/cmd/cgo/main.go | 4 +++-
+ src/cmd/go/internal/work/exec.go | 14 ++++++++++++--
+ 3 files changed, 25 insertions(+), 5 deletions(-)
+
+--- a/src/cmd/cgo/gcc.go
++++ b/src/cmd/cgo/gcc.go
+@@ -1566,9 +1566,17 @@
+ case "s390x":
+ return []string{"-m64"}
+ case "mips64", "mips64le":
+- return []string{"-mabi=64"}
++ if gomips64 == "hardfloat" {
++ return []string{"-mabi=64", "-mhard-float"}
++ } else if gomips64 == "softfloat" {
++ return []string{"-mabi=64", "-msoft-float"}
++ }
+ case "mips", "mipsle":
+- return []string{"-mabi=32"}
++ if gomips == "hardfloat" {
++ return []string{"-mabi=32", "-mfp32", "-mhard-float", "-mno-odd-spreg"}
++ } else if gomips == "softfloat" {
++ return []string{"-mabi=32", "-msoft-float"}
++ }
+ }
+ return nil
+ }
+--- a/src/cmd/cgo/main.go
++++ b/src/cmd/cgo/main.go
+@@ -245,7 +245,7 @@
+ var importSyscall = flag.Bool("import_syscall", true, "import syscall in generated code")
+ var trimpath = flag.String("trimpath", "", "applies supplied rewrites or trims prefixes to recorded source file paths")
+
+-var goarch, goos string
++var goarch, goos, gomips, gomips64 string
+
+ func main() {
+ objabi.AddVersionFlag() // -V
+@@ -405,6 +405,8 @@
+ if s := os.Getenv("GOOS"); s != "" {
+ goos = s
+ }
++ gomips = objabi.GOMIPS
++ gomips64 = objabi.GOMIPS64
+ ptrSize := ptrSizeMap[goarch]
+ if ptrSize == 0 {
+ fatalf("unknown ptrSize for $GOARCH %q", goarch)
+--- a/src/cmd/go/internal/work/exec.go
++++ b/src/cmd/go/internal/work/exec.go
+@@ -2598,9 +2598,19 @@
+ case "s390x":
+ return []string{"-m64", "-march=z196"}
+ case "mips64", "mips64le":
+- return []string{"-mabi=64"}
++ args := []string{"-mabi=64"}
++ if cfg.GOMIPS64 == "hardfloat" {
++ return append(args, "-mhard-float")
++ } else if cfg.GOMIPS64 == "softfloat" {
++ return append(args, "-msoft-float")
++ }
+ case "mips", "mipsle":
+- return []string{"-mabi=32", "-march=mips32"}
++ args := []string{"-mabi=32", "-march=mips32"}
++ if cfg.GOMIPS == "hardfloat" {
++ return append(args, "-mhard-float", "-mfp32", "-mno-odd-spreg")
++ } else if cfg.GOMIPS == "softfloat" {
++ return append(args, "-msoft-float")
++ }
+ case "ppc64":
+ if cfg.Goos == "aix" {
+ return []string{"-maix64"}
diff --git a/debian/patches/0005-cmd-dist-increase-default-timeout-scale-for-arm.patch b/debian/patches/0005-cmd-dist-increase-default-timeout-scale-for-arm.patch
new file mode 100644
index 0000000..969cb88
--- /dev/null
+++ b/debian/patches/0005-cmd-dist-increase-default-timeout-scale-for-arm.patch
@@ -0,0 +1,29 @@
+From: Balint Reczey <balint.reczey@canonical.com>
+Date: Mon, 31 Aug 2020 13:14:51 +0200
+Subject: [PATCH] cmd/dist: increase default timeout scale for arm
+
+Forwarded: https://github.com/golang/go/issues/43002
+
+Most developers use (faster) amd64 machines setting the test timeouts,
+but test may run on slower arm ones and also different tests may suffer
+different relative slowdown on the arm CPUs.
+
+Due to those two varying factors it is safer to allow a higher timeout
+scale on arm to avoid tests timing out.
+---
+ src/cmd/dist/test.go | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
+index ef0c743..f1798fc 100644
+--- a/src/cmd/dist/test.go
++++ b/src/cmd/dist/test.go
+@@ -149,7 +149,7 @@ func (t *tester) run() {
+ t.timeoutScale = 1
+ switch goarch {
+ case "arm":
+- t.timeoutScale = 2
++ t.timeoutScale = 3
+ case "mips", "mipsle", "mips64", "mips64le":
+ t.timeoutScale = 4
+ }
diff --git a/debian/patches/0006-skip-userns-test-in-schroot-as-well.patch b/debian/patches/0006-skip-userns-test-in-schroot-as-well.patch
new file mode 100644
index 0000000..c4a061f
--- /dev/null
+++ b/debian/patches/0006-skip-userns-test-in-schroot-as-well.patch
@@ -0,0 +1,35 @@
+From: Shengjing Zhu <zhsj@debian.org>
+Date: Fri, 5 Feb 2021 21:21:45 +0800
+Subject: skip userns test in schroot as well
+
+When schroot is using overlayfs, it fails to detect it as chroot.
+
+---
+ src/syscall/exec_linux_test.go | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go
+index b79dee7..9f3d651 100644
+--- a/src/syscall/exec_linux_test.go
++++ b/src/syscall/exec_linux_test.go
+@@ -33,6 +33,10 @@ func isLXC() bool {
+ return os.Getenv("container") == "lxc"
+ }
+
++func isSchroot() bool {
++ return os.Getenv("SCHROOT_SESSION_ID") != ""
++}
++
+ func skipInContainer(t *testing.T) {
+ // TODO: the callers of this func are using this func to skip
+ // tests when running as some sort of "fake root" that's uid 0
+@@ -48,6 +52,9 @@ func skipInContainer(t *testing.T) {
+ if isLXC() {
+ t.Skip("skip this test in LXC container")
+ }
++ if isSchroot() {
++ t.Skip("skip this test in Schroot container")
++ }
+ }
+
+ func skipNoUserNamespaces(t *testing.T) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..245f3f4
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+0001-Disable-test-for-UserHomeDir.patch
+0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch
+0003-cmd-go-cmd-cgo-pass-mfp32-and-mhard-soft-float-to-MI.patch
+0005-cmd-dist-increase-default-timeout-scale-for-arm.patch
+0006-skip-userns-test-in-schroot-as-well.patch