Build Go From Source on BeagleBone Black - matianfu/sitara-wiki GitHub Wiki
1 Overview
1.1 Hardware and Software
Hardware: BeagleBone Black
TI Processor SDK linux 2.00, factory image, sd card boot.
It is possible to use debian on BBB. I have tried it yet.
http://elinux.org/BeagleBoardDebian
Go version: 1.5.1 official source tar ball.
1.2 Why
The official guide is generally good.
https://golang.org/doc/install/source
But there are some issues to be cleared on BBB build.
I didn't find a way to build Go toolchain and runtime (not Go app) from source by cross-compiling.
1.3 References
Dave Cheney's guide on building go 1.5 on raspberry pi.
http://dave.cheney.net/2015/09/04/building-go-1-5-on-the-raspberry-pi
2 Issues
2.1 no space
Go uses /tmp as build folder. It is possible that either file block or inode space is not enough.
I hooked an 2T usb external hard drive to BBB and link /tmp to there.
2.2 libc.a not found
TI Processor SDK has no libc.a in /lib folder.
2.3 failed test 1
##### ../doc/articles/wiki
port not available within 5 seconds
./test.bash: line 15: kill: (15343) - No such process
2015/10/09 04:36:59 Failed: exit status 1
go/doc/articles/wiki/test.bash
workaround: bypass this test.
2.4 failed test 2
runtime test
solution1:
go/src/cmd/dist/test.go
default timeout is 300 and timeoutScale
is 2, that is 600s. change timeoutScale
to 3 or more.
an (better) alternative way is set GO_TEST_TIMEOUT_SCALE to 3 or more, as pointed out in Dave Cheney's article.
3 How
tar xvzf xxx
tar xvf xxx
env GOROOT_FINAL=/tmp/final GOROOT_BOOTSTRAP=/tmp/go-linux-arm-bootstrap GOARM=7 GO_TEST_TIMEOUT_SCALE=5 ./all.bash