Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete basic support for android #3608

Closed
RalfJung opened this issue May 16, 2024 · 3 comments · Fixed by #3616
Closed

Complete basic support for android #3608

RalfJung opened this issue May 16, 2024 · 3 comments · Fixed by #3616
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available

Comments

@RalfJung
Copy link
Member

RalfJung commented May 16, 2024

The goal is to get this command to pass:

./miri test --target aarch64-linux-android empty_main integer vec string btreemap hello hashmap heap_alloc align

I think all that's missing is

  • support for aligned allocations via libc::memalign
  • support for the getrandom weak symbol
@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-shims Area: This affects the external function shims E-good-first-issue A good way to start contributing, mentoring is available labels May 16, 2024
@RalfJung RalfJung changed the title Complete basic support for andoid Complete basic support for android May 16, 2024
@devnexen
Copy link
Contributor

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).

@RalfJung
Copy link
Member Author

RalfJung commented May 17, 2024

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. ;)

@RalfJung
Copy link
Member Author

I opened a PR to use posix_memalign on Android: rust-lang/rust#125244

bors added a commit that referenced this issue May 19, 2024
make basic things work on Android

Fixes #3608
@bors bors closed this as completed in 97cd966 May 19, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-good-first-issue A good way to start contributing, mentoring is available
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants