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

Open
rsc opened this issue Aug 2, 2022 · 0 comments
Open

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

rsc opened this issue Aug 2, 2022 · 0 comments
Labels
NeedsInvestigation
Milestone

Comments

@rsc
Copy link
Contributor

@rsc 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 label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants