Go, build for a different architecture

It happened that I needed to (re)build a small program for an i386 machine.
This was about the same time I realized we still had those…
It’s very easy but since I’ll not be using this a lot I wanted to document it.

First of all, build the correct Go compiler. I’m on (Ubuntu) amd64 and
these instructions explain how to get the i386 build. (you can replace all (i)386 with amd64 to do the reverse..)

Install correct libc6-dev

This is not so hard: sudo apt-get install libc6-dev-i386

Build Go for i386

I’m assuming you did a binary install of
golang, in that case you just
need to find the make.bash script in the src dir like this.