Commit Graph

1 Commits

Author SHA1 Message Date
Luna Nova
97a43a6db4 go: teach internal linker to use correct ELF interpreter
Teaches go's internal linker to use the GO_LDSO env var as the path for the dynamic linker, instead of defaulting to an FHS /lib path.
GO_LDSO is automatically set to the appropriate value by checking $NIX_CC/nix-support/dynamic-linker
External linking is set as the default for cross compile situations
where CGO is supported.
Teaching go to correctly handle cross
in the internal linker is hard, and our system linker already knows
how to find the right ELF interpreter.
For cross situations where CGO is not supported we assume either non-ELF
binaries or static binaries will be produced.
2025-10-07 17:32:25 -07:00