From b5af5c0834a57751fae78fefc922f5e9f5b50941 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 15 Feb 2022 13:22:45 -0500 Subject: [PATCH] runtime: enable sigPerThreadSyscall handling on android CL 383434 forgot to enable these paths for android, which is still linux just not via GOOS. Fixes #51213. Change-Id: I102e53e8671403ded6edb4ba04789154d7a0730b Reviewed-on: https://go-review.googlesource.com/c/go/+/385954 Trust: Michael Pratt Run-TryBot: Michael Pratt Reviewed-by: Cherry Mui Reviewed-by: Austin Clements TryBot-Result: Gopher Robot --- src/runtime/signal_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index 6f25fc91fa..2dd4cc51a3 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -161,7 +161,7 @@ func sigInstallGoHandler(sig uint32) bool { } } - if GOOS == "linux" && !iscgo && sig == sigPerThreadSyscall { + if (GOOS == "linux" || GOOS == "android") && !iscgo && sig == sigPerThreadSyscall { // sigPerThreadSyscall is the same signal used by glibc for // per-thread syscalls on Linux. We use it for the same purpose // in non-cgo binaries. @@ -623,7 +623,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) { return } - if GOOS == "linux" && sig == sigPerThreadSyscall { + if (GOOS == "linux" || GOOS == "android") && sig == sigPerThreadSyscall { // sigPerThreadSyscall is the same signal used by glibc for // per-thread syscalls on Linux. We use it for the same purpose // in non-cgo binaries. Since this signal is not _SigNotify, -- 2.48.1