-
Notifications
You must be signed in to change notification settings - Fork 22
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
Supporting cross compiling for musl #4
Comments
This repo links and uses the library, if you want an example to reproduce: https://github.com/JJJollyjim/serenity-build-test |
Sorry, didn't see the comment about how you have a branch with cross-compiling support! Closing this while I see if I can make that work :) |
Reopening, unfortunately I get the exact same error using that branch. |
Please ensure to run |
|
It looks to me like the build script is emitting the correct linking instructions for cargo, but is building libopus with native (glibc) rather than target (mus) libc header files, hence the link failures at the end of the process. |
It looks like |
Even if I specify what I believe is a correct target triple in --host, |
Can you try the |
Resolved. |
The build.rs decides whether to use a static or dynamic opus based on the host environment, rather than the target. This means that by default, a build of a binary using this crate with
--target x86_64-unknown-linux-musl
will look like this:This is a small issue, easily worked around by building with
OPUS_STATIC=1
. Unfortunately, this too has problems. If I build on my host machine (Arch linux):And if I build in the rust-musl-builder docker container:
In both cases, it seems like the correct includes are not being set up for cross-compilation. Unfortunately I cannot compile from a musl host, as musl does not support proc macros
Any ideas about how to get this compiling?
The text was updated successfully, but these errors were encountered: