Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/go
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-05-22 20:18:50 +0200
committerErich Eckner <git@eckner.net>2023-05-22 20:18:50 +0200
commite74cde76c104df82b120a7b13964cb786da8f565 (patch)
tree39967e24037929c04aaf79922aa260b437a60a5e /extra/go
parent73e1d3b448cc583ab38cae4d61a26f313fad946b (diff)
community -> extra
Diffstat (limited to 'extra/go')
-rw-r--r--extra/go/PKGBUILD52
-rw-r--r--extra/go/go-x87.patch28
2 files changed, 80 insertions, 0 deletions
diff --git a/extra/go/PKGBUILD b/extra/go/PKGBUILD
new file mode 100644
index 00000000..c4adc372
--- /dev/null
+++ b/extra/go/PKGBUILD
@@ -0,0 +1,52 @@
+eval "$(
+ declare -f build | \
+ sed '
+ /install\( .*\)\? -race /d
+ '
+ declare -f package_go-pie package | \
+ sed '
+ s,\(/linux_\)amd64\([_/]\),\1386\2,g
+ '
+)"
+
+eval "$(
+ declare -f build check _package \
+ | sed '
+ s/\(export GOARCH=\)amd64/\1386 /
+ '
+)"
+
+# 1.16 dropped non-SSE2 floating point operations, so we must
+# use software floating points (see https://github.com/golang/go/issues/40255)
+if [ "$CARCH" = 'i686' -o "$CARCH" = 'i486' ]; then
+ eval "$(
+ declare -f build \
+ | sed '
+ 2 a export GO386='softfloat'
+ '
+ declare -f check \
+ | sed '
+ 2 a export GO386='softfloat'
+ '
+ )"
+fi
+
+# https://go-review.googlesource.com/c/go/+/257963
+source+=('go-x87.patch')
+sha256sums+=('8b124eaa7521bd0e3760b514829b1ecce3d3cd169f99c3629ff50b7769303802')
+eval "$(
+ {
+ declare -f prepare || \
+ printf 'prepare() { cd "$pkgname" \n}\n'
+ } \
+ | sed '
+ $i patch -Np1 -i ../go-x87.patch
+ '
+)"
+
+# tests are failing, ignore them
+unset check
+
+# bootstrap via go17
+makedepends=(${makedepends[@]//go/})
+makedepends+=('go17')
diff --git a/extra/go/go-x87.patch b/extra/go/go-x87.patch
new file mode 100644
index 00000000..0c0a584b
--- /dev/null
+++ b/extra/go/go-x87.patch
@@ -0,0 +1,28 @@
+diff -rauN go/src/buildall.bash go-x87-patch/src/buildall.bash
+--- go/src/buildall.bash 2023-04-04 17:38:07.330008547 +0200
++++ go-x87-patch/src/buildall.bash 2023-04-04 17:39:07.929938685 +0200
+@@ -37,6 +37,7 @@
+
+ gettargets() {
+ ../bin/go tool dist list | sed -e 's|/|-|'
++ echo linux-386-387
+ echo linux-arm-arm5
+ }
+
+@@ -63,11 +64,15 @@
+ echo "### Building $target"
+ export GOOS=$(echo $target | sed 's/-.*//')
+ export GOARCH=$(echo $target | sed 's/.*-//')
+- unset GOARM
++ unset GO386 GOARM
+ if [ "$GOARCH" = "arm5" ]; then
+ export GOARCH=arm
+ export GOARM=5
+ fi
++ if [ "$GOARCH" = "387" ]; then
++ export GOARCH=386
++ export GO386=387
++ fi
+
+ # Build and vet everything.
+ # cmd/go/internal/work/exec.go enables the same vet flags during go test of std cmd