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

[std_detect] Atomic assumptions #1181

Closed
MabezDev opened this issue Jun 11, 2021 · 2 comments
Closed

[std_detect] Atomic assumptions #1181

MabezDev opened this issue Jun 11, 2021 · 2 comments

Comments

@MabezDev
Copy link

This crate assumes that all targets building std, and therefore this crate support atomic operations because of the usage in the feature cache: https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/src/detect/cache.rs#L8. The target this was spotted on was riscv32-imc (esp32c3) espressif/rust-esp32-example#3.

@Amanieu
Copy link
Member

Amanieu commented Jun 11, 2021

The entire std crate assumes that AtomicUsize exists and supports all types of atomic operations (compare_exchange). If your target does not support atomic operations then you cannot use std and must use core and alloc instead.

@MabezDev
Copy link
Author

Thanks for the info. It might be able to possible to emulate atomic's in this instance so I'll look into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants