Recognize NetBSD in:
- go/internal/work/init.go
- race.bash
- runtime/race/race.go
Add __ps_strings symbol in runtime/cgo/netbsd.go as this is
used internally in the TSan library for NetBSD and used for
ReExec().
Tested on NetBSD/amd64 v. 8.99.12.
Around 98% tests are passing for the ./race.bash target.
Updates #19273
Change-Id: Ic0e48d2fb159a7868aab5e17156eeaca1225e513
GitHub-Last-Rev:
d6e082707b9b18df1fe63f723666f4d2eb5e6cfe
GitHub-Pull-Request: golang/go#24322
Reviewed-on: https://go-review.googlesource.com/99835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
platform := cfg.Goos + "/" + cfg.Goarch
switch platform {
default:
- fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
+ fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
os.Exit(2)
- case "linux/amd64", "linux/ppc64le", "freebsd/amd64", "darwin/amd64", "windows/amd64":
+ case "linux/amd64", "linux/ppc64le", "freebsd/amd64", "netbsd/amd64", "darwin/amd64", "windows/amd64":
// race supported on these platforms
}
}
set -e
function usage {
- echo 'race detector is only supported on linux/amd64, linux/ppc64le, freebsd/amd64 and darwin/amd64' 1>&2
+ echo 'race detector is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64 and darwin/amd64' 1>&2
exit 1
}
usage
fi
;;
+"NetBSD")
+ if [ $(uname -m) != "amd64" ]; then
+ usage
+ fi
+ ;;
*)
usage
;;
//go:linkname _environ environ
//go:linkname _progname __progname
+//go:linkname ___ps_strings __ps_strings
var _environ uintptr
var _progname uintptr
+var ___ps_strings uintptr
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build race,linux,amd64 race,freebsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le
+// +build race,linux,amd64 race,freebsd,amd64 race,netbsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le
package race