unable to find dynamic system library 'atomic'
xutianyi1999 opened this issue · 3 comments
xutianyi1999 commented
OS: Ubuntu 22.04
Rust: nightly-x86_64-unknown-linux-gnu
cargo-zigbuild-0.18.4
ziglang-0.12.0
Build command: cargo zigbuild --release --target armv7-unknown-linux-gnueabihf
Error message
error: unable to find dynamic system library 'atomic' using strategy 'no_fallback'. searched paths:
/home/runner/work/fubuki-test/fubuki-test/target/armv7-unknown-linux-gnueabihf/release/deps/libatomic.so
/home/runner/work/fubuki-test/fubuki-test/target/release/deps/libatomic.so
/home/runner/work/fubuki-test/fubuki-test/target/armv7-unknown-linux-gnueabihf/release/build/libmimalloc-sys-ca91151723eed5d5/out/libatomic.so
/home/runner/work/fubuki-test/fubuki-test/target/armv7-unknown-linux-gnueabihf/release/build/netstack-lwip-e8f8aeaad777c356/out/libatomic.so
/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libatomic.so
/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libatomic.so
libatomic link instruction
println!("cargo:rustc-link-lib=dylib=atomic");
messense commented
Nothing we can do here, zig has some known issue for atomic, for example ziglang/zig#14889.
messense commented
FYI, your best chance of getting this fixed is fixing microsoft/mimalloc#634.
messense commented
scratch that, it should be fixed in https://github.com/purpleprotocol/mimalloc_rust/blob/a9c410c248859d3f55fbb7d29a88f28cdf296f6b/libmimalloc-sys/build.rs#L58-L61 because armv7 and later does not require libatomic.