is there golang support for aarch64 on the roadmap?

With TK1, i was able to compile natively compiled golang 1.4.3. Which then copied over to TX1 worked pretty ok.

But with TX1 running R23 or R24, building golang 1.4.3 fails with “unknown architecture: aarch64”.

I understand that this is clearly a limitation of golang build setup at present time. However, i wonder if someone has figured out a workaround in order get golang compiling natively on TX1.


This is a long winded answer, take what you will from it. As you probably know, Go is available through apt-get on the TX1 (32 bit and 64 bit, Go 1.6 is the latest release version):

$ sudo apt-get install golang-1.6

To answer your question: Go 1.4 does not support the ‘aarch64’ architecture (Go calls this architecture ‘arm64’). Later versions of Go use 1.4 as a bootstrap to build the Go toolchain. Fortunately cross-compiling is built into the Go environment. If you have a working Go system > 1.5 also with Go 1.4 installed, you can build a bootstrap environment which will allow you to build Go on aarch64. The bootstrap script is in the source directory of the > 1.5 system, for example:

$ GOOS=linux GOARCH=arm64 bootstrap.bash

The bootstrap is written to a compressed file, which is then copied over to the target machine and used as a basis to build the rest of the Go toolchain.

There is something a little tricky to watch for. As you know, there are two versions of 24.1 on the JTX1, 32 bit and 64 bit. The 64 bit is straightforward, build a bootstrap for arm64, copy it over, and then build the toolchain. There is an environment variable GOROOT_BOOTSTRAP that you need to set to point to the bootstrap tree.

32 bit, on the other hand, needs to build a ‘arm’ version to execute in the 32 bit environment. So GOARCH=arm on the bootstrap on the host machine, and then GOHOSTARCH needs to be set to ‘arm’ during the Go toolchain build.

I would suggest that you build your own bootstrap files and go through the process, but I did write some scripts that does the process automagically along with the bootstraps I used:

Hope this helps

Thank you for detailed guidance. I can’t wait to try these out (currently traveling through Asia - should have carried my TX 1 along :)).