Mein Kampf (with Linux cross compilers)

How it works on Linux

a.k.a. you're doing it WRONG

Okay, I need to install cross compilers first. If you're lucky, your distribution has some (or some script like Gentoo has which does the dirty things for you). If not, prepare to enter hell. Autohell, that is. At first you must download the massive bloatfest which is GNU binutils and GCC. Then you need to figure how it how your target is called this week. Something along arm-linux-gnu or something else (likely the latter). So then you do

./configure --target=something-else

After brewing your favourite sort of tea and reading your five favourite novels, configure should be done. So then you do


And continue waiting, reading another five novels, seeing a huge shitstorm of warnings and eventually probably some kind of error. Yes, an error. Probably your version of GCC is incompatible with the version of binutils or you didn't sacrifice enough lambs or maybe try newborns instead. Pick another version. GOTO 10.

So you finally got here, it did compile. You can now do

make install

Somewhere hidden in your system is now a linker, probably in some weird path like


Add that to your $PATH. I never got that far. Good luck.

How it works on Plan 9

a.k.a. Cross Compiling can be nice

This should rather be in a section "praise".

On Plan 9, cross compiling is simple. I mean really simple.

objtype=arm mk

That's it. Nothing more. Okay, now you might say: "Hey, i suppose you have any magic in that mkfile". No, I don't.

5c foo.c
5l foo.5

Works as well. Now you might say: "Hey, where do those cross compilers and libraries come from?" Well, part of the standard distribution:

cd /sys/src/cmd/5c; mk install
cd /sys/src/cmd/5l; mk install
cd /sys/src; objtype=arm mk install

This will install anything necessary.