View Single Post
Old 05-16-2015, 01:22 PM   #1
transient
Junior Member
transient began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2015
Device: PocketBook 622
Golang for arm and Pocketbook

Golang for arm and Pocketbook

Go cross compiler (1.4.2) with CGO support is now ready for PocketBook arm platform (armel, arm 5).

You can download my binary for Ubuntu 12.04 or compile from src with instructions below (coming soon... maybe).

In any case (if you want to work with CGO!), you should install toolchain from sergeyvl

After downloading binary, unpack into "/opt" and set environments:

Code:
PATH="/opt/go/bin:$HOME/bin:$PATH"
export GOROOT="/opt/go"
export GOPATH="/home/me/mygo"
Then, you can compile your golang program for host as usual:

Code:
go build prog.go
and compile program for PocketBook arm target:

Code:
GOOS=linux GOARCH=arm GOARM=5 go build armprog.go
and if you want to compile with CGO support:

Code:
CC=arm-none-linux-gnueabi-g++ GOOS=linux GOARCH=arm GOARM=5 CGO_ENABLED=1 go build armprog.go
Support CGO means to link C libs and code to go code (and vice versa).
There are some limitations, but I could use inkview and its graphics.

sample of code, ... hm..
transient is offline   Reply With Quote