-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Compiler crash on cross-compile: cargo build --target x86_64-pc-windows-gnu of crate egui #140237
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
Comments
Recompiled. Still fails. Tried rustup to current version of rustc. Still fails. Tried compiling another program that uses egui. Works, with valid cross-compile and execution under Wine. |
There are no error messages in your log. Those warnings are harmless and stem from using binutils older than 2.40. Also using outdated rustc version is not supported. Even if up to date version fails the same way the fix would be included in the new version. |
Thousands of lines of errors end with:
That's a failure. Tried with this version of rustc:
Fails in same way.
Installed version of binutils is 2.38-4ubuntu2.8, which is the latest version known to the Ubuntu package manager. Since the two previous answers were wrong, I'd like to get confirmation from another source that a version of binutils not available as part of the current Ubuntu distribution is actually required. Other programs are cross-compiling OK. Only "egui" is currently failing in this way, Where is such a binutils restriction documented? I've found some warnings against using binutils earlier than 2.30, There is a 2.44 version of binutils that is available directly from the Gnu project, but Ubuntu LTS distros are not using it yet. If Ubuntu LTS and Rust are seriously out of sync, that needs to be publicized. |
You are already talking to the windows-gnu expert. Acting entitled to further support from an open source community will not help. |
The original message omitted the error and only showed warnings, which are expected on old binutils and are harmless. The actual error has now been given:
Please try using rust 1.86 or a recent nightly build. It's possible this has already been fixed. |
Just tried nightly rustc:
So, same bug is in Nightly, although notice that the "export ordinal too large" value is different. This should be easily reproduceable using egui on Github. (Sorry to be cranky. I'm trying to narrow down a bug that's related to egui/wine interaction, and all this is from an effort to repro that bug in a simpler situation. Thanks.) |
I don't think so. As Chris pointed out, only your additional comment contains the error message that is meaningful.
As you have noticed, most of the crates work fine with older Binutils, so there is no hard requirement for version 2.40. What you are facing is limitation of PE format used by Windows, linkers LLD (probably all versions that work with mingw-w64? that would mean the last decade) and Binutils 2.40 have feature that will skip exporting symbols that have hidden visibility. So they won't hit this issue and no functionality is lost. You can try other workarounds that come with different tradeoffs that will reduce the amount of the exported symbols, hopefully enough to get them below 2^16 limit:
I'm preparing for a hike right now, and my ability to respond will be limited until Saturday evening or Sunday. |
Oh, that's what it's unhappy about - too many exported symbols. The error message "export ordinal too large: 67992" didn't make that clear. Now I have a better idea of what to look for. Is that a restriction that applies only to cross-compilation? Turns out I can build --release mode with both stable and nightly versions of Rust. Only default debug mode fails. Fewer debug symbols? "egui" itself is a crate on crates.io, for use as part of GUI programs. It's not that big a crate. I have several programs that use it, and they build OK, both in debug and release mode. I wouldn't have expected it to run out of some resource. If you build egui by itself, it builds a large number of example programs and pulls in many crates that wouldn't be needed for normal use of the crate. Also, at the moment, the egui developers are making changes to the "master" branch and "cargo test" pulls in two versions of the same crate, resulting in compile errors. So reproducing this testing against branch master for egui is not currently working too well. Let me pass this one over to the egui people. |
This is limitation of [PE format[(https://en.wikipedia.org/wiki/Portable_Executable), so any time you target Windows you are bound to it.
Every bit I mentioned in the comment above contributes to it: lack of debug assertions, optimisations (mostly inlining).
I know, I had used it once or twice on Linux. I didn't expect it to hit PE exports limit, but I haven't used linker without this specific |
Useful notes:
|
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: