]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: introduce subarch versioning of race syso
authorKeith Randall <khr@golang.org>
Mon, 15 Aug 2022 21:58:02 +0000 (14:58 -0700)
committerKeith Randall <khr@google.com>
Thu, 15 Sep 2022 14:08:12 +0000 (14:08 +0000)
Allow us to select a race .syso file based on subarch values.

Note that this doesn't actually change the syso used. This CL
just moves things around in preparation for adding v3-specific
versions in future CLs.

Change-Id: I14e3c273a7c6f07b13b22193b7a851ea94c765cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/424034
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>

src/go/build/deps_test.go
src/runtime/race/internal/amd64v1/doc.go [new file with mode: 0644]
src/runtime/race/internal/amd64v1/race_darwin.syso [moved from src/runtime/race/race_darwin_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v1/race_freebsd.syso [moved from src/runtime/race/race_freebsd_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v1/race_linux.syso [moved from src/runtime/race/race_linux_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v1/race_netbsd.syso [moved from src/runtime/race/race_netbsd_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v1/race_openbsd.syso [moved from src/runtime/race/race_openbsd_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v1/race_windows.syso [moved from src/runtime/race/race_windows_amd64.syso with 100% similarity]
src/runtime/race/internal/amd64v3/doc.go [new file with mode: 0644]
src/runtime/race/race_v1_amd64.go [new file with mode: 0644]
src/runtime/race/race_v3_amd64.go [new file with mode: 0644]

index 19b886875c9c659affe1050470db91fd998cbb82..efd28dfc21939119bcb69fb022268f544cdff04c 100644 (file)
@@ -301,7 +301,12 @@ var depsRules = `
        < C
        < runtime/cgo
        < CGO
-       < runtime/race, runtime/msan, runtime/asan;
+       < runtime/msan, runtime/asan;
+
+       # runtime/race
+       NONE < runtime/race/internal/amd64v1;
+       NONE < runtime/race/internal/amd64v3;
+       CGO, runtime/race/internal/amd64v1, runtime/race/internal/amd64v3 < runtime/race;
 
        # Bulk of the standard library must not use cgo.
        # The prohibition stops at net and os/user.
diff --git a/src/runtime/race/internal/amd64v1/doc.go b/src/runtime/race/internal/amd64v1/doc.go
new file mode 100644 (file)
index 0000000..130b290
--- /dev/null
@@ -0,0 +1,8 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This package holds the race detector .syso for
+// amd64 architectures with GOAMD64<v3.
+
+package amd64v1
diff --git a/src/runtime/race/internal/amd64v3/doc.go b/src/runtime/race/internal/amd64v3/doc.go
new file mode 100644 (file)
index 0000000..6983335
--- /dev/null
@@ -0,0 +1,8 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This package holds the race detector .syso for
+// amd64 architectures with GOAMD64>=v3.
+
+package amd64v3
diff --git a/src/runtime/race/race_v1_amd64.go b/src/runtime/race/race_v1_amd64.go
new file mode 100644 (file)
index 0000000..8dcd549
--- /dev/null
@@ -0,0 +1,10 @@
+//go:build linux || darwin || freebsd || netbsd || openbsd || windows
+// +build linux darwin freebsd netbsd openbsd windows
+
+package race
+
+import _ "runtime/race/internal/amd64v1"
+
+// Note: the build line above will eventually be something
+// like go:build linux && !amd64.v3 || darwin && !amd64.v3 || ...
+// as we build v3 versions for each OS.
diff --git a/src/runtime/race/race_v3_amd64.go b/src/runtime/race/race_v3_amd64.go
new file mode 100644 (file)
index 0000000..da87593
--- /dev/null
@@ -0,0 +1,10 @@
+//go:build none
+// +build none
+
+package race
+
+import _ "runtime/race/internal/amd64v3"
+
+// Note: the build line above will eventually be something
+// like go:build linux && amd64.v3 || darwin && amd64.v3 || ...
+// as we build v3 versions for each OS.