-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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: CC_FOR_${GOOS}_${GOARCH} not documented #51306
Comments
The You are trying to set it do something different, but that's not what it's for. To do what you want, set an environment variable like |
Oh, yes, that is the one I was thinking of. It is currently missing from the make.bash documentation, but is mentioned in the cgo documentation. Can it be added? https://github.com/golang/go/blob/master/src/make.bash |
Sure, want to send a patch? |
Change https://go.dev/cl/388176 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Relevant env vars (darwin):
Relevant env vars (windows):
What did you do?
Ran
make.bash
.What did you expect to see?
I expected it to produce a compiler that runs on darwin with clang as the default CC, and a compiler that runs on windows with gcc as the default CC.
What did you see instead?
For
GOOS=darwin
it tries to useCC_FOR_TARGET
, and then claims thatCC
isn't set.For
GOOS=windows
it tries to pass Windows-only flags to the Linux C compiler.If I try with
CGO_ENABLED=0
, then the resulting compiler hasCGO_ENABLED=0
by default when run on the target, which is undesirable. (#51305)The intent of passing
CC_FOR_TARGET
andCXX_FOR_TARGET
is to burn these default values into the resulting compiler, not to actually use them while building the compiler. For example, the pre-canned macos toolchain knows to use clang by default instead of gcc, and we want to replicate this.The text was updated successfully, but these errors were encountered: