nodejs ARMv6 build seem to have v8 built for ARMv7
I installed alpine on a raspberry pi B using the documented method on your wiki. After a apk add nodejs (using edge version), I get the node binary in /usr/bin/node, but when executing it I get the output “Illegal instruction”. Now this is apparently common when it has been built for the wrong architecture.
uname -a
Linux sonos 4.1.15-1-rpi #2-Alpine PREEMPT Wed Jan 6 08:24:42 GMT 2016
armv6l Linux
node —v8-options
target arm v6 vfp3-d16 hard
ARMv7=1 VFP3=1 VFP32DREGS=0 NEON=0 SUDIV=0 UNALIGNED_ACCESSES=1
MOVW_MOVT_IMMEDIATE_LOADS=0 COHERENT_CACHE=
0 USE_EABI_HARDFLOAT=1
According to discussion on the internet, the v8 source easily
misidentify the target architecture. Here is an example:
https://github.com/nodejs/node-v0.x-archive/pull/9068
This is still not fixed in the v8 source of 4.3.1, for some reason. I
assume the build server they use for their prebuilt ARM-versions report
CPU differently.
I tried to use the prebuild armv6 version from nodejs.org, but for some reason, it keeps saying “-ash: node: not found” even though the binary is there and autocompletes. I guess it is missing some dependency.
(from redmine: issue id 5211, created on 2016-03-01, closed on 2017-05-19)
- Changesets:
- Revision e73dba57 by Timo Teräs on 2016-03-03T11:01:14Z:
main/nodejs: do not set vfpv3 fpu for armhf
This reverts most of commit 2fc663d5. Debian target armv7+ in
their armhf. We target armv6+ which does not support vfpv3.
ref #5211