aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-08-02 18:08:26 -0400
committerGopher Robot <gobot@golang.org>2026-03-11 09:38:18 -0700
commitb02c84a684e19df70bcac25794e19f3f63bec939 (patch)
tree6fd86683e1107cb6c41981ecbd352e0c65c3fb3e
parent814b540c17dceb0ec486263d81444ea20f23d09d (diff)
downloadgo-b02c84a684e19df70bcac25794e19f3f63bec939.tar.xz
[release-branch.go1.25] cmd/internal/testdir: pass -buildid to link command
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. For #78012. Fixes #78056. 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> Cq-Include-Trybots: luci.golang.try:go1.25-darwin-arm64_26 (cherry picked from commit 025d36917c8f56baede2f477131bbf08bf1382ca) Reviewed-on: https://go-review.googlesource.com/c/go/+/753681 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
-rw-r--r--src/cmd/internal/testdir/testdir_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/testdir/testdir_test.go b/src/cmd/internal/testdir/testdir_test.go
index f46a143aee..529445a7da 100644
--- a/src/cmd/internal/testdir/testdir_test.go
+++ b/src/cmd/internal/testdir/testdir_test.go
@@ -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")
}