Skip to content

Failed to compile libz-ng-sys v1.1.8 on armv7-unknown-linux-gnueabihf #107

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

Closed
NobodyXu opened this issue Oct 8, 2022 · 1 comment
Closed

Comments

@NobodyXu
Copy link
Contributor

NobodyXu commented Oct 8, 2022

Running cmd

cross build --target armv7-unknown-linux-gnueabihf --profile release --no-default-features --features zlib-ng,static,rustls,trust-dns,fancy-no-backtrace,log_release_max_level_debug -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort

on cargo-binstall v0.15.0 failed with error:

  /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include/arm_neon.h:31:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
   #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h

From CI failure.

and

  In file included from /cargo/registry/src/index.crates.io-e139d0d48fed7772/libz-ng-sys-1.1.8/src/zlib-ng/compare256.c:7:0:
  /cargo/registry/src/index.crates.io-e139d0d48fed7772/libz-ng-sys-1.1.8/src/zlib-ng/fallback_builtins.h:102:15: error: unknown type name 'uint16x8x4_t'
   static inline uint16x8x4_t vld1q_u16_x4(uint16_t *a) {

According to this comment:

This isn't a cross bug: it's an issue with the library you're trying to use: ARMv7HF defaults to using VFPv3, not NEON, and refuses to compile NEON intrinsics unless you basically force it to. You'd have to add -C target-feature=+neon to RUSTFLAGS, and even then I doubt it would work. If you want an ARMv7 hard-float target that supports NEON by default, use thumbv7neon-unknown-linux-gnueabihf. FYI: your library is also asking you to use -mfloat-abi=softfp which is definitely wrong here: it would have to be -mfloat-abi=hard.

There's something wrong with the libraries you are using, not with the toolchain itself.

libz-ng should not use NEON intrinsics on armv7hf and it should also use hard float-abi.

@JohnTitor
Copy link
Member

Seems duplicate of #108, closing.

@JohnTitor JohnTitor closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
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