nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go
2index 87e8867176..dbb635011f 100644
3--- a/src/cmd/dist/buildruntime.go
4+++ b/src/cmd/dist/buildruntime.go
5@@ -62,7 +62,7 @@ func mkbuildcfg(file string) {
6 fmt.Fprintf(&buf, "const DefaultGORISCV64 = `%s`\n", goriscv64)
7 fmt.Fprintf(&buf, "const defaultGOEXPERIMENT = `%s`\n", goexperiment)
8 fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled)
9- fmt.Fprintf(&buf, "const defaultGO_LDSO = `%s`\n", defaultldso)
10+ fmt.Fprintf(&buf, "const DefaultGO_LDSO = `%s`\n", defaultldso)
11 fmt.Fprintf(&buf, "const version = `%s`\n", findgoversion())
12 fmt.Fprintf(&buf, "const defaultGOOS = runtime.GOOS\n")
13 fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n")
14diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go
15index 6ff1d94383..147a7d91c9 100644
16--- a/src/cmd/link/internal/ld/elf.go
17+++ b/src/cmd/link/internal/ld/elf.go
18@@ -1927,8 +1927,12 @@ func asmbElf(ctxt *Link) {
19 sh.Flags = uint64(elf.SHF_ALLOC)
20 sh.Addralign = 1
21
22- if interpreter == "" && buildcfg.GOOS == runtime.GOOS && buildcfg.GOARCH == runtime.GOARCH && buildcfg.GO_LDSO != "" {
23- interpreter = buildcfg.GO_LDSO
24+ if interpreter == "" {
25+ if goLdso := os.Getenv("GO_LDSO"); goLdso != "" {
26+ interpreter = goLdso
27+ } else if buildcfg.GOOS == runtime.GOOS && buildcfg.GOARCH == runtime.GOARCH {
28+ interpreter = buildcfg.DefaultGO_LDSO
29+ }
30 }
31
32 if interpreter == "" {
33diff --git a/src/internal/buildcfg/cfg.go b/src/internal/buildcfg/cfg.go
34index 7e4ee365df..8aaa70fb36 100644
35--- a/src/internal/buildcfg/cfg.go
36+++ b/src/internal/buildcfg/cfg.go
37@@ -33,7 +33,6 @@ var (
38 GORISCV64 = goriscv64()
39 GOWASM = gowasm()
40 ToolTags = toolTags()
41- GO_LDSO = defaultGO_LDSO
42 GOFIPS140 = gofips140()
43 Version = version
44 )