Skip to content

Use portable-atomic on platforms without u64 atomics - #148

Open
linkmauve wants to merge 1 commit into
tesselode:mainfrom
linkmauve:portable-atomic
Open

Use portable-atomic on platforms without u64 atomics#148
linkmauve wants to merge 1 commit into
tesselode:mainfrom
linkmauve:portable-atomic

Conversation

@linkmauve

@linkmauve linkmauve commented Jan 3, 2026

Copy link
Copy Markdown

This has been tested on powerpc-unknown-linux-gnu, which supports atomics only up to u32. Without this commit, building kira would fail with:

error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
 --> crates/kira/src/backend/cpal/desktop/stream_manager.rs:6:24
  |
6 |         atomic::{AtomicBool, AtomicU64, Ordering},
  |                              ^^^^^^^^^
  |                              |
  |                              no `AtomicU64` in `sync::atomic`
  |                              help: a similar name exists in the module: `AtomicU32`

Edit: This also depends on not-fl3/quad-rand#23 in order to make the whole testsuite pass, but can be merged independently.

This has been tested on powerpc-unknown-linux-gnu, which supports
atomics only up to u32.  Without this commit, building kira would fail
with:
error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
 --> crates/kira/src/backend/cpal/desktop/stream_manager.rs:6:24
  |
6 |         atomic::{AtomicBool, AtomicU64, Ordering},
  |                              ^^^^^^^^^
  |                              |
  |                              no `AtomicU64` in `sync::atomic`
  |                              help: a similar name exists in the module: `AtomicU32`
@linkmauve

Copy link
Copy Markdown
Author

I just rebased that PR on top of latest main, nothing much was changed but there was a merge conflict.

@tesselode

Copy link
Copy Markdown
Owner

Which test isn't passing? I'm unclear on what this has to do with quad-rand.

@linkmauve

linkmauve commented Feb 18, 2026

Copy link
Copy Markdown
Author

quad-rand just has the exact same issue as kira, it also uses AtomicU64 for its prng, which isn’t available on PowerPC so it also doesn’t build there.

This PR is the only one required to make kira work on Linux on the Wii, but I’ve also sent a PR to quad-rand to also make kira’s testsuite compile there.

@tesselode

Copy link
Copy Markdown
Owner

@linkmauve are there other platforms besides Linux on Wii that don't have u64 atomics?

@linkmauve

Copy link
Copy Markdown
Author

I’ve had to use that patch on my iBook G4 too, so probably all 32-bit PowerPC computers.

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

Successfully merging this pull request may close these issues.

2 participants