]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/ld: skip dwarf output if dsymutil no-ops
authorTamir Duberstein <tamird@gmail.com>
Sun, 8 Nov 2015 00:30:25 +0000 (19:30 -0500)
committerIan Lance Taylor <iant@golang.org>
Sun, 8 Nov 2015 19:33:35 +0000 (19:33 +0000)
Fixes #11994.

Change-Id: Icee6ffa6e3a9d15b68b4ae9b2716d65ecbdba73a
Reviewed-on: https://go-review.googlesource.com/16702
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go

index f0e051173b736c2abb72415b8457da1373f9002e..3620b1598e0193df9f277fe455fdafb41a722ea7 100644 (file)
@@ -1171,6 +1171,10 @@ func hostlink() {
                                Ctxt.Cursym = nil
                                Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out)
                        }
+                       // Skip combining if `dsymutil` didn't generate a file. See #11994.
+                       if _, err := os.Stat(dsym); os.IsNotExist(err) {
+                               return
+                       }
                        // For os.Rename to work reliably, must be in same directory as outfile.
                        combinedOutput := outfile + "~"
                        if err := machoCombineDwarf(outfile, dsym, combinedOutput); err != nil {