From 866f2e147cfbb06eec9179e7323be6d2f82b5290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Fri, 18 Mar 2022 03:13:57 +0100 Subject: [PATCH] community/go: force external link for ppc64le for now This is a workaround for an upstream Go issues. Some tests fail as they also try to use internal link mode, since this is (hopefully) a temporary workaround just disable tests on ppc64le for now. See https://github.com/golang/go/issues/51787#issuecomment-1072700785 --- community/go/APKBUILD | 9 +++++++++ community/go/force-external-link-on-ppc64le.patch | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 community/go/force-external-link-on-ppc64le.patch diff --git a/community/go/APKBUILD b/community/go/APKBUILD index ca777d95ca0e..58d877314dd2 100644 --- a/community/go/APKBUILD +++ b/community/go/APKBUILD @@ -15,6 +15,7 @@ checkdepends="binutils-gold" subpackages="$pkgname-doc" source="https://go.dev/dl/go$pkgver.src.tar.gz allow-unshare-to-return-enosys.patch + force-external-link-on-ppc64le.patch " case "$CARCH" in arm*|aarch64) depends="binutils-gold";; @@ -118,6 +119,13 @@ case "$CARCH" in x86_64|s390x|aarch64) export GO_LDFLAGS=-buildmode=pie ;; esac +# Disable tests on ppc64 for now since they fail due to the +# force-external-link-on-ppc64le.patch we employ currently. +# See the patch description for details. +case "$CARCH" in +ppc64le) options="!check" ;; +esac + prepare() { default_prepare @@ -198,4 +206,5 @@ package() { sha512sums=" f10356df9099e4d027415be5c73bd2551f2f941a31feb21e1ccc03b7d8faa1844f0a639a508e990712e11ec335675e57504edb323fa1eee63e1d09b8523b3b0d go1.18.src.tar.gz 6017caacf77c2911e9e882878fdaa2ed066b76b7e97b2ad776bc33d96b21cabc802966473946642c86a8f985c69adcc5e7ea61684f6d0dbacd468a6aad687229 allow-unshare-to-return-enosys.patch +1ad16c8057c891689aa19dbc87efaf8ba6f9dc5592d178f32e441dc2da35647ae75dc1c00f765f7c244f0f486acc1e3db35d4b23533616c90937b2a6c0cd0d0a force-external-link-on-ppc64le.patch " diff --git a/community/go/force-external-link-on-ppc64le.patch b/community/go/force-external-link-on-ppc64le.patch new file mode 100644 index 000000000000..aa0e20da0c11 --- /dev/null +++ b/community/go/force-external-link-on-ppc64le.patch @@ -0,0 +1,13 @@ +See https://github.com/golang/go/issues/51787#issuecomment-1072700785 + +--- go.orig/src/cmd/link/internal/ld/config.go ++++ go/src/cmd/link/internal/ld/config.go +@@ -212,7 +212,7 @@ + // windows/arm64 internal linking is not implemented. + return true, buildcfg.GOOS + "/" + buildcfg.GOARCH + " does not support internal cgo" + } +- if iscgo && ctxt.Arch == sys.ArchPPC64 { ++ if iscgo && (ctxt.Arch == sys.ArchPPC64 || ctxt.Arch == sys.ArchPPC64LE) { + // Big Endian PPC64 cgo internal linking is not implemented for aix or linux. + return true, buildcfg.GOOS + " does not support internal cgo" + }