-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
What's the current state of cross-compilation from Linux -> Windows with (i686|x86_64)-pc-windows-gnu? #79577
Comments
Most of the common distributions already use Dwarf-2 (Arch Linux, Fedora) or are in progress to switch (Debian) soon. |
Arch does not package DWARF-2 compilers, to my knowledge
Which is why I had to use `cross`, and what led me to open this issue
attempting to build a cdylib containing only
#[no_mangle]
pub unsafe extern fn return_one() -> i32 {
1
}
with `cargo build --target=i686-pc-windows-gnu` on an up-to-date Arch system and Rust 1.46 stable fails with ~10K of linker errors about undefined references to `Unwind_Resume_`, and, from what I could gather, this was a known problem with mingw packages built with SJLJ unwinding.
…On Tue, 1 Dec 2020, 23:36 Mateusz Mikuła, ***@***.***> wrote:
with few exceptions, most distributions only provide mingw packages which
use sjlj exceptions.
Most of the common distributions already use Dwarf-2 (Arch Linux, Fedora)
or are in progress to switch (Debian
<https://salsa.debian.org/mingw-w64-team/gcc-mingw-w64/-/commit/8da432fefb792fbe2f9fec2f15278d02e86e6281>)
soon.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#79577 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJI55IW7MSZHKDYNVVHEY73SSVVXNANCNFSM4UIB6SSQ>
.
|
I'll try on my Arch later today but GCC is definitely built with Dwarf-2: https://github.com/archlinux/svntogit-community/blob/863707d772cb9d3b8d67c060dd7b48a20fa7b33a/trunk/PKGBUILD#L54 |
related issue: |
Thank you for pointing me towards the PKGBUILD. After this re-install, it works fine. Closing this. POSTMORTEM: The mingw-w64-gcc was moved from the Arch package repository to the AUR in 2018. This means at the time I installed it, the compilers did not yet use DWARF2, and I did not receive updates through In August of this year, the package was added back to the regular repositories. |
I'm currently trying to somehow build a 32-bit Windows cdylib on Linux (although this should apply to any crate type, not just cdylibs), and after hours of intense rabbitholing through multiple years-old GitHub issues, I wanna compile what I've gathered.
i686-pc-windows-gnu:
5.1 use xargo (and thus nightly) to compile
std
and your code withpanic=abort
5.2 use cross, which has a docker image that will build a dw2 toolchain for you, incurring significant build time overhead.
x86_64-pc-windows-gnu:
(unfortunately, this does not help me, as I don't think 32-bit programs can load 64-bit libraries.)
questions I couldn't answer:
i686-pc-windows-gnu
, or is it officially 'abandon all hope, ye who enter here' territory?update 21:43 2020-11-30: The docker image cross provides seems to have worked. I could build the cdylib, load it, and call a function in it. this is still far from ideal, as the docker image took significant amounts of time to prepare, and consumes significant amounts of disk space..
The text was updated successfully, but these errors were encountered: