mdlbear: (debian)
[personal profile] mdlbear
Most of my work these days consists of trying to shoehorn various little applications that my colleagues have written, onto a little headless ARM-based "pocket server" with the poetic name of Stargate. For various reasons, we all seem to be writing in Java these days under the mistaken impression that our code will be portable that way.

Now, several different JVMs have been ported to ARM Linux. Unfortunately the only one I could find that runs on the current version of the Stargate is JRE-1.3.something, and all of our apps are 1.4.something-else. Lots of classes snuck in between 1.3 and 1.4; many of them are even useful. So I've been looking at SableVM and the amazing gcj compiler and its gij runtime and GNU Classpath class library.

In order to compile a JVM -- or anything else -- for a little ARM box with next to no storage one needs a cross-compilation "toolchain". Luckily Debian, which is what I tend to run on my workstations these days, makes it remarkably easy to build a custom cross-compiling toolchain. Just apt-get install dpkg-cross toolchain-source and follow the simple directions in the.... Oh. Right.

Turns out the documentation is a little sketchy. Still, the basic toolchain builds very smoothly -- the details are all in /usr/share/doc/toolchain-source/README. Most of the cleverness is in the scripts that set up the build parameters and make rules so that instead of building gcc and friends, you end up building arm-linux-gcc. The dpkg-cross tpkg-install-libc script downloads libraries from the appropriate target's Debian distribution and puts them in the right place so the linker can find them when you cross-compile. Of course, that assumes that the target box is running Debian, which it probably isn't.

I'm only partway through this process -- I managed to persuade it to build gcj and gij, but not in the approved manner, so I don't yet have Debian packages to install. Oh, yes: the build process actually builds proper, customized Debian packages that you can install as usual with dpkg install.

Very cool.

Most Popular Tags

Style Credit

Page generated 2026-01-07 11:23 pm
Powered by Dreamwidth Studios