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

does not build on MIPS #22

Closed
nazar554 opened this issue Jul 18, 2020 · 5 comments · Fixed by #23
Closed

does not build on MIPS #22

nazar554 opened this issue Jul 18, 2020 · 5 comments · Fixed by #23

Comments

@nazar554
Copy link
Contributor

I can't build quanta 0.3.1 with mipsel-unknown-linux-musl target. Should it still build and fallback to OS facilities?
Is there any workaround to use it with metrics-runtime?

Found this in docs for std::sync::atomic:

PowerPC and MIPS platforms with 32-bit pointers do not have AtomicU64 or AtomicI64 types.

error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
  --> /cargo/registry/src/github.com-1ecc6299db9ec823/quanta-0.3.1/src/lib.rs:51:14
   |
51 |     atomic::{AtomicU64, Ordering},
   |              ^^^^^^^^^
   |              |
   |              no `AtomicU64` in `sync::atomic`
   |              help: a similar name exists in the module: `AtomicU8`

error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
 --> /cargo/registry/src/github.com-1ecc6299db9ec823/quanta-0.3.1/src/mock.rs:5:18
  |
5 |         atomic::{AtomicU64, Ordering},
  |                  ^^^^^^^^^
  |                  |
  |                  no `AtomicU64` in `sync::atomic`
  |                  help: a similar name exists in the module: `AtomicU8`

error: aborting due to 2 previous errors
@tobz
Copy link
Member

tobz commented Jul 18, 2020

I'll see if I can backport your PR to an 0.3 version of quanta and potentially do a patch release to help ya out.

@nazar554
Copy link
Contributor Author

I have a feature/atomic-shim-0.3.1 branch in my fork, it seems to build already. I addeda #[ctor] hack for static initializtion of AtomicU64

@tobz
Copy link
Member

tobz commented Jul 19, 2020

Nice. I created a branch, 0.3-lts, based off of the 0.3.1 commit. If you want to submit that feature branch as a PR, based against the LTS branch, we can get that going as well, and hopefully released quickly.

@messense
Copy link
Contributor

messense commented Sep 7, 2021

Compilation error when cross compile to MIPS (mipsel-unknown-linux-musl).

   Compiling quanta v0.9.2
error[E0599]: no method named `fetch_add` found for struct `Arc<AtomicCell<u64>>` in the current scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/quanta-0.9.2/src/mock.rs:48:21
   |
48 |         self.offset.fetch_add(amount.into_nanos());
   |                     ^^^^^^^^^ method not found in `Arc<AtomicCell<u64>>`

error[E0599]: no method named `fetch_sub` found for struct `Arc<AtomicCell<u64>>` in the current scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/quanta-0.9.2/src/mock.rs:53:21
   |
53 |         self.offset.fetch_sub(amount.into_nanos());
   |                     ^^^^^^^^^ method not found in `Arc<AtomicCell<u64>>`

error: aborting due to 2 previous errors

@nazar554
Copy link
Contributor Author

nazar554 commented Sep 7, 2021

@messense crossbeam disables 64-bit atomics on unsupported platforms (with crossbeam_no_atomic_64 feature)
See crossbeam-rs/crossbeam#731

Can be fixed by not using crossbeam on MIPS & PowerPC, or implementing support for atomic_shim there as well

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

Successfully merging a pull request may close this issue.

3 participants