Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARMv5TE target compile fail due to AtomicI64 #1895

Closed
msdos03 opened this issue Mar 2, 2025 · 5 comments
Closed

ARMv5TE target compile fail due to AtomicI64 #1895

msdos03 opened this issue Mar 2, 2025 · 5 comments

Comments

@msdos03
Copy link

msdos03 commented Mar 2, 2025

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

@zonyitoo
Copy link
Collaborator

zonyitoo commented Mar 2, 2025

No solution right now, you may consider disable the local-fake-dns feature to work around.

@zonyitoo
Copy link
Collaborator

zonyitoo commented Mar 2, 2025

It seems that https://github.com/cberner/redb could be a good replacement of sled.

Or we could use rocksdb directly.

@msdos03
Copy link
Author

msdos03 commented Mar 2, 2025

It seems that https://github.com/cberner/redb could be a good replacement of sled.

This project seems even have no atomic fix for mips.
redb/issues/747

zonyitoo added a commit that referenced this issue Mar 7, 2025
- ref #1895

BREAKING CHANGE: Database file must be recreated because engine have
been switched from sled to rocksdb.
@zonyitoo
Copy link
Collaborator

fake-dns have been moved to full-extra, it should be fixed temporary.

@msdos03
Copy link
Author

msdos03 commented Mar 15, 2025

@zonyitoo thank you very much for taking care

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants