Skip to content

Commit 5ee5528

Browse files
Ryan Browncrawshaw
authored andcommitted
cmd/link/internal/ld: Skip combining dwarf for darwin/arm.
Change-Id: I3a6df0a76d57db7cb6910f4179a6ce380f219a37 Reviewed-on: https://go-review.googlesource.com/10442 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent 8b186df commit 5ee5528

File tree

1 file changed

+18
-15
lines changed
  • src/cmd/link/internal/ld

1 file changed

+18
-15
lines changed

src/cmd/link/internal/ld/lib.go

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,21 +1055,24 @@ func hostlink() {
10551055
}
10561056

10571057
if Debug['s'] == 0 && debug_s == 0 && HEADTYPE == obj.Hdarwin {
1058-
dsym := fmt.Sprintf("%s/go.dwarf", tmpdir)
1059-
if out, err := exec.Command("dsymutil", "-f", outfile, "-o", dsym).CombinedOutput(); err != nil {
1060-
Ctxt.Cursym = nil
1061-
Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out)
1062-
}
1063-
combinedOutput := fmt.Sprintf("%s/go.combined", tmpdir)
1064-
if err := machoCombineDwarf(outfile, dsym, combinedOutput); err != nil {
1065-
Ctxt.Cursym = nil
1066-
Exitf("%s: combining dwarf failed: %v", os.Args[0], err)
1067-
}
1068-
origOutput := fmt.Sprintf("%s/go.orig", tmpdir)
1069-
os.Rename(outfile, origOutput)
1070-
if err := os.Rename(combinedOutput, outfile); err != nil {
1071-
Ctxt.Cursym = nil
1072-
Exitf("%s: rename(%s, %s) failed: %v", os.Args[0], combinedOutput, outfile, err)
1058+
// Skip combining dwarf on arm.
1059+
if Thearch.Thechar != '5' && Thearch.Thechar != '7' {
1060+
dsym := fmt.Sprintf("%s/go.dwarf", tmpdir)
1061+
if out, err := exec.Command("dsymutil", "-f", outfile, "-o", dsym).CombinedOutput(); err != nil {
1062+
Ctxt.Cursym = nil
1063+
Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out)
1064+
}
1065+
combinedOutput := fmt.Sprintf("%s/go.combined", tmpdir)
1066+
if err := machoCombineDwarf(outfile, dsym, combinedOutput); err != nil {
1067+
Ctxt.Cursym = nil
1068+
Exitf("%s: combining dwarf failed: %v", os.Args[0], err)
1069+
}
1070+
origOutput := fmt.Sprintf("%s/go.orig", tmpdir)
1071+
os.Rename(outfile, origOutput)
1072+
if err := os.Rename(combinedOutput, outfile); err != nil {
1073+
Ctxt.Cursym = nil
1074+
Exitf("%s: rename(%s, %s) failed: %v", os.Args[0], combinedOutput, outfile, err)
1075+
}
10731076
}
10741077
}
10751078
}

0 commit comments

Comments
 (0)