runtime: fix TestUsingVDSO on linux/ppc64le

Only check for clock_gettime64 on 32b hosts.

Fixes #74672

Change-Id: I24a008575522f2eff73427263cc7a155c36f37b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/776061
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Paul Murphy 2026-05-08 14:42:29 -05:00
parent 2403e594a5
commit 2568174249

View file

@ -9,6 +9,7 @@ package runtime_test
import (
"bytes"
"internal/asan"
"internal/goarch"
"internal/testenv"
"os"
"os/exec"
@ -53,10 +54,14 @@ func TestUsingVDSO(t *testing.T) {
t.Skipf("skipping because Executable failed: %v", err)
}
// Trace both clock_gettime and clock_gettime64: 32-bit Linux glibc uses
// the y2038-safe clock_gettime64 syscall, and strace's -e filter is an
// exact match, not a prefix.
const traceFilter = "clock_gettime,clock_gettime64"
traceFilter := "clock_gettime"
if goarch.PtrSize == 4 {
// Trace both clock_gettime and clock_gettime64: 32-bit Linux glibc uses
// the y2038-safe clock_gettime64 syscall, and strace's -e filter is an
// exact match, not a prefix.
traceFilter += ",clock_gettime64"
}
t.Logf("GO_WANT_HELPER_PROCESS=1 %s -f -e %s %s -test.run=^TestUsingVDSO$", strace, traceFilter, exe)
cmd := testenv.Command(t, strace, "-f", "-e", traceFilter, exe, "-test.run=^TestUsingVDSO$")