On Linux, for a shared object, at least with the Gold linker, the
output file path is recorded in the .gnu.version_d section. When
the output file path is in a temporary directory, it causes
nondeterministic build.
This is similar to #58557, but for Linux with the Gold linker.
Apply the same workaround as in CL 477296.
Should fix the linux-arm64-longtest builder.
Change-Id: Ic703bff32c1bcc40054b89be696e04280855e876
Reviewed-on: https://go-review.googlesource.com/c/go/+/478196
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
// just the final path element.
// On Windows, DLL file name is recorded in PE file
// export section, so do like on OS X.
+ // On Linux, for a shared object, at least with the Gold linker,
+ // the output file path is recorded in the .gnu.version_d section.
dir := "."
- if (cfg.Goos == "darwin" || cfg.Goos == "windows") && (cfg.BuildBuildmode == "c-shared" || cfg.BuildBuildmode == "plugin") {
+ if cfg.BuildBuildmode == "c-shared" || cfg.BuildBuildmode == "plugin" {
dir, out = filepath.Split(out)
}