libheif-sys icon indicating copy to clipboard operation
libheif-sys copied to clipboard

failed build with `RUSTFLAGS='-C target-feature=+crt-static' cargo build --features=compile-libheif`

Open loyalpartner opened this issue 1 year ago • 1 comments

RUSTFLAGS='-C target-feature=+crt-static'  cargo build --features=compile-libheif
    Updating crates.io index
     Locking 2 packages to latest compatible versions
    Updating bindgen v0.70.1 -> v0.71.1
    Updating rustc-hash v1.1.0 -> v2.1.0
  Downloaded rustc-hash v2.1.0
  Downloaded bindgen v0.71.1
  Downloaded 2 crates (251.1 KB) in 1.47s
   Compiling proc-macro2 v1.0.92
   Compiling bindgen v0.71.1
   Compiling rustc-hash v2.1.0
   Compiling clang-sys v1.8.1
   Compiling quote v1.0.38
   Compiling syn v2.0.94
   Compiling prettyplease v0.2.25
   Compiling libheif-sys v3.1.0+1.18.2 (/tmp/libheif-sys)
error: failed to run custom build command for `libheif-sys v3.1.0+1.18.2 (/tmp/libheif-sys)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/tmp/libheif-sys/target/debug/build/libheif-sys-008709d7608666ba/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-changed=include/wrapper.h

loyalpartner avatar Jan 03 '25 02:01 loyalpartner

I can't reproduce this error. What is your environment?

I have other errors - ld tries to use dynamic (.so) version of libheif dependencies (libraries libjpeg, libpng, libx265) instead of static (.a). But I don't know how to fix it.

Cykooz avatar Jan 04 '25 22:01 Cykooz