Lakelezz / audiopus_sys

Rust FFI-binding of Opus.
ISC License
15 stars 22 forks source link

Cross compiling to arm fails at the linking stage #8

Closed peppizza closed 3 years ago

peppizza commented 3 years ago

sort of a follow-up to https://github.com/Lakelezz/audiopus_sys/issues/1 as that issue is stale,

attempting to cross-compile to arm systems works, until the linking stage where it produces this error:

target/armv7-unknown-linux-gnueabihf/debug/build/audiopus_sys-96ea5a29564c45f6/out/lib/libopus.so: file not recognized: file format not recognized

peppizza commented 3 years ago

weird, cross-compiling this crate standalone is successful, but cross-compiling it in my bot is not

Lakelezz commented 3 years ago

That error often means it has been compiled for the wrong target. This may be due to the wrong target selection, something I tried fixing but to no luck.

DoumanAsh commented 3 years ago

@Lakelezz I suggest to use cmake toolchain instead of hacking with autoconf shit. It is simple as https://github.com/DoumanAsh/opusic-sys/blob/master/build.rs#L44-L85

On side note I'd like serenity to cross-compile with voice enabled :(

DoumanAsh commented 3 years ago

For anyone who is lazy, you can patch audioopus with my branch to get working opus-sys, but it relies on cmake to build opus https://github.com/Lakelezz/audiopus/compare/master...DoumanAsh:better_sys

But it works just fine in cross

Lakelezz commented 3 years ago

Resolved.