Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: Enable full rebuild of standard library for cross-compiling #17426

Closed
networkimprov opened this issue Oct 13, 2016 · 3 comments
Closed

Comments

@networkimprov
Copy link

Distro: Arch Linux
Version: go1.7.1 linux/amd64
go env:

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build554928497=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

I wish to rebuild the standard library for cross-compiling, following advice from
http://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5

When logged in as root in empty directory...

This gives an error:

GOOS=linux GOARCH=arm go install -a -v -p 4

can't load package: package .: no buildable Go source files in /home/x/y

This only rebuilds part of the stdlib:

GOPATH=/home/x/y GOOS=linux GOARCH=arm go install -a -v -p 4 github.com/x/y

There should be a way to rebuild the whole stdlib for a different architecture.

@bradfitz
Copy link
Contributor

This is no longer necessary. Those instructions are old. Let's move this to https://golang.org/wiki/Questions

@davecheney
Copy link
Contributor

env GOOS=linux GOARCH=arm go install -v std is the command you want.

@mikioh mikioh changed the title Enable full rebuild of standard library for cross-compiling cmd/go: Enable full rebuild of standard library for cross-compiling Oct 13, 2016
@networkimprov
Copy link
Author

@davecheney thanks. I looked and looked for 'std'.

If the docs made [packages] a link to the package-lists section where go xyz ... [packages] appears, I would have found that answer quickly. How about re-titling and reopening this issue to that effect?

@golang golang locked and limited conversation to collaborators Oct 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants