Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/dist: use GOHOSTARCH/GOHOSTOS instead of GOOS/GOARCH for host libraries and binaries #6559
If you are, say, on a Mac, and you cd src/pkg/runtime GOOS=linux make then cmd/dist correctly builds the linux copy of runtime.a. However, if you cd src/cmd/6l GOOS=linux make then cmd/dist incorrectly tries to build a "linux" copy of 6l (and fails, beacuse the "linux" copies of the libraries don't exist). It should be building the darwin copy, because GOHOSTOS is darwin. The make.bash sequence sets GOHOSTOS=GOOS and GOHOSTARCH=GOARCH during the builds in those directories, so it hasn't come up in that context. However, if you are working on a cross-compiled system it's annoying that you can't leave GOOS set to the target system. Every time you build a host tool you need to set it back.