-
Notifications
You must be signed in to change notification settings - Fork 601
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
slint-macros fails to build on Windows under MINGW64 (x86_64-pc-windows-gnu): export ordinal too large
#764
Comments
i'm not quite sure how we can solve this problem. |
I'm not sure either -- I know too little about Rust and about SixtyFPS. My idea for my further research is to look into the content of This looks like a general problem, not specific to SixtyFPS, so I created an issue in rust-lang (#92212). Fortunately cross-compiling in Linux seems to work as a work-around so it's not a critical problem with Windows desktop target support for SixtyFPS (I'll add a note about it to the issue). |
Another workaround is to use the msvc toolchain. |
I met this problem too. I'm using msys2+ming64, GNU toolchain on windows 10. Waiting for solution... |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
A new workaround has surfaced: Add this to your [profile.dev.build-override]
opt-level = 2 |
export ordinal too large
This is a problem in rust: rust-lang/rust#92212 |
Linker error:
export ordinal too large
while buildingsixtyfps-macros
.See sixtyfps-macros-ld-error.txt for the full error message.
The ordinal value it complains about is ~82000 (differs depending on circumstances).
rustc --version:
rustc 1.59.0-nightly (e100ec5bc 2021-12-21)
gcc for linking: from the rust toolchain as set up by rustup:
/home/user/.rustup/toolchains/nightly-x86_64-pc-windows-gnu/lib/rustlib/x86_64-pc-windows-gnu/bin/self-contained/x86_64-w64-mingw32-gcc --version
:x86_64-w64-mingw32-gcc.exe (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 6.3.0
Work-around:
Cross-compile in Linux.
How to reproduce:
sixtyfps = "0.1.5"
when creatingCargo.toml
Additional datapoints:
x86_64-pc-windows-gnu
toolchain versions1.54
,stable-1.57
andnightly-1.59
RUSTFLAGS="-C linker=gcc" cargo build
); gcc versionx86_64-w64-mingw32-gcc.exe (Rev2, Built by MSYS2 project) 11.2.0
cargo build --target x86_64-pc-windows-gnu
under Ubuntu withmingw-w64
succeedssixtyfps-rs 0.1.4
builds successfully(Speculation: could be related to rust #37530? That's solved for cdylibs but sixtyfps-macros is a dylib).
[Added]
When cross-compiling under Linux, all the procedural macro libraries are built in the native ELF format (f.e.
target/debug/deps/libsixtyfps_macros-6b856b93326235ff.so
, even though the libsixtyfps library itself is attarget/x86_64-pc-windows-gnu/debug/deps/libsixtyfps-95f79d3acfc3ff62.rlib
), because they have to load intorustc
. Whereas when compiling on Windows,rustc
is a PE/COFF and the procedural macro libraries are by necessity compiled into PE/COFF DLLs. This brings into action the limit of 65535 export ordinals in PE/COFF, which is just not an issue when compiling under Linux.Number of exports, Linux: 70056 (
cargo sym -e target/debug/deps/libsixtyfps_macros-6b856b93326235ff.so | wc -l
)Number of exports, Windows: 81654 (counting entries in the implib,
D:\0\sixtyhello\target\debug\deps\libsixtyfps_macros-abae7269cd02c186.dll.a
, which gets generated even though the linking fails)So it looks to me like the excess of exported symbols is the problem, but I have no idea what to do about it.
The text was updated successfully, but these errors were encountered: