]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: don't skip code sign even if dsymutil didn't generate a file
authorCherry Mui <cherryyz@google.com>
Fri, 21 Jun 2024 16:20:38 +0000 (12:20 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 26 Jun 2024 16:17:50 +0000 (16:17 +0000)
Even if dsymutil didn't generate a file (which should not happen
with the Apple toolchain with the correct setup), we should not
skip next steps, e.g. code sign. A return statement makes it exit
too early.

Updates #68088.

Change-Id: Ic1271ed1b7fe5bdee5a25cc5d669a105173b389e
Reviewed-on: https://go-review.googlesource.com/c/go/+/593660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/lib.go

index fee7888b7cf982bca72c4d8207a3113d18e76e0a..4f1eebb9e36656d35b871a8bec313c9b72a4cdb1 100644 (file)
@@ -2050,14 +2050,13 @@ func (ctxt *Link) hostlink() {
                        Exitf("%s: running strip failed: %v\n%s\n%s", os.Args[0], err, cmd, out)
                }
                // Skip combining if `dsymutil` didn't generate a file. See #11994.
-               if _, err := os.Stat(dsym); os.IsNotExist(err) {
-                       return
+               if _, err := os.Stat(dsym); err == nil {
+                       updateMachoOutFile("combining dwarf",
+                               func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error {
+                                       return machoCombineDwarf(ctxt, exef, exem, dsym, outexe)
+                               })
+                       uuidUpdated = true
                }
-               updateMachoOutFile("combining dwarf",
-                       func(ctxt *Link, exef *os.File, exem *macho.File, outexe string) error {
-                               return machoCombineDwarf(ctxt, exef, exem, dsym, outexe)
-                       })
-               uuidUpdated = true
        }
        if ctxt.IsDarwin() && !uuidUpdated && *flagBuildid != "" {
                updateMachoOutFile("rewriting uuid",