Skip to content
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

i686-pc-windows-gnu support #469

Closed
amircodota opened this issue Oct 14, 2020 · 4 comments
Closed

i686-pc-windows-gnu support #469

amircodota opened this issue Oct 14, 2020 · 4 comments
Labels
A-windows Area: windows targets bug

Comments

@amircodota
Copy link

We have a rust binary with openssl that we need to cross compile for windows - both x86_64 and i686.

I was able to create a custom docker image for x86_64-pc-windows-gnu that works well.

I also tried to create a custom image for i686-pc-windows-gnu. There was no base image to customize, so I copied the Dockerfile.x86_64-pc-windows-gnu file to a new one, and changed some stuff around to make it use g++-mingw-w64-i686.

That got me further along - openssl-sys seems to compile correctly.

However, now I get these errors:

/rustc/c367798cfd3817ca6ae908ce675d1d99242af148\/src\libstd/backtrace.rs:229: undefined reference to _Unwind_Resume

This seems to stem from mingw64 for i686 using sjlj for exception handling instead of dwarf-2 which the rust compiler expects (according to this).

Has anyone here had success with this?

In the past, we had success with the japaric/i686-pc-windows-gnu docker image, so maybe @japaric can shed some light on this?

This image no longer works for me. I tried reverting to older versions of cross and older versions of rust, but it still fails.
The weird thing is that this image still works on an old ci machine machine we have, but not on my machine, and I could not figure out why.

Thanks
Amir

cjdelisle added a commit to cjdelisle/packetcrypt_rs that referenced this issue Oct 18, 2020
Use relay functions instead of static function pointers to fix crash in windows
Workaround cross-rs/cross#469
@japaric
Copy link
Contributor

japaric commented Oct 19, 2020

so maybe @japaric can shed some light on this?

I'm sorry it's been too long since I looked into that target's Dockerfile.

This seems to stem from mingw64 for i686 using sjlj for exception handling instead of dwarf-2 which the rust compiler expects (according to this).

Different exception handling is the only thing I remember about these mingw targets.

@malbarbo
Copy link
Contributor

I created a fix: #471

@amircodota
Copy link
Author

Awesome news @malbarbo Thanks!

@amircodota
Copy link
Author

@malbarbo Just tried it and it worked like a charm. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-windows Area: windows targets bug
Projects
None yet
Development

No branches or pull requests

4 participants