hi!
i'd like to cross compile an app linking to gstreamer-1.0 on debian.
the trivial hello world already cross compiles successfully ( i guess my rust target chain is working alright ).
however using cargo build fails with /usr/lib/gcc-cross/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgstreamer-1.0
my guess is that ld is trying to find the libs in /usr/arm-linux-gnueabihf/lib when libgstreamer-1.0.so.0 is actually located in /usr/lib/arm-linux-gnueabihf.
what i'd like to do is pass an additianl -L flag to cargo but can't figure out how to do so.
Obligatory question: Can you build a C program for armhf that links to gstreamer? If yes, then you should be able to build a Rust program that links to gstreamer. If not, then you may be missing some C stuff (the shared library for instance)
cat build.rs
Hmm, this should have worked.
Did the build script actually run? Is build = "build.rs" set in Cargo.toml? Is there an output (text) file with the "cargo:rustc-link-search=native=/usr/lib/arm-linux-gnueabihf" string in it somewhere in the target directory?
Is the armhf libgstreamer.so actually in /usr/lib/arm-linux-gnueabihf? (Is the proper (apt-get?) package installed?
You should the linker arguments that rustc passes to arm-linux-gnueabihf-gcc. The error message should show them; or you could use cargo rustc --target $T -- -Z print-link-args. Is the -L flag among the linker flags?
is cargo relying on a working pkg-config?
for troubleshooting i started out with a fresh rootfs bootstrapped from ubuntu 16.04 where arm-linux-gnueabihf-pkg-config is available and no it gets linked properly.
That's not up to Cargo but it's the job of the crate that wraps a C library. And, IIRC, the pkg-config crate which is used to call pkg-config from build scripts doesn't support cross compilation setups; it didn't prefix the pkg-config command IIRC. At least it didn't last time I checked (months ago).