diff options
| author | bors <bors@rust-lang.org> | 2024-06-27 05:44:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-27 05:44:47 +0000 |
| commit | 536235f07e57c9108c6c3b1eacb323164e0f4cfb (patch) | |
| tree | d4af9af936d3245d656b74cbf54708b1fa5590fe /compiler/rustc_data_structures/src | |
| parent | 1def498e3b9adc1ccce3ec5628e9f8755ec96808 (diff) | |
| parent | e57bbb37798ca9e3a4c3a043312b0ed30f9cfd87 (diff) | |
| download | rust-536235f07e57c9108c6c3b1eacb323164e0f4cfb.tar.gz rust-536235f07e57c9108c6c3b1eacb323164e0f4cfb.zip | |
Auto merge of #126907 - glaubitz:sparc-fixes, r=nagisa
Fixes for 32-bit SPARC on Linux This PR fixes a number of issues which previously prevented `rustc` from being built successfully for 32-bit SPARC using the `sparc-unknown-linux-gnu` triplet. In particular, it adds linking against `libatomic` where necessary, uses portable `AtomicU64` for `rustc_data_structures` and rewrites the spec for `sparc_unknown_linux_gnu` to use `TargetOptions` and replaces the previously used `-mv8plus` with the more portable `-mcpu=v9 -m32`. To make `rustc` build successfully, support for 32-bit SPARC needs to be added to the `object` crate as well as the `nix` crate which I will be sending out later as well. r? nagisa
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/marker.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/sync.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_data_structures/src/marker.rs b/compiler/rustc_data_structures/src/marker.rs index a9ccfbed411..32fad0de1aa 100644 --- a/compiler/rustc_data_structures/src/marker.rs +++ b/compiler/rustc_data_structures/src/marker.rs @@ -147,14 +147,14 @@ cfg_match! { [crate::owned_slice::OwnedSlice] ); - // PowerPC and MIPS platforms with 32-bit pointers do not + // MIPS, PowerPC and SPARC platforms with 32-bit pointers do not // have AtomicU64 type. - #[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))] + #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc", target_arch = "sparc")))] already_sync!( [std::sync::atomic::AtomicU64] ); - #[cfg(any(target_arch = "powerpc", target_arch = "mips"))] + #[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))] already_sync!( [portable_atomic::AtomicU64] ); diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index ecb85db33f7..5ae79ca988f 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -270,12 +270,12 @@ cfg_match! { pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32}; - // PowerPC and MIPS platforms with 32-bit pointers do not + // MIPS, PowerPC and SPARC platforms with 32-bit pointers do not // have AtomicU64 type. - #[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))] + #[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc")))] pub use std::sync::atomic::AtomicU64; - #[cfg(any(target_arch = "powerpc", target_arch = "mips"))] + #[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "sparc"))] pub use portable_atomic::AtomicU64; pub use std::sync::Arc as Lrc; |
