Skip to content

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

Description

@rsc

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions