From 1a7736c8d8c93a745e273a4e04383c78b26ea1f8 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 14 Jan 2022 23:05:14 +0800 Subject: [PATCH] workaround for https://github.com/rust-lang/rust/issues/92897 --- sim/spififo/testbench/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sim/spififo/testbench/src/main.rs b/sim/spififo/testbench/src/main.rs index ee7a811..fc08a02 100644 --- a/sim/spififo/testbench/src/main.rs +++ b/sim/spififo/testbench/src/main.rs @@ -5,6 +5,12 @@ use sim_bios::sim_test; extern crate volatile; use volatile::Volatile; +// work around a compiler bug in rustc-1.58: https://github.com/rust-lang/rust/issues/92897 +#[no_mangle] +pub fn __atomic_load_4(arg: *const usize, _ordering: usize) -> usize { + unsafe { *arg } +} + // allocate a global, unsafe static string. You can use this to force writes to RAM. #[used] // This is necessary to keep DBGSTR from being optimized out static mut DBGSTR: [u32; 8] = [0, 0, 0, 0, 0, 0, 0, 0];