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

./make.bash exec format error #41248

Closed
exfly opened this issue Sep 7, 2020 · 3 comments
Closed

./make.bash exec format error #41248

exfly opened this issue Sep 7, 2020 · 3 comments

Comments

@exfly
Copy link

exfly commented Sep 7, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.6 linux/amd64

Does this issue reproduce with the latest release?

yes, 5cc030a

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/vagrant/.cache/go-build"
GOENV="/home/vagrant/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/vagrant/go/1.14.6"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/home/vagrant/.goenv/versions/1.14.6"
GOSUMDB="sum.golang.google.cn"
GOTMPDIR=""
GOTOOLDIR="/home/vagrant/.goenv/versions/1.14.6/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/vagrant/github.com/golang/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build373191007=/tmp/go-build -gno-record-gcc-switches"

What did you do?

build golang from source

What did you expect to see?

success

What did you see instead?

› ./make.bash
Building Go cmd/dist using /home/vagrant/.goenv/versions/1.14.6. (go1.14.6 linux/amd64)
Building Go toolchain1 using /home/vagrant/.goenv/versions/1.14.6.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
panic: invalid argument

goroutine 1 [running]:
bootstrap/cmd/link/internal/ld.Main(0x88e2a0, 0x20, 0x20, 0x1, 0x7, 0x10, 0x0, 0x0, 0x6c77b0, 0x1b, ...)
	/vagrant/github.com/golang/go/src/cmd/link/internal/ld/main.go:319 +0x1cae
main.main()
	/vagrant/github.com/golang/go/src/cmd/link/main.go:68 +0x163

go tool dist: FAILED: /vagrant/github.com/golang/go/pkg/tool/linux_amd64/link -extld=gcc -o /vagrant/github.com/golang/go/pkg/tool/linux_amd64/go_bootstrap /tmp/go-tool-dist-544284882/cmd/go/_go_.a: exit status 2
Building Go toolchain2 using go_bootstrap and Go toolchain1.
go tool dist: FAILED: /vagrant/github.com/golang/go/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: fork/exec /vagrant/github.com/golang/go/pkg/tool/linux_amd64/go_bootstrap: exec format error

@randall77
Copy link
Contributor

Weird, not sure why that's happening.
You're trying to build 1.14.6 using 1.14.6 as the bootstrap compiler. Any chance the bootstrap compiler is the actual same directory as the directory you're trying to build? That might explain it.

@exfly
Copy link
Author

exfly commented Sep 8, 2020

I know what happen I think. In vagrant + ubuntu virtual machine with shared folder, mmap has problem, https://www.virtualbox.org/ticket/819 , make.bash panic at https://github.com/golang/go/blob/master/src/cmd/link/internal/ld/main.go#L318. vboxvfs share folder break me.

When I move go to naitive dir and ./make.bash, it works.

Anyway, thank you very much

@randall77
Copy link
Contributor

No problem. Closing.

@golang golang locked and limited conversation to collaborators Sep 8, 2021
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

3 participants