Skip to content

Add getauxval for Android #1987

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

Closed
jack-signal opened this issue Dec 4, 2020 · 1 comment · Fixed by #1991
Closed

Add getauxval for Android #1987

jack-signal opened this issue Dec 4, 2020 · 1 comment · Fixed by #1991
Labels
C-API-request Category: API request

Comments

@jack-signal
Copy link
Contributor

getauxval is useful for detecting CPU specific features such as availability of the ARMv8 AES instructions.

Currently in this crate, getauxval is available on Linux but not on Android. This function was added to Android in API Level 18 (https://developer.android.com/ndk/guides/cpu-features). So it might be a problem for someone building to an older API level. However on aarch64 and x86_64 the earliest API Level is 21 and thus for these architectures getauxval is always available.

Happy to contribute a patch, just wanted to check if enabling getauxval only for aarch64-linux-android and x86_64-linux-android was ok or if you had suggestions on how to handle the possibility of it not being included when built for an old Android.

@JohnTitor
Copy link
Member

Hey, thanks for the issue!

Happy to contribute a patch, just wanted to check if enabling getauxval only for aarch64-linux-android and x86_64-linux-android was ok or if you had suggestions on how to handle the possibility of it not being included when built for an old Android.

It's totally okay to add it for these two targets.

bors added a commit that referenced this issue Dec 8, 2020
…id, r=JohnTitor

Add getauxval for 64-bit Android

Fixes #1987

This adds `getauxval` declaration on all 64-bit Android targets. This function was not declared in Bionic until API level 18. 64-bit support was added to Android in 5.0 (API level 21) thus all 64-bit targets (including AFAICT MIPS64 though I am not able to confirm this) should have `getauxval` declared.

The `AT_` constants should be the same on all platforms.
bors added a commit that referenced this issue Dec 8, 2020
…id, r=JohnTitor

Add getauxval for 64-bit Android

Fixes #1987

This adds `getauxval` declaration on all 64-bit Android targets. This function was not declared in Bionic until API level 18. 64-bit support was added to Android in 5.0 (API level 21) thus all 64-bit targets (including AFAICT MIPS64 though I am not able to confirm this) should have `getauxval` declared.

The `AT_` constants should be the same on all platforms.
@bors bors closed this as completed in 71daf0c Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants