]> git.99rst.org Git - openwrt-packages.git/commit
rust: fix compare_exchange_weak never succeeding on mpc85xx
authorJosef Schlehofer <redacted>
Sun, 9 Aug 2026 09:08:31 +0000 (11:08 +0200)
committerJosef Schlehofer <redacted>
Sun, 16 Aug 2026 06:13:23 +0000 (08:13 +0200)
commit9ea0d00d9315bea357d5f359606c8af5dbaa92b9
tree05cf533586be834fc90731acdb6c6bcada44ad7e
parent276c62df4530fdce91ac4a407cb722e86bcf6357
rust: fix compare_exchange_weak never succeeding on mpc85xx

LLVM places the release fence of a cmpxchg between the load-linked and the
store-conditional. On e500v2 that clears the reservation, so the
store-conditional always fails. The strong form retries and re-reserves; the
weak form has no retry and can never succeed.

fetch_update in core is a weak retry loop, so it spins forever and anything
using it hangs. A tokio reactor livelocks on its first I/O event, burning
CPU without issuing a syscall, which makes async Rust unusable on the
subtarget.

Carry the fix as a patch until it reaches a rustc release. It adds a
TargetLowering hook, defaulting to false, so only PowerPC changes.

Signed-off-by: Josef Schlehofer <redacted>
lang/rust/Makefile
lang/rust/patches/0002-AtomicExpand-keep-the-release-fence-out-of-the-reserv.patch [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT