Commit 554e187b authored by Alex Xu (Hello71)'s avatar Alex Xu (Hello71)
Browse files

community/go: disable gold, remove unshare ENOSYS

unshare ENOSYS was a temporary workaround and is no longer needed. gold
is for #13308, the binutils issue is fixed upstream and gold is broken
so just stop using gold
parent d4e39a9d
Pipeline #104682 failed with stages
in 8 minutes and 55 seconds
......@@ -4,27 +4,19 @@
pkgname=go
# go binaries are statically linked, security updates require rebuilds
pkgver=1.17.4
pkgrel=0
pkgrel=1
pkgdesc="Go programming language compiler"
url="https://golang.org/"
arch="all"
license="BSD-3-Clause"
depends="binutils gcc musl-dev"
makedepends="bash"
checkdepends="binutils-gold"
subpackages="$pkgname-doc"
source="https://golang.org/dl/go${pkgver/_/}.src.tar.gz
disable-flaky-sync-test.patch
disable-flaky-gc-test.patch
allow-unshare-to-return-enosys.patch
no-gold.patch
"
case "$CARCH" in
arm*|aarch64) depends="binutils-gold";;
riscv64)
# Gold does not support RISC-V
checkdepends=""
;;
esac
# secfixes:
# 1.17.3-r0:
......@@ -196,5 +188,5 @@ sha512sums="
61668dddf5e8c45a4554e19877c06d38c1615f2a672a68fae318f59400911736c5a03da4bfdb8d68ac85a51059d65681d8a365028fb09c3a1ab0ce4e03385d6a go1.17.4.src.tar.gz
988a436727aefc5124702bd70cb01bb457a921affcdd03e17f78937685482e899080d95baf125e054d1f634dae5c747d05a3662f1f4f462b87965b06270c788f disable-flaky-sync-test.patch
ab4aa83d8a9bf10bbb93ad029095b47c6eea7d5532703d84449884039116e07897871649feb1df8128f10257cbdb5d7eb03820ab0f1a3f60315e195302f6e516 disable-flaky-gc-test.patch
6017caacf77c2911e9e882878fdaa2ed066b76b7e97b2ad776bc33d96b21cabc802966473946642c86a8f985c69adcc5e7ea61684f6d0dbacd468a6aad687229 allow-unshare-to-return-enosys.patch
fb83784d007d4cf64705d19664fa086cd3a4df9c8d8b3d995c42af9f8bd60faf5b736cd0ea7779d695458e529064262d0e42207e6d6b497d289bb813e3466bc9 no-gold.patch
"
On the Alpine CI our moby configuration returns ENOSYS instead of EPERM
when attempting to use the unshare(2) system call from a container. The
Go test suite expects unshare(2) to return EPERM in this scenario and
skips tests using it when it does. By treating the ENOSYS errno in the
same way as the EPERM errno we can ensure that the Go test suite
continues to work on the Alpine CI.
diff -upr go.orig/src/runtime/testdata/testprog/syscalls_linux.go go/src/runtime/testdata/testprog/syscalls_linux.go
--- go.orig/src/runtime/testdata/testprog/syscalls_linux.go 2021-03-11 18:14:31.000000000 +0100
+++ go/src/runtime/testdata/testprog/syscalls_linux.go 2021-03-12 17:26:10.927644763 +0100
@@ -46,7 +46,7 @@ func unshareFs() error {
err := syscall.Unshare(syscall.CLONE_FS)
if err != nil {
errno, ok := err.(syscall.Errno)
- if ok && errno == syscall.EPERM {
+ if ok && (errno == syscall.EPERM || errno == syscall.ENOSYS) {
return errNotPermitted
}
}
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 644faeb2fb..fd88fb1adf 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1386,28 +1386,6 @@ func (ctxt *Link) hostlink() {
// Use lld to avoid errors from default linker (issue #38838)
altLinker = "lld"
}
-
- if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" {
- // On ARM, 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.
- //
- // 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.
- cmd := exec.Command(*flagExtld, "-fuse-ld=gold", "-Wl,--version")
- 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 ctxt.Arch.Family == sys.ARM64 && buildcfg.GOOS == "freebsd" {
// Switch to ld.bfd on freebsd/arm64.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment