rust-lang / stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
https://doc.rust-lang.org/stable/core/arch/
Apache License 2.0
612 stars 271 forks source link

Enable Aarch64 feature detection on all Apple/Darwin targets #1636

Closed madsmtm closed 2 months ago

madsmtm commented 2 months ago

This was originally added in https://github.com/rust-lang/stdarch/pull/1516.

I have tested this in the simulator and on the device I had lying around, a 1st generation iPad Mini (which isn't Aarch64, but shows that the sysctlbyname calls still work even there, even if they return false).

sysctlbyname should be safe to use without causing rejections from the app store, as its usage is documented in: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics

Also, the standard library will use sysctl soon anyhow, see https://github.com/rust-lang/rust/pull/129019, so if the standard library starts getting rejected by Apple, it won't be entirely stdarch's fault.

A few more references:

rustbot commented 2 months ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) some time within the next two weeks.