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 <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
This commit is contained in:
Keith Randall 2022-08-15 14:58:02 -07:00 committed by Keith Randall
parent 7c3284401f
commit e665de2861
11 changed files with 42 additions and 1 deletions

View 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.

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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.