Unless you have built Go from source and/or your user owns the path Go is 
installed in, this is one of the few cases where go build is recommended 
over go install. 

http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5

On Wednesday, 26 October 2016 05:09:18 UTC+11, Liam wrote:
>
> I have these commands in a package script:
>
>   GOPATH="${srcdir}" go get -d -u "${_site}/${pkgname}"
>   ...
>   GOPATH="${srcdir}" GOOS=linux GOARCH=arm \
>   CC=arm-unknown-linux-gnueabihf-gcc CGO_ENABLED=1 \
>   go install -v -ldflags='-s -w -extld=$CC' "${_site}/${pkgname}"
>
>
> Results:
>
>   runtime/cgo
>   go install runtime/cgo: open /usr/lib/go/pkg/linux_arm/runtime/cgo.a: 
> permission denied
>
>
> My cgo.a files have very diff sizes:
>
>   $ ls -l /lib/go/pkg/*/runtime/cgo*
>   -rw-r--r-- 1 root root 64874 Sep  8 00:13 
> /lib/go/pkg/linux_amd64/runtime/cgo.a
>   -rw-r--r-- 1 root root 65054 Sep  8 00:18 
> /lib/go/pkg/linux_amd64_race/runtime/cgo.a
>   -rw-r--r-- 1 root root  2642 Oct 25 03:54 
> /lib/go/pkg/linux_arm/runtime/cgo.a
>
>
> I have rebuilt for linux_arm:
>
>    GOOS=linux GOARCH=arm go install -v -a std
>    GOOS=linux GOARCH=arm go install -v -a cmd
>
> On Arch Linux x86_64 with go1.7.1 linux/amd64
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to