Skip to content

Attempting to use Atomics larger than max. atomic width #731

@utsavm9

Description

@utsavm9

I am trying to compile crossbeam-utils = "0.8" for a non-unix target and I get this error:

error[E0432]: unresolved imports `core::sync::atomic::AtomicI64`, `core::sync::atomic::AtomicU64`
  --> /home/utsav/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.5/src/lib.rs:79:49
   |
79 |             pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64}; 
   |                                                 ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
   |                                                 |
   |                                                 no `AtomicI64` in `sync::atomic`
   |

The target I am compiling to has max_atomic_width: Some(32), set similar to what it is here:
https://github.com/rust-lang/rust/blob/e3231e35b6bbfabca1d9ceff9c4690af00328706/src/librustc_back/target/armv4t_unknown_linux_gnueabi.rs#L31

So, I think it makes sense why AtomicI64, AtomicU64 are not available from the standard library for my target. I see that you have a crossbeam_no_atomic_64 cfg available, but I could not set it like:

crossbeam-utils = { version = "0.8", features = ["crossbeam_no_atomic_64"]}
// errors with:
// the package `testdep` depends on `crossbeam-utils`, with features: `crossbeam_no_atomic_64` but `crossbeam-utils` does not have these features.

Do you know a way I can make it compile where maximum atomic width is 32 bits?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions