-
Notifications
You must be signed in to change notification settings - Fork 257
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
Cross-Compilation target (partially?) ignored, linking with wrong linker #2991
Comments
What is the host system? those |
Host system is Linux, inside of an Ubuntu 22.04 docker container. The relevant bits: |
Is there any update to this? I'm still unable to cross-compile latest rav1e. |
https://github.com/BtbN/FFmpeg-Builds/blob/master/scripts.d/50-rav1e.sh#L32 those are wrong you should remove them. You only need set the Tell me if it works better for you :) |
I am setting the linker, from that very variable: https://github.com/BtbN/FFmpeg-Builds/blob/master/scripts.d/50-rav1e.sh#L45 |
I have now tried multiple versions of that, in all cases the config.toml was unchanged: Only setting CC and CXX results in this:
Not setting CC/CXX/LD/AR at all results in:
|
The problem is due our Try to update your base image and the problem should solve by itself. |
It is documented you can set it via an env variable, I think I linked you the document above :) Anyway setting the C compiler to the cross compiler was a problem and it was hiding this additional problem in libz and the linker apparently, hopefully an updated libz will sort out that. |
The base image is as up to date as it can get. |
Oh, I see what you mean now with libz. |
Unsetting PKG_CONFIG_PATH/LIBDIR so it doesn't find the cross environments libs anymore solves that issue. |
It is a fix, you have to set the correct environment variables :) https://docs.rs/system-deps/latest/system_deps/#overriding-build-flags |
Well, literally every other cross compilation environment I have ever worked with expected pkg-config to find the cross libraries. I have trouble making sense of that system_deps documentation. Does that imply that I would have to know the dependencies of all dependencies? No idea how other projects handle that situation with host-tools needing pkg-config itself. Never encountered that elsewhere so far. |
let me open gdesmott/system-deps#62 and see if we can fix it better. |
I've finally found a set of variables that seems to consistently work across all targets and look decently sane, though annoying: https://github.com/BtbN/FFmpeg-Builds/blob/8bc793644e535cc96bfe0710ecd0cd3080c16be9/scripts.d/50-rav1e.sh#L32 The pkg-config issue still stands, but is not at all an issue of rav1e, so feel free to close this if you think it's appropriate. |
We can move the discussion on the system-deps issue and probably we can try to improve the situation at cargo level (or in |
After some recent update to this repository, building for a non-native cross target (x64 windows in my case) fails.
From the looks of it, cargo (or something else?) invokes the wrong linker. Namely just "cc". That obviously does not go well for linking a Windows target: https://gist.github.com/BtbN/d259f922fdb8ea8a941d03eda5c62049
I've tried everything I could find online in trying to convince it to use the correct linker:
But to no avail, linking just fails.
This is happening since 85003e6.
Just downgrading to one commit prior fixes the build.
The text was updated successfully, but these errors were encountered: