Skip to content

ARMv5TE target compile fail due to AtomicI64 #1895

@msdos03

Description

@msdos03

log:

error[E0432]: unresolved imports `std::sync::atomic::AtomicI64`, `std::sync::atomic::AtomicU64`
 --> /home/user/openwrt-sdk-24.10.0-kirkwood-generic_gcc-13.3.0_musl_eabi.Linux-x86_64/dl/cargo/registry/src/index.crates.io-6f17d22bba15001f/sled-0.34.7/src/atomic_shim.rs:8:29
  |
8 | pub use std::sync::atomic::{AtomicI64, AtomicU64};
  |                             ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
  |                             |
  |                             no `AtomicI64` in `sync::atomic`
  |
help: a similar name exists in the module
  |
8 | pub use std::sync::atomic::{AtomicI32, AtomicU64};
  |                             ~~~~~~~~~
help: a similar name exists in the module
  |
8 | pub use std::sync::atomic::{AtomicI64, AtomicU32};
  |                                        ~~~~~~~~~

For more information about this error, try `rustc --explain E0432`.
error: could not compile `sled` (lib) due to 1 previous error

It seems like shadowsocks-rust is using sled which is using atomic-shim to support atomic on mips and powerpc CPUs.
But atomic-shim is only enabled on mips and powerpc targets, but ARMv5TE and a bunch of other architectures also don't have AtomicI64.

There are some issues about this problem:
atomic-shim/issues/4
sled/issues/1070

There are also pull requests for these problems, but these projects are no longer maintained actively, so possibly they will never be merged.
sled/pull/1494
atomic-shim/pull/5

I'm not familiar with rust so I can't solve it myself. Please help solving this.

@zonyitoo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions