From: Meng Zhuo Date: Fri, 16 Oct 2020 01:19:00 +0000 (+0800) Subject: cmd/link: use xcode strip for macho combine dwarf X-Git-Tag: go1.16beta1~577 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7e25bdba5e79d223566745fca2410f725a6dedda;p=gostls13.git cmd/link: use xcode strip for macho combine dwarf The GNU strip will shrink text section while xcodetool strip don't. We have to use xcodetool strip from system explicitly. Fixes #41967 Change-Id: Ida372869e0ebc9e93f883640b1614836cea3672f Reviewed-on: https://go-review.googlesource.com/c/go/+/262398 Run-TryBot: Cherry Zhang TryBot-Result: Go Bot Reviewed-by: Cherry Zhang Trust: Meng Zhuo --- diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index a68725bef9..aaf443903c 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1614,12 +1614,12 @@ func (ctxt *Link) hostlink() { if combineDwarf { dsym := filepath.Join(*flagTmpdir, "go.dwarf") - if out, err := exec.Command("dsymutil", "-f", *flagOutfile, "-o", dsym).CombinedOutput(); err != nil { + if out, err := exec.Command("xcrun", "dsymutil", "-f", *flagOutfile, "-o", dsym).CombinedOutput(); err != nil { Exitf("%s: running dsymutil failed: %v\n%s", os.Args[0], err, out) } // Remove STAB (symbolic debugging) symbols after we are done with them (by dsymutil). // They contain temporary file paths and make the build not reproducible. - if out, err := exec.Command("strip", "-S", *flagOutfile).CombinedOutput(); err != nil { + if out, err := exec.Command("xcrun", "strip", "-S", *flagOutfile).CombinedOutput(); err != nil { Exitf("%s: running strip failed: %v\n%s", os.Args[0], err, out) } // Skip combining if `dsymutil` didn't generate a file. See #11994.