aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-09-12 13:46:31 -0400
committerCherry Mui <cherryyz@google.com>2025-09-15 10:59:16 -0700
commite603e9834e83ec67f0dd39c4e77683eef0593946 (patch)
tree591132c79c67cc879383c045cc174a72bf1f72a6 /src/cmd/link
parente5ee1f2600138ce4f34dd1f50d3d1bc482a2e7b0 (diff)
downloadgo-e603e9834e83ec67f0dd39c4e77683eef0593946.tar.xz
cmd/link: support race mode with MSVC clang
I couldn't make --print-file-name work with -msvc clang. (The library name is synchronization.lib, but even with that name it still doesn't print the full path.) Assume it always synchronization.lib. Change-Id: I22e8f14824f7f7e96b71b913217b1f604f1e2da7 Reviewed-on: https://go-review.googlesource.com/c/go/+/703398 Reviewed-by: Than McIntosh <thanm@golang.org> Reviewed-by: Florian Zenker <floriank@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/link')
-rw-r--r--src/cmd/link/internal/ld/lib.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 516150a0a7..1a1bc18675 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1943,7 +1943,11 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-Wl,-T,"+p)
}
if *flagRace {
- if p := ctxt.findLibPath("libsynchronization.a"); p != "libsynchronization.a" {
+ // Apparently --print-file-name doesn't work with -msvc clang.
+ // (The library name is synchronization.lib, but even with that
+ // name it still doesn't print the full path.) Assume it always
+ // it.
+ if isMSVC || ctxt.findLibPath("libsynchronization.a") != "libsynchronization.a" {
argv = append(argv, "-lsynchronization")
}
}