Commit 212ce41d authored by Dave Cheney's avatar Dave Cheney

runtime: arm: abort if hardware floating point missing

Fixes #3911.

Requires CL 6449127.

dfc@qnap:~$ ./runtime.test
runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=7 binary. Recompile using GOARM=5.

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6442109
parent 4cfcb4a0
......@@ -37,6 +37,7 @@ TEXT _rt0_arm(SB),7,$-4
MOVW.NE g, R0 // first argument of initcgo is g
BL.NE (R2) // will clobber R0-R3
BL runtime·checkgoarm(SB)
BL runtime·check(SB)
// saved argc, argv
......
......@@ -147,9 +147,21 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
#define AT_PLATFORM 15 // introduced in at least 2.6.11
#define AT_HWCAP 16 // introduced in at least 2.6.11
#define AT_RANDOM 25 // introduced in 2.6.29
#define HWCAP_VFP (1 << 6)
static uint32 runtime·randomNumber;
uint32 runtime·hwcap;
uint8 runtime·armArch = 6; // we default to ARMv6
uint32 runtime·hwcap; // set by setup_auxv
uint8 runtime·goarm; // set by 5l
void
runtime·checkgoarm(void)
{
if(runtime·goarm > 5 && !(runtime·hwcap & HWCAP_VFP)) {
runtime·printf("runtime: this CPU has no floating point hardware, so it cannot run\n");
runtime·printf("this GOARM=%d binary. Recompile using GOARM=5.\n", runtime·goarm);
runtime·exit(1);
}
}
#pragma textflag 7
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment