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/dist: baked-in settings need to be per-GOOS/GOARCH #54196

Closed
rsc opened this issue Aug 2, 2022 · 1 comment
Closed

cmd/dist: baked-in settings need to be per-GOOS/GOARCH #54196

rsc opened this issue Aug 2, 2022 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Aug 2, 2022

The settings CGO_ENABLED, GO_LDSO, and GO_EXTLINK_ENABLED are baked into the toolchain built by cmd/dist without reference to which GOOS/GOARCH they are appropriate for. This results in toolchains that may use inappropriate settings for cross-compiling. The same is true of CC and CXX, but there we also have CC_FOR_TARGET, CC_FOR_${GOOS}_${GOARCH}, and so on. We should probably do the same for these other settings. Doing it for CGO_ENABLED would allow building a cross-compiled toolchain that uses cgo on the target system, which is necessary (and perhaps sufficient) for #53862.

I will take a look at this. I filed a separate bug #54197 for not baking in GO_LDSO at all.

@dmitshur dmitshur added this to the Go1.20 milestone Aug 3, 2022
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 3, 2022
@rsc
Copy link
Contributor Author

rsc commented Nov 8, 2022

CGO_ENABLED turns out to be OK because you can run make.bash with CGO_ENABLED="" to get "automatic" mode.
The changes I made for #54197 end up doing the same for GO_LDSO.
That leaves GO_EXTLINK_ENABLED, which is rarely set explicitly either.
So there may not be anything to do here after all.

@rsc rsc closed this as completed Nov 11, 2022
@golang golang locked and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants