zmwangx / rust-ffmpeg-sys

FFmpeg bindings for Rust.
124 stars 85 forks source link

Can’t cross-compile from aarch64-unknowm-linux-gnu target. #64

Open purpleP opened 11 months ago

purpleP commented 11 months ago

I’m using ubuntu 22.04 LTS as a host.

Here’s the command I use.

env PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo check

It fails when compiling check.c. I’ve debugged enough to see that you’ve harcoded using host as target and as a result it doesn’t see arm versions of ffmpeg libraries installed for cross compilation like so apt install libav-util:arm64.

Do you support cross-compilation?

And why is your build script so complex? sys crate supposed to just create bindings. You’re trying to compile ffmpeg for some reason… Can you elaborate on that?

zlice commented 4 months ago

Same issue for gifski on void aarch64 and armv7l cross compiles https://github.com/void-linux/void-packages/pull/50117 (fork used in gifski is https://github.com/kornelski/rust-ffmpeg-sys-1)