stencillogic/astro-float

Typedefs Don't Support non-x86

Chris--B opened this issue · 2 comments

I built on/for an M1 Mac system:

rustup target add aarch64-apple-darwin
cargo check --target=aarch64-apple-darwin

(check won't require a local toolchain, linker, SDKs, etc)

I see errors like this, followed by cascading issues which I think are related:

error[E0432]: unresolved import `crate::defs::Word`
 --> astro-float-num/src/common/buf.rs:4:5
  |
4 | use crate::defs::Word;
  |     ^^^^^^^^^^^^^^^^^ no `Word` in `defs`

I think the crux is snippets like this:

/// A word.
#[cfg(target_arch = "x86_64")]
pub type Word = u64;

// ...

/// A word.
#[cfg(target_arch = "x86")]
pub type Word = u32;

There's no base case, so as soon as you compile for not-x86 everything falls apart. You could add more targets to the list, but you could also use target_pointer_width instead of target_arch to make these decisions.
See: https://doc.rust-lang.org/reference/conditional-compilation.html#target_pointer_width

Thank you for raising the issue. Yes, indeed for now just x86_64 is supported.

The latest version (0.7.1) has recently been tested on aarch64 (aarch64-unknown-linux-gnu).