-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Cross compiling for mingw doesn't find gcc DLLs #38451
Comments
Seems to happen on master 4366659 too |
@expipiplus1 |
CC @vcunat who wrote the original scripts. I don't really know what the windows/cygwin/mingw convention is anyways. |
Related: #36947 IIRC such inclusion masked problems in cross where gcc wouldn't search the right locations but kinda worked in native since glibc had (old, wrong) copies available. Not sure if that's what you're seeing, I'll add details later if I can find my notes about it :). |
In general, I think for cross compilation we really want fully static, and stay out of the dynamic mess. For windows, in general you likely want to fetch the referenced |
Ok I talked a bit on #msys and making the script traverse more directories seems like the right approach. Libraries still be "installed" in |
Ah! and crucially, we should put symlinks of the transitive DLLs of each DLL in |
Well, I don't know any conventions; I'm really dumb around Win-specific dev stuff. This was just a quick hack I made up a couple years ago, but I haven't really used mingw (or cygwin) since that time... |
#38632 is a draft. It's |
on older nixos (before cross-compilation changes in the last two releases or so) |
DLLs are symlinked bin/ for the exes that use them, but they should always be installed in lib/ for sake of regularity and multiple outputs. Fix NixOS#38451
This appears to be fixed? At least the example work fine for me. |
That would be odd? Without #38632 and more I don't see how we would be reliably putting the right DLLs in the bin directory. |
I think it might have been fixed by just disabling ssp at some point. I guess that’s not really a long term fix though. Honestly though, could we just always build windows statically? The windows linker doesn’t really fit well with the nix store path model anyway. |
For release-cross purposes, sure. But I don't want to give up on this irrevocably as DLLs are so idiomatic there. IIRC my script, once cc-wrapper behaves, makes it work pretty well as all the propagation is delayed to just exes, so we don't bloat library derivations. |
On current master, the original example works. wine is able to run generated exe without any issue. |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
The hello package seems to work, but it's still the case that DLLs are not forwarded. I'm trying to cross-compile something else, and no DLLs are showing up. Additionally, there isn't any |
Taeer Bar-Yam <[email protected]> writes:
The hello package seems to work, but it's still the case that DLLs are
not forwarded. I'm trying to cross-compile something else, and no DLLs
are showing up. Additionally, there isn't any `lib/` folder in any of
the cross-compiled libraries' derivations. The DLLs they build are
being put in the `bin/` folder, but not forwarded to any packages that
depend on them.
this used to work
dlls were recursively copied to bin directory from all dependencies
(vcunat developed that for me a few years ago)
iirc somebody changed that for some reason; there is a discussion on
this topic which i cant find quickly
maybe git log could show something interesting which needs reverting
(probably search *.sh files with bat in them or something like that)
|
Ah, so the file in question is the one referenced above, |
I marked this as stale due to inactivity. → More info |
Issue description
Cross compiling for mingw doesn't find gcc DLLs
Steps to reproduce
Check out
nixpkgs
0e7c9b3Build this derivation:
Observe that no DLL links are created.
Observe that the generated
hello.exe
doesn't run on windows aslibssp-0.dll
is missing.libssp-0.dll
is present in thex86_64-pc-mingw32/lib/
directory ofgcc-7.3.0-x86_64-pc-mingw32-stage-final
, however only thebin
directories are searched (seepkgs/build-support/setup-hooks/win-dll-link.sh``:19
)This could be fixed by either changing win-dll-link to search in these directories, or by linking these DLLs into the
bin/
directory of the cross compiler.Annoyingly this will cause the closure of any cross compiled derivations to include GCC. Splitting the cross compiler and its libraries into separate derivations may solve this (I think this happens for native packages)
CC @Ericson2314
The text was updated successfully, but these errors were encountered: