From 79341998770e2a9ede011a3d0e0291ec281bbc86 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 27 Feb 2015 22:50:01 -0500 Subject: [PATCH] cmd/dist: record default GO_EXTLINK_ENABLED in Go Today it's only recorded for C, but the Go version of the linker will need it. Change-Id: I0de56d98e8f3f1b7feb830458c0934af367fd29a Reviewed-on: https://go-review.googlesource.com/6333 Reviewed-by: Rob Pike Reviewed-by: Minux Ma --- src/cmd/dist/buildruntime.go | 4 +++- src/cmd/internal/obj/util.go | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go index 317652476b..112326558a 100644 --- a/src/cmd/dist/buildruntime.go +++ b/src/cmd/dist/buildruntime.go @@ -42,6 +42,7 @@ func mkzversion(dir, file string) { // const defaultGOARM = // const defaultGOOS = // const defaultGOARCH = +// const defaultGO_EXTLINK_ENABLED = // const version = // const goexperiment = // @@ -56,9 +57,10 @@ func mkzbootstrap(file string) { "const defaultGOARM = `%s`\n"+ "const defaultGOOS = `%s`\n"+ "const defaultGOARCH = `%s`\n"+ + "const defaultGO_EXTLINK_ENABLED = `%s`\n"+ "const version = `%s`\n"+ "const goexperiment = `%s`\n", - goroot_final, go386, goarm, gohostos, gohostarch, findgoversion(), os.Getenv("GOEXPERIMENT")) + goroot_final, go386, goarm, gohostos, gohostarch, goextlinkenabled, findgoversion(), os.Getenv("GOEXPERIMENT")) writefile(out, file, 0) } diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 14f9b3655e..a3c88a2b8a 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -231,6 +231,10 @@ func Getgo386() string { return envOr("GO386", defaultGO386) } +func Getgoextlinkenabled() string { + return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED) +} + func Getgoversion() string { return version } -- 2.48.1