Closed RalfJung closed 1 month ago
maybe, like it s been done with illumos, we might not need to bother with memalign but using posix_memalign instead (android api 16/17 min. I believe).
Good point. Our target page says
Rust will support the most recent Long Term Support (LTS) Android Native Development Kit (NDK). By default Rust will support all API levels supported by the NDK, but a higher minimum API level may be required if deemed necessary.
I don't know what concretely that means for our current minimum API level. The current LTS version seems to be r26d, and according to this the minimum API level supported there is 21 -- so if posix_memalign is indeed in 16 or 17 we should be able to use it.
@chriswailes do you think we can switch the Rust allocator to posix_memalign
on Android and use the common code path that most Unixes use? It's always nice to cut down on exceptions. :) And also it'd be less work for Miri to support Android, then. ;)
I opened a PR to use posix_memalign on Android: https://github.com/rust-lang/rust/pull/125244
The goal is to get this command to pass:
I think all that's missing is
libc::memalign