]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: do not store compilation directory in DWARF info
authorRuss Cox <rsc@golang.org>
Tue, 31 Oct 2017 19:42:17 +0000 (15:42 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 31 Oct 2017 23:49:04 +0000 (23:49 +0000)
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: David Crawshaw <crawshaw@golang.org>
src/cmd/link/internal/ld/dwarf.go

index f92169b30f1c691c6e273833d7bf449808174148..d0fae2c79faa2c385d3c48afbcb74f614a5b4da6 100644 (file)
@@ -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 "/"
 }