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
Mingw_w64 fix to get cross-compilation working again #33167
Conversation
cc @Ericson2314 |
Woo thanks! I'm going to do some investigating of the wrapper symlinks first, but get these fixes right after, all today. |
@@ -155,13 +155,13 @@ let version = "6.4.0"; | |||
"--enable-threads=win32" | |||
"--enable-sjlj-exceptions" | |||
"--enable-hash-synchronization" | |||
"--disable-libssp" | |||
"--enable-libssp" | |||
"--disable-nls" | |||
"--with-dwarf2" | |||
# I think noone uses shared gcc libs in mingw, so we better do the same. | |||
# In any case, mingw32 g++ linking is broken by default with shared libs, | |||
# unless adding "-lsupc++" to any linking command. I don't know why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this old comment about mingw32 g++ linking being broken with shared libs must be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidEGrayson or we didn't build any C++ lol.
Hardening on by default now that we don't use the cross wrapper. In turn, hardening requires libssp in particular.
Do this because it is built with the static stage
417b2af
to
dd94bff
Compare
@bnikolic I updated your PR to avoid the binutils changes. The merge commits are so I can directly compare before and after my PR which broke mingw to begin with, which I do in https://hydra.nixos.org/eval/1421871?compare=ericson2314-old-cross-known-good. As you can see the binutils changes aren't needed (at least back then), and I also added this change to #26805 where I could at least build the compiler. |
dd94bff
to
bc3a6e2
Compare
I'm going to merge this once @GrahamcOfBorg signs off on it, and then start after the hardening change to fix the packages that regressed. |
Motivation for this change
These gets cross compilation for win64 targets using mingw32-w64 working again. Includes PR #33110 .
Key change is to disable hardening when compiling windows.mingw_w64 . Also enable ssp and shared for the final cross compilation GCC so that final version can work with normal hardening flags.
Tested using:
nix-build /home/bnikolic/oss/nixpkgs -I /home/bnikolic/oss/ -A bzip2 --arg crossSystem '(import <nixpkgs/lib>).systems.examples.mingwW64' -j 10 --cores 50 --show-trace -K -k
Needs more testing but hopefully a good starting point
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)