cmd/link: print dsymutil and strip commands in -v mode

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 <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Cherry Mui 2023-06-16 16:03:29 -04:00
parent 4d21b3ec2d
commit 5bf8f533f0

View file

@ -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)
}
@ -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)
}