Skip to content

Commit

Permalink
cmd/link: print dsymutil and strip commands in -v mode
Browse files Browse the repository at this point in the history
If -v is specified, print dsymutil and strip commands.

Change-Id: Icaff2b41ab582d8c58a4ec65438c2986d88def9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/506758
Reviewed-by: Than McIntosh <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Cherry Mui <[email protected]>
  • Loading branch information
cherrymui committed Jul 21, 2023
1 parent 4d21b3e commit 5bf8f53
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cmd/link/internal/ld/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,13 @@ func (ctxt *Link) hostlink() {
// dsymutil may not clean up its temp directory at exit.
// Set DSYMUTIL_REPRODUCER_PATH to work around. see issue 59026.
cmd.Env = append(os.Environ(), "DSYMUTIL_REPRODUCER_PATH="+*flagTmpdir)
if ctxt.Debugvlog != 0 {
ctxt.Logf("host link dsymutil:")
for _, v := range cmd.Args {
ctxt.Logf(" %q", v)
}
ctxt.Logf("\n")
}
if out, err := cmd.CombinedOutput(); err != nil {
Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out)
}
Expand All @@ -1943,6 +1950,13 @@ func (ctxt *Link) hostlink() {
stripArgs = append(stripArgs, "-x")
}
stripArgs = append(stripArgs, *flagOutfile)
if ctxt.Debugvlog != 0 {
ctxt.Logf("host link strip: %q", stripCmd)
for _, v := range stripArgs {
ctxt.Logf(" %q", v)
}
ctxt.Logf("\n")
}
if out, err := exec.Command(stripCmd, stripArgs...).CombinedOutput(); err != nil {
Exitf("%s: running strip failed: %v\n%s", os.Args[0], err, out)
}
Expand Down

0 comments on commit 5bf8f53

Please sign in to comment.