aboutsummaryrefslogtreecommitdiffstats
path: root/main/go-bootstrap/fix-arm-hackery.patch
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-08-24 19:24:03 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-28 11:11:21 +0200
commitbcfbb5080728e35c85f01851795220e1118a1fcc (patch)
treee8ec9d30d3ec84d0af60a63de97c47a798f5c3b6 /main/go-bootstrap/fix-arm-hackery.patch
parent960197c8242568bc98f0033e61fc65c636f6a180 (diff)
downloadaports-bcfbb5080728e35c85f01851795220e1118a1fcc.tar.bz2
aports-bcfbb5080728e35c85f01851795220e1118a1fcc.tar.xz
main/go-boostrap: new aport
This is a more minimal version of the main/go aport. It is only supposed to be used for bootstrapping go1.5 and to clarify this point it is called go-bootstrap instead of go1.4. This package doesn't ship a tools or cross subpackage anymore because doing so would increase the amount of redundant 'code' in this APKBUILD and neither tools nor cross compilers are needed for bootstrapping go1.5.
Diffstat (limited to 'main/go-bootstrap/fix-arm-hackery.patch')
-rw-r--r--main/go-bootstrap/fix-arm-hackery.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/main/go-bootstrap/fix-arm-hackery.patch b/main/go-bootstrap/fix-arm-hackery.patch
new file mode 100644
index 0000000000..f5a447264c
--- /dev/null
+++ b/main/go-bootstrap/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