-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2020 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. | ||
|
||
// +build !android,!js | ||
|
||
// Note: we don't run on Android because if there is any non-race test | ||
// file in this package, Android tries to link the .syso file into the | ||
// test (even when we're not in race mode), which fails. I'm not sure | ||
// why, but easiest to just punt - as long as a single builder runs | ||
// this test, we're good. | ||
|
||
package race | ||
|
||
import ( | ||
"bytes" | ||
"os/exec" | ||
"path/filepath" | ||
"runtime" | ||
"testing" | ||
) | ||
|
||
func TestIssue37485(t *testing.T) { | ||
files, err := filepath.Glob("./*.syso") | ||
if err != nil { | ||
t.Fatalf("can't find syso files: %s", err) | ||
} | ||
for _, f := range files { | ||
cmd := exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), "tool", "nm", f) | ||
res, err := cmd.CombinedOutput() | ||
if err != nil { | ||
t.Errorf("nm of %s failed: %s", f, err) | ||
continue | ||
} | ||
if bytes.Contains(res, []byte("getauxval")) { | ||
t.Errorf("%s contains getauxval", f) | ||
} | ||
} | ||
} |