-
-
Notifications
You must be signed in to change notification settings - Fork 17.8k
gcc: use DWARF exception handling for i686-w64-mingw32 #367564
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
base: master
Are you sure you want to change the base?
Conversation
This is the default used by MSYS2[^1], ArchLinux[^2] and probably everyone else. This is required to compile Rust programs as it doesn't support SJLJ[^3]. [^1]: https://github.com/msys2/MINGW-packages/blob/725f262e9f6313e3ee04327a33c16614c970a110/mingw-w64-gcc/PKGBUILD#L185-L186 [^2]: https://gitlab.archlinux.org/archlinux/packaging/packages/mingw-w64-gcc/-/blob/14.2.0-3/PKGBUILD#L62 [^3]: rust-lang/rust#55444 (comment)
734f2cc to
4c39db4
Compare
|
To add more context to this PR, mingw gcc has 3 exception handling methods:
(source: https://wiki.qt.io/MinGW-64-bit#Exception_handling:_SJLJ,_DWARF,_and_SEH) Before #89582, both x64 and x32 used SJLJ which is the worst option. This PR makes x32 use DWARF2 EH, by disabling SJLJ. I think You can find the source for how GCC picks the EH method here: https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.2.0/gcc/common/config/i386/i386-common.cc#L2072-L2089 @Ericson2314 As the person who merged #89582, can you look into this? |
|
I ran into this issue independently, while writing some documentation on testing Rust code built for Windows in Wine. I can confirm, this fix is needed to be able to build at all for The use case/motivation here is to run cross compiled packages against local Wine. By testing my projects against Wine, I am able to occasionally report issues such as #56357 and #56362. However, being unable to build for In any case, it is still somewhat possible by linking against |
This is the default used by MSYS21, ArchLinux2 and probably everyone else.
This is required to compile Rust programs as it doesn't support SJLJ3.
Effectively a continuation of #89582, but for x86-32.
I also moved the EH flags out of the
withoutTargetLibccheck, which I believe to be a mistake introduced by the previous PR: #89582 (comment)I've tested it with a rust hello world cross compiled for
mingw32/mingwW64withmcf/win32threading.For some reason
-lmcfgthreaddoesn't get automatically added withbuildRustPackagebut that's a separate issue.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.
Footnotes
https://github.com/msys2/MINGW-packages/blob/725f262e9f6313e3ee04327a33c16614c970a110/mingw-w64-gcc/PKGBUILD#L185-L186 ↩
https://gitlab.archlinux.org/archlinux/packaging/packages/mingw-w64-gcc/-/blob/14.2.0-3/PKGBUILD#L62 ↩
https://github.com/rust-lang/rust/pull/55444#issuecomment-434044002 ↩