Commit 2f170520 authored by Russ Cox's avatar Russ Cox

cmd/link: do not store compilation directory in DWARF info

This makes 'go install cmd/compile' in one directory produce
a different binary from running it in another directory,
which is problematic for reproducible builds.

Change-Id: If26685d2e45d2695413b472142b49694716575fa
Reviewed-on: https://go-review.googlesource.com/74790
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent f1ce59d9
......@@ -20,7 +20,6 @@ import (
"cmd/link/internal/sym"
"fmt"
"log"
"os"
"strings"
)
......@@ -1024,9 +1023,8 @@ func putpclcdelta(linkctxt *Link, ctxt dwarf.Context, s *sym.Symbol, deltaPC uin
*/
func getCompilationDir() string {
if dir, err := os.Getwd(); err == nil {
return dir
}
// OS X requires this, but it's really none of its business.
// Hard-code "/" for reproducible builds.
return "/"
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment