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

[Bug] Cross-compilation fails for arm64 #868

Closed
connoranderson opened this issue Dec 18, 2024 · 1 comment
Closed

[Bug] Cross-compilation fails for arm64 #868

connoranderson opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@connoranderson
Copy link

connoranderson commented Dec 18, 2024

Describe the bug

Trying to cross-compile following instructions in the readme. Seeing error

error[E0080]: evaluation of constant value failed
  --> src/platform/synchronization.rs:15:1
   |
15 | / decl_c_type!(
16 | |     owned(z_owned_mutex_t, option(Mutex<()>, Option<MutexGuard<'static, ()>>)),
17 | |     loaned(z_loaned_mutex_t),
18 | | );
   | |_^ the evaluated program panicked at 'Size mismatch: type z_loaned_mutex_t has size 24 while type (Mutex<()>, Option<MutexGuard<'static, ()>>) has size 16', src/platform/synchronization.rs:15:1
   |
   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `decl_c_type` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0080`.

To reproduce

export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
mkdir build && cd build
cmake .. \
  -DCMAKE_SYSTEM_NAME="Linux" \
  -DCMAKE_C_COMPILER="aarch64-linux-gnu-gcc" \
  -DCMAKE_CXX_COMPILER="aarch64-linux-gnu-g++" \
  -DCMAKE_SYSTEM_PROCESSOR="aarch64" \
  -DZENOHC_CARGO_CHANNEL="+nightly" \
  -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort" \
  -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu" \
  -DCMAKE_TOOLCHAIN_FILE="../../arm64-toolchain.cmake" \
  -DCMAKE_INSTALL_PREFIX="~/arm64-zenoh-build-artifacts"
  
cmake --build . --config Release

System info

  • Ubuntu 22.04
  • Host arch = x86_64
  • Zenoh 1.1.0
@connoranderson connoranderson added the bug Something isn't working label Dec 18, 2024
@connoranderson
Copy link
Author

Closing. Worked when switching from nightly to stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant