Skip to content

Commit e49b230

Browse files
committed
runtime/race: rebuild some .syso files to remove getauxval dependency
We can't depend on getauxval because it only exists in glibc >= 2.16. Tsan has been updated to avoid that dependency (https://reviews.llvm.org/D84859). This CL rebuilds the affected .syso files, and adds a test to make sure we don't regress. Fixes #37485 Change-Id: I891f54d28ec0d7da50a8df1adadc76dd6e7ab3e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/246258 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitry Vyukov <[email protected]>
1 parent 10523c0 commit e49b230

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

src/runtime/race/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ To update the .syso files use golang.org/x/build/cmd/racebuild.
66

77
race_darwin_amd64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
88
race_freebsd_amd64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
9-
race_linux_amd64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
10-
race_linux_ppc64le.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
9+
race_linux_amd64.syso built with LLVM 6c75db8b4bc59eace18143ce086419d37da24746 and Go 7388956b76ce15a11346cebefcf6193db044caaf.
10+
race_linux_ppc64le.syso built with LLVM 6c75db8b4bc59eace18143ce086419d37da24746 and Go 7388956b76ce15a11346cebefcf6193db044caaf.
1111
race_netbsd_amd64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
1212
race_windows_amd64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
13-
race_linux_arm64.syso built with LLVM 3496d6e4bea9cb99cb382939b7e79a50a3b863a5 and Go 553e003414d3aa90cc39830ee22f08453d9f3408.
13+
race_linux_arm64.syso built with LLVM 6c75db8b4bc59eace18143ce086419d37da24746 and Go 7388956b76ce15a11346cebefcf6193db044caaf.
3 KB
Binary file not shown.
2.86 KB
Binary file not shown.
4.16 KB
Binary file not shown.

src/runtime/race/syso_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2020 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+
// +build !android,!js
6+
7+
// Note: we don't run on Android because if there is any non-race test
8+
// file in this package, Android tries to link the .syso file into the
9+
// test (even when we're not in race mode), which fails. I'm not sure
10+
// why, but easiest to just punt - as long as a single builder runs
11+
// this test, we're good.
12+
13+
package race
14+
15+
import (
16+
"bytes"
17+
"os/exec"
18+
"path/filepath"
19+
"runtime"
20+
"testing"
21+
)
22+
23+
func TestIssue37485(t *testing.T) {
24+
files, err := filepath.Glob("./*.syso")
25+
if err != nil {
26+
t.Fatalf("can't find syso files: %s", err)
27+
}
28+
for _, f := range files {
29+
cmd := exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), "tool", "nm", f)
30+
res, err := cmd.CombinedOutput()
31+
if err != nil {
32+
t.Errorf("nm of %s failed: %s", f, err)
33+
continue
34+
}
35+
if bytes.Contains(res, []byte("getauxval")) {
36+
t.Errorf("%s contains getauxval", f)
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)