]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: print dsymutil and strip commands in -v mode
authorCherry Mui <cherryyz@google.com>
Fri, 16 Jun 2023 20:03:29 +0000 (16:03 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 21 Jul 2023 15:44:44 +0000 (15:44 +0000)
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>

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

index 595e656e5b16cb1b1a6cb2be883d7b90e8e91898..de0a54d588bb1ff0abdb7e035088819c827331ca 100644 (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)
                }