Tiny Nodes

I’ve been fooling around with node.js now and then, which is a challenge in more ways than one - despite my legendary distaste for JavaScript, I stubbornly decided that I would get it to work on the smallest Linux machine I have: an ARM-based NSLU2 that has been running off a 2GB flash disk for a couple of years now and that I use as an SSH gateway, following the rather twisted logic that if node is that fast, then I’m going to find it usable enough to tinker with on that hardware - especially considering that my former Wiki ran fine on it (Python indexing and all).

Compiling the tarballs on the NSLU2 requires defining a few extra command-line switches and installing the optware-devel package, as well as setting a few environment variables:

ipkg install optware-devel
export CC='gcc -march=armv5 -D__ARMEL__'
export CXX='g++ -march=armv5 -D__ARMEL__'
export LD_LIBRARY_PATH=/opt/lib


Once that’s done, configure works, and building it all is mostly a matter of iteration - start a build, come back some eight hours later (the thing only has 32MB RAM), find some constants missing, restart the build, etc.

It’s an exercise in patience - especially when you get to the part where it builds V8, which is hideously complex - but I’ve done this kind of thing before, both in the pre-Linux ages (when porting stuff across UNIXes required extensive tinkering) and in my days running Cygwin (when porting stuff to Windows was the only way for me to have a sane working environment).

However, even after a few partial successes, I’m unable to build a binary that works consistently - either due to lack of resources or to fundamental breakage in the ARM code generation, anything but the simplest scripts eventually segfault, so I’m throwing in the towel for now and trying to find something else similarly constrained to tinker with it (I have a Chumby somewhere, but no decent firmware for it, and I might be able to get an Atom machine set up).