Skip to content

Commit e665de2

Browse files
committed
runtime/race: introduce subarch versioning of race syso
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Keith Randall <[email protected]>
1 parent 7c32844 commit e665de2

11 files changed

+42
-1
lines changed

src/go/build/deps_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ var depsRules = `
301301
< C
302302
< runtime/cgo
303303
< CGO
304-
< runtime/race, runtime/msan, runtime/asan;
304+
< runtime/msan, runtime/asan;
305+
306+
# runtime/race
307+
NONE < runtime/race/internal/amd64v1;
308+
NONE < runtime/race/internal/amd64v3;
309+
CGO, runtime/race/internal/amd64v1, runtime/race/internal/amd64v3 < runtime/race;
305310
306311
# Bulk of the standard library must not use cgo.
307312
# The prohibition stops at net and os/user.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2022 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// This package holds the race detector .syso for
6+
// amd64 architectures with GOAMD64<v3.
7+
8+
package amd64v1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2022 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// This package holds the race detector .syso for
6+
// amd64 architectures with GOAMD64>=v3.
7+
8+
package amd64v3

src/runtime/race/race_v1_amd64.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build linux || darwin || freebsd || netbsd || openbsd || windows
2+
// +build linux darwin freebsd netbsd openbsd windows
3+
4+
package race
5+
6+
import _ "runtime/race/internal/amd64v1"
7+
8+
// Note: the build line above will eventually be something
9+
// like go:build linux && !amd64.v3 || darwin && !amd64.v3 || ...
10+
// as we build v3 versions for each OS.

src/runtime/race/race_v3_amd64.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build none
2+
// +build none
3+
4+
package race
5+
6+
import _ "runtime/race/internal/amd64v3"
7+
8+
// Note: the build line above will eventually be something
9+
// like go:build linux && amd64.v3 || darwin && amd64.v3 || ...
10+
// as we build v3 versions for each OS.

0 commit comments

Comments
 (0)