]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/testdir: pass -buildid to link command
authorCherry Mui <cherryyz@google.com>
Sat, 2 Aug 2025 22:08:26 +0000 (18:08 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 6 Aug 2025 19:27:26 +0000 (12:27 -0700)
The new dynamic loader in macOS 26 beta doesn't like binaries
without LC_UUID. Binaries built by "go build" have LC_UUID by
default. When invoking the linker manually, it has an LC_UUID by
default if a Go buildid is specified. This CL makes it pass
-buildid to link command for the test directory, so the binaries
will have LC_UUID.

Change-Id: I9369aeb7323d211eda80e4f22f459c220085f61d
Reviewed-on: https://go-review.googlesource.com/c/go/+/692876
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/internal/testdir/testdir_test.go

index 2e2f55b06edce5ef0505a4cf3bb087d9790240f6..5781276afadba7ebb9a013f3d70875f6559949e5 100644 (file)
@@ -242,7 +242,7 @@ func linkFile(runcmd runCmd, outfile, infile string, importcfg string, ldflags [
        if strings.HasSuffix(infile, ".go") {
                infile = infile[:len(infile)-3] + ".o"
        }
-       cmd := []string{goTool, "tool", "link", "-s", "-w", "-o", outfile, "-importcfg=" + importcfg}
+       cmd := []string{goTool, "tool", "link", "-s", "-w", "-buildid=test", "-o", outfile, "-importcfg=" + importcfg}
        if *linkshared {
                cmd = append(cmd, "-linkshared", "-installsuffix=dynlink")
        }