Hi,
I need to cross compile to ARM v5 running Linux.
I have Ubuntu 16.04 running in a VM with gcc-arm-linux-gnueabi
and binutils-arm-linux-gnueabi
installed.
$ sudo apt-get install gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi
$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/osboxes/golang/packages"
GORACE=""
GOROOT="/home/osboxes/golang/go"
GOTOOLDIR="/home/osboxes/golang/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build586862853=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
$ go version
go version go1.7.3 linux/amd64
Cross compilation command:
env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=5 go build -o test
While running the app i get Error : x509: failed to load system roots and no roots provided
Only the cgo
part is creating issues(running in a separate goroutine) and all other code runs perfectly fine.
I’m using github.com/eclipse/paho.mqtt.golang
which depends on the crypto
package.
I have validated my certs with openssl
and getting some error there as well.
$ openssl s_client -showcerts -connect mqtt.some_uri.io:8883
CONNECTED(00000003)
...
verify error:num=19:self signed certificate in certificate chain
...
Any help is much appreciated. Thank you in advance.