From e4665da9bcdd4e9136c7ed97ab4253def130b89d Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 7 Apr 2019 15:02:31 +0200 Subject: cmd/go/internal/work: make toolchain builds reproducible when buildmode=pie When buildmode=pie, external linking is forced, and our toolchain build id will be included in the external build id, resulting in the building of a toolchain tool will never reach a fixed point id. More importantly, this change will make make.bash converge on self-hosted Android builds (Android refuses to run non-PIE executables). Fixes #31320 Updates #18968 Change-Id: Icb5db9f4b1b688afe37f4dafe261ffda580fa4e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/170942 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/internal/sys/supported.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cmd/internal/sys') diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go index a53da6ed2c..c963971f59 100644 --- a/src/cmd/internal/sys/supported.go +++ b/src/cmd/internal/sys/supported.go @@ -27,3 +27,11 @@ func MSanSupported(goos, goarch string) bool { return false } } + +// PIEDefaultsToExternalLink reports whether goos/goarch defaults +// to external linking for buildmode=pie. +func PIEDefaultsToExternalLink(goos, goarch string) bool { + // Currently all systems external link PIE binaries. + // See https://golang.org/issue/18968. + return true +} -- cgit v1.3-5-g9baa