Skip to content

Commit

Permalink
Rollup merge of #114496 - taiki-e:sparc32-atomic, r=Amanieu
Browse files Browse the repository at this point in the history
Set max_atomic_width for sparc-unknown-linux-gnu to 32

This is currently set to 64

https://github.com/rust-lang/rust/blob/90f0b24ad3e7fc0dc0e419c9da30d74629cd5736/compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs#L8

However, AFAIK, this architecture doesn't support 64-bit atomics, and LLVM generates libcalls: https://godbolt.org/z/chzThWGG1

(Currently, attempts to run `cargo test` for this target result in "undefined reference to `__sync_val_compare_and_swap_8'" error. taiki-e/rust-cross-toolchain@02efe1e)

r? `@Amanieu`
  • Loading branch information
matthiaskrgr committed Aug 7, 2023
2 parents b0a5126 + 4d4df88 commit 9b1f943
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.endian = Endian::Big;
base.cpu = "v9".into();
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(32);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mv8plus"]);

Target {
Expand Down

0 comments on commit 9b1f943

Please sign in to comment.