android: stdlib stack overflow handlers are not installed #124823
Open
Description
When updating the CI to newer NDK/APIs, I enabled aarch64-linux-android
testing, and found that tests/ui/abi/stack-probes.rs
was failing. Luckily, the stack probes themselves are working (the expected SIGSEGV is being triggered), but as the signal handler is not installed, the test fails and the user wouldn't receive a helpful error + backtrace in the real world.
The registration is currently in an odd state where the implementation is enabled for Linux but not Android, and yet contains Android-specific cfgs inside.
Enabling it (by adding "android"
to both the mod
cfg blocks) works on aarch64
, but on arm
, it fails because getauxval
is missing from libc
.
The route to fixing this:
- Add the
getauxval
declaration to libc android 32-bit (it's already in 64-bit). The original argument for not including it is that it was added in Android API 18. Since we're bumping to 21+ as the minimum API, that should not be an issue. - Add
android
to the registration block - Remove the
ignore-android
I'm about to add fromtests/ui/abi/stack-probes.rs
andtests/ui/abi/stack-probes-lto.rs
and check that they still work.
cc @chriswailes Perhaps you'd like to take this one?