I have written before about building NodeJS for ARMv5 (a QNAP TS-109 running Debian). Since nodejs 0.12.0 just came out, of course I wanted to build this version – but that did not go so well.
Just standard ./configure and make gave me this error after a while.
In file included from ../deps/v8/src/base/atomicops.h:146:0, from ../deps/v8/src/base/once.h:55, from ../deps/v8/src/base/lazy-instance.h:72, from ../deps/v8/src/base/platform/mutex.h:8, from ../deps/v8/src/base/platform/platform.h:29, from ../deps/v8/src/assert-scope.h:9, from ../deps/v8/src/v8.h:33, from ../deps/v8/src/accessors.cc:5: ../deps/v8/src/base/atomicops_internals_arm_gcc.h:258:4: error: #error "Your CPU's ARM architecture is not supported yet"
This was quite expected though, since earlier versions (v0.10.25 was the last I built) did not build that easily. So I forced armv5t-architecture and tried again:
export CFLAGS='-march=armv5t' export CXXFLAGS='-march=armv5t' make ... Segmentation fault make: *** [/home/kvaser/nodejs/node-v0.12.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 139 make: Leaving directory `/home/kvaser/ndejs/node-v0.12.0/out' make: *** [node] Error 2
It took almost 7 hours to get here. I stopped compiling and started reading instead.
- V8 is not supported on ARMv5 anymore (last supported version was 3.17.6 I think)
- Building V8 as a shared library is not very easy
- Even if I manage to build 3.17.6 as a shared library, there is no guarantee
it would work with nodejs v0.12.0
- Just replacing the v8 directory of v0.12.0 with an older version of v8 and hope everything just builds and runs perfectly seems… unlikely (but I have not tried and failed, yet)
- The Raspberry Pi, with its ARMv6 CPU, is supposed to work with v0.12.0, but a little hack is required at this time (RPi 2 with ARMv7 seems safe)
The good thing is that nodejs (v0.10.29) can be installed in Debian 7 (wheezy) using backports. This is a rather nice and consistent way to install software not already in Debian Stable.
Qemu Failed too
I tried running nodejs in Qemu (which works for a PowerPC G4), but this failed:
kvaser@kvaser:/opt/node-v0.12.0-linux-x86/bin$ qemu-i386 -L . ./node ./node: error while loading shared libraries: rt.so.1: ncanoot penrshaoed cbjeit f: No such file or directory
This is the actual result – not a copy-paste-mistake… so I believe something (byte order?) is seriously wrong.