Skip to content

Conversation

zouguangxian
Copy link

This PR enables building serde for the riscv32im-unknown-none-elf target.

cargo build -p serde --no-default-features --features="rc,alloc" --target riscv32im-unknown-none-elf

@zouguangxian
Copy link
Author

zouguangxian commented May 16, 2025

target_has_atomic was an unstable feature for 1.56.0.

error[E0658]: `cfg(target_has_atomic)` is experimental and subject to change
   --> serde/src/ser/impls.rs:521:55
    |
521 |     #[cfg(any(feature = "std", all(feature = "alloc", target_has_atomic = "ptr")))]
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #3[29](https://github.com/serde-rs/serde/actions/runs/15034267458/job/42253004053?pr=2924#step:7:30)76 <https://github.com/rust-lang/rust/issues/32976> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `serde` due to previous error
Error: Process completed with exit code 101.

@dtolnay, can you give some suggestions about this feature?

… include target_has_atomic checks

This commit enables building serde for the `riscv32im-unknown-none-elf` target.

`cargo build -p serde --no-default-features --features="rc,alloc" --target riscv32im-unknown-none-elf`
@zouguangxian zouguangxian force-pushed the fix/support-riscv32im-unknown-none-elf branch from 5e4dce7 to 7e689e8 Compare August 26, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant