aboutsummaryrefslogtreecommitdiffstats
path: root/main/go
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-12-09 08:26:32 +0000
committerTimo Teräs <timo.teras@iki.fi>2014-12-09 08:43:12 +0000
commitaaace1ba207884e57ad6e1bcb2ed40afe67521d1 (patch)
tree2a0780dd7332bd09f46d7bbb59621a63ffbfb769 /main/go
parent9d6945496bb7567b8d26335d9d060ca7ea4f33db (diff)
downloadaports-aaace1ba207884e57ad6e1bcb2ed40afe67521d1.tar.bz2
aports-aaace1ba207884e57ad6e1bcb2ed40afe67521d1.tar.xz
main/go: fix and enable arm build
Diffstat (limited to 'main/go')
-rw-r--r--main/go/APKBUILD15
-rw-r--r--main/go/fix-arm-hackery.patch98
2 files changed, 108 insertions, 5 deletions
diff --git a/main/go/APKBUILD b/main/go/APKBUILD
index b410fd6f3..046f5d8ea 100644
--- a/main/go/APKBUILD
+++ b/main/go/APKBUILD
@@ -1,10 +1,10 @@
# Maintainer: Eivind Uggedal <eivind@uggedal.com>
pkgname=go
pkgver=1.3.3
-pkgrel=0
+pkgrel=1
pkgdesc="Go programming language compiler"
url="http://www.golang.org/"
-arch="x86 x86_64"
+arch="x86 x86_64 armhf"
license="BSD"
depends=""
depends_dev=""
@@ -21,6 +21,7 @@ source="
no-werror.patch
no-pic.patch
no-longjmp-redefine.patch
+ fix-arm-hackery.patch
default-sc-getpw-r-size-max.patch
"
@@ -47,9 +48,10 @@ build() {
unset CC
case "$CARCH" in
- x86) GOARCH=386;;
- x86_64) GOARCH=amd64;;
- *) return 1;;
+ x86) GOARCH=386;;
+ x86_64) GOARCH=amd64;;
+ arm*) GOARCH=arm; export GOARM=6;;
+ *) return 1;;
esac
export GOARCH
@@ -142,14 +144,17 @@ md5sums="2cdbad6baefcf1007f3cf54a5bc878b7 go1.3.3.src.tar.gz
65330c61f6d6c881033b0a95ca228edb no-werror.patch
4391be88ce8bacdd7fee433b39635583 no-pic.patch
93ad940db4a6d51e086f80755eaa8f53 no-longjmp-redefine.patch
+81ac9f3188df7a0c16c52cc4d8cc1ffa fix-arm-hackery.patch
2576180fb906455bb786ca2937bbe180 default-sc-getpw-r-size-max.patch"
sha256sums="1bb6fde89cfe8b9756a875af55d994cce0994861227b5dc0f268c143d91cd5ff go1.3.3.src.tar.gz
65d38b9485da2ff9417a2c44a81b6e52cc9bd2727b27e7add10d48a63805d4a3 no-werror.patch
86fc68a50bc4a9336a003239adf1dcc6d7cabfb9c1bcf09b0d53d09100ceff12 no-pic.patch
084020e0eb6cb0aceee047bd5962872ed51dbb45465174018d108eb195c26605 no-longjmp-redefine.patch
+fced8436d9c32a43a5cc87f2243529e7a8209ba73a9afd4fd7733245bc55e4e3 fix-arm-hackery.patch
be711a828ddda89dd28ffc19d88958471c832005f0666a8a28c8838c0082a208 default-sc-getpw-r-size-max.patch"
sha512sums="159872b7764986eba6641a5ebaf3aed3d6066bcd384672068354359099e52035b25bc819582d022ef8d7d91e244269cb38917e13c4d3eac8581831d41b2bac2b go1.3.3.src.tar.gz
3cf139723e6ff0cbf7aaf76295fe4208f2062f2d4086e36d05cad83919217b5355e0e79b0b515a06a578389301bd07b062cb58b98fc0f9e4badf190cd1c34826 no-werror.patch
a8e95c3c536a30e15b9bad5e623a085c521739639a58ac638679d99413a1bee8823729783123cbe4495ac42822df31f4776f0380a63786b9f4fc73190e012ae5 no-pic.patch
3a9b665f8fda89729c4c269ea82f82ee515f0026d26f1d51e2cf84054456e394afc14875e7ed29280a12488907d50c70af313e2e4a5b62c328bbade098db9d4d no-longjmp-redefine.patch
+573146b72c980af5e41540fd7912b5579b050e41ac9d808e8d14268cf0a0fa1a70e6fade85011c0f18f1a428bc95b225d8b8345be1c50656dc69046ef1eb0b40 fix-arm-hackery.patch
9e9a288ff912b57eff250db53891be166376ec3ee11fcde94b49f1ff1c9433ef531d6c12706258a65a8666e11142506ecc3778e4bbf43dbe23afd2492a3a17a4 default-sc-getpw-r-size-max.patch"
diff --git a/main/go/fix-arm-hackery.patch b/main/go/fix-arm-hackery.patch
new file mode 100644
index 000000000..f5a447264
--- /dev/null
+++ b/main/go/fix-arm-hackery.patch
@@ -0,0 +1,98 @@
+--- go/src/cmd/dist/arm.c
++++ go.fixed/src/cmd/dist/arm.c
+@@ -11,8 +11,8 @@
+ return "6";
+ }
+ #else
+-static void useVFPv3(void);
+-static void useVFPv1(void);
++void useVFPv3(void);
++void useVFPv1(void);
+
+ char *
+ xgetgoarm(void)
+@@ -26,46 +26,6 @@
+ else if(xtryexecfunc(useVFPv1))
+ return "6";
+ return "5";
+-}
+-
+-static void
+-useVFPv3(void)
+-{
+- // try to run VFPv3-only "vmov.f64 d0, #112" instruction
+- // we can't use that instruction directly, because we
+- // might be compiling with a soft-float only toolchain.
+- //
+- // some newer toolchains are configured to use thumb
+- // by default, so we need to do some mode changing magic
+- // here.
+- // We can use "bx pc; nop" here, but GNU as(1) insists
+- // on warning us
+- // "use of r15 in bx in ARM mode is not really useful"
+- // so we workaround that by using "bx r0"
+- __asm__ __volatile__ ("mov r0, pc");
+- __asm__ __volatile__ ("bx r0");
+- __asm__ __volatile__ (".word 0xeeb70b00"); // vmov.f64 d0, #112
+- __asm__ __volatile__ (".word 0xe12fff1e"); // bx lr
+-}
+-
+-static void
+-useVFPv1(void)
+-{
+- // try to run "vmov.f64 d0, d0" instruction
+- // we can't use that instruction directly, because we
+- // might be compiling with a soft-float only toolchain
+- //
+- // some newer toolchains are configured to use thumb
+- // by default, so we need to do some mode changing magic
+- // here.
+- // We can use "bx pc; nop" here, but GNU as(1) insists
+- // on warning us
+- // "use of r15 in bx in ARM mode is not really useful"
+- // so we workaround that by using "bx r0"
+- __asm__ __volatile__ ("mov r0, pc");
+- __asm__ __volatile__ ("bx r0");
+- __asm__ __volatile__ (".word 0xeeb00b40"); // vomv.f64 d0, d0
+- __asm__ __volatile__ (".word 0xe12fff1e"); // bx lr
+ }
+
+ #endif
+--- go/src/make.bash
++++ go.fixed/src/make.bash
+@@ -129,7 +132,7 @@
+ if [ -z "$CC" -a -z "$(type -t gcc)" -a -n "$(type -t clang)" ]; then
+ export CC=clang CXX=clang++
+ fi
+-${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
++${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c cmd/dist/*.S
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+--- /dev/null 2014-12-09 07:52:31.203329541 -0200
++++ go.fixed/src/cmd/dist/arm.S 2014-12-09 10:29:34.149969243 -0200
+@@ -0,0 +1,24 @@
++#ifdef __ARMEL__
++
++.text
++
++.global useVFPv3
++.hidden useVFPv3
++.type useVFPv3,%function
++useVFPv3:
++ mov r0, pc
++ bx r0
++ .word 0xeeb70b00 // vmov.f64 d0, #112
++ .word 0xe12fff1e // bx lr
++
++
++.global useVFPv1
++.hidden useVFPv1
++.type useVFPv1,%function
++useVFPv1:
++ mov r0, pc
++ bx r0
++ .word 0xeeb00b40 // vomv.f64 d0, d0
++ .word 0xe12fff1e // bx lr
++
++#endif