Skip to content

Commit 8b3f4d1

Browse files
authored
Unrolled build for rust-lang#137860
Rollup merge of rust-lang#137860 - taiki-e:powerpcspe-msync, r=workingjubilee rustc_target: Add msync target feature and enable it on powerpcspe targets Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.) LLVM recognizes this as the [`msync` feature](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L140) and enables for some cpus such as [e500](https://github.com/llvm/llvm-project/blob/cc5d8a4b2fc765c3c432f1ad0b185dae518d41bd/llvm/lib/Target/PowerPC/PPC.td#L644). powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., rust-lang#96394, rust-lang#117361). https://github.com/rust-lang/rust/blob/8c392966a013fd8a09e6b78b3c8d6e442bc278e1/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs#L28 Fixes rust-lang#117361 cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers)) cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in rust-lang#48484) cc `@th0ma7` (who opened rust-lang#117361) r? workingjubilee `@rustbot` label +O-PowerPC +A-target-feature
2 parents daf5985 + 6f7fd11 commit 8b3f4d1

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Diff for: compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
2424
options: TargetOptions {
2525
abi: "spe".into(),
2626
endian: Endian::Big,
27-
features: "+secure-plt".into(),
27+
features: "+secure-plt,+msync".into(),
2828
mcount: "_mcount".into(),
2929
..base
3030
},

Diff for: compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub(crate) fn target() -> Target {
2626
options: TargetOptions {
2727
abi: "spe".into(),
2828
endian: Endian::Big,
29+
features: "+msync".into(),
2930
mcount: "_mcount".into(),
3031
..base
3132
},

Diff for: compiler/rustc_target/src/target_features.rs

+1
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ const HEXAGON_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
461461
static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
462462
// tidy-alphabetical-start
463463
("altivec", Unstable(sym::powerpc_target_feature), &[]),
464+
("msync", Unstable(sym::powerpc_target_feature), &[]),
464465
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
465466
("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
466467
("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),

Diff for: tests/ui/check-cfg/target_feature.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
151151
`mp`
152152
`mp1e2`
153153
`msa`
154+
`msync`
154155
`mte`
155156
`multivalue`
156157
`mutable-globals`

0 commit comments

Comments
 (0)