Skip to content

Commit

Permalink
community/go: force external link for ppc64le for now
Browse files Browse the repository at this point in the history
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 golang/go#51787 (comment)
  • Loading branch information
nmeum committed Mar 19, 2022
1 parent d0d8d71 commit 866f2e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions community/go/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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";;
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
"
13 changes: 13 additions & 0 deletions community/go/force-external-link-on-ppc64le.patch
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 866f2e1

Please sign in to comment.