Skip to content

Fix and improve MinGW-w64 cross-builds#1876

Closed
aszlig wants to merge 15 commits intomasterfrom
mingw-w64
Closed

Fix and improve MinGW-w64 cross-builds#1876
aszlig wants to merge 15 commits intomasterfrom
mingw-w64

Conversation

@aszlig
Copy link
Member

@aszlig aszlig commented Mar 4, 2014

This updates MinGW-w64 to the latest upstream version and also cross-builds for 32bit using MinGW-w64, because MinGW(32) doesn't seem to be maintained anymore. Also, it makes things way more consistent because we simply rely on one CRT for both 32/64 builds.

I have set up a jobset on my Hydra to check whether this breaks any non-cross-builds:

https://headcounter.org/hydra/jobset/aszlig/mingw-w64

The additional failures in 2032 are because of failed hash checks.

Any comments/suggestions before merging?

This package wasn't imported by anything in the package tree and also
isn't used for cross-builds. So in order to avoid confusion, it's better
to remove it as it is outdated as well.

Signed-off-by: aszlig <[email protected]>
In Windows there is no get(e)uid() call available, so the build fails.

The patch now checks whether OPENSSL_SYS_WINDOWS is defined and only
uses those calls if _not_ on Windows.

Signed-off-by: aszlig <[email protected]>
At least for x86_64-w64-mingw32, it doesn't make sense to use the native
strip tool for stripping of symbols. To the contrary it results in
unusable archive files.

Signed-off-by: aszlig <[email protected]>
Not sure why this even got into the upstream release, as _all_ other
includes use forward slashes.

Signed-off-by: aszlig <[email protected]>
D'oh, no wonder the headers are of almost the same size as the main
package.

Signed-off-by: aszlig <[email protected]>
The winpthreads library is part of the same source package, so let's
just override the name and the source directory.

Signed-off-by: aszlig <[email protected]>
That way we're able to build with the JIT compiler enabled.

Signed-off-by: aszlig <[email protected]>
This also cleans up the package expression a bit and we no longer
directly override the phases (except patchPhase).

Also for cross-builds we're using the stock mingw target and pass CC, LD
and STRIP to make, because the mingw-w64 targets of the upstream package
are outdated.

Signed-off-by: aszlig <[email protected]>
This is to make sure that we don't get Xlibs or alsa in cross builds,
because those aren't available on non-Linux/Unix platforms.

Also, until we don't have the DirectX SDK packaged, let's disable it
during cross builds.

Signed-off-by: aszlig <[email protected]>
This is because autoconf is passing -print-prog-name=ld to the
cross-gcc, which in turn assumes a FHS compliant filesystem hierarchy
and searches ../../../../$crossConfig/bin/ld for the correct ld.

Of course, this won't work on Nix, hence we're explicitly passing the
correct LD program name.

Signed-off-by: aszlig <[email protected]>
Especially for the 64bit mingw target, because libgcrypt contains
protected mode assembly.

Also, this adds gettext to the crossAttrs of libgpg-error, because it
tries to regenerate the MO files.

Signed-off-by: aszlig <[email protected]>
Mingw(32) is rather poorly maintaned and has quite a lot of bugs. And
because our Windows cross builds were also poorly maintained and most of
the cross-tests were broken as well, I'm just taking this step and try
to switch to mingw-w64 for everything "cross Windows".

Signed-off-by: aszlig <[email protected]>
This is no longer needed, because we've already fixed the dynamic
cross-linker.

Signed-off-by: aszlig <[email protected]>
@aszlig
Copy link
Member Author

aszlig commented Mar 7, 2014

No comments? @viric maybe? If not, I'm going to merge this with the (coming soon) Darwin cross-builds.

aszlig added a commit to aszlig/nixpkgs that referenced this pull request Mar 12, 2014
Both branches have quite a lot in common, so it's time for a merge and
do the cleanups with respect to both implementations and also generalize
both implementations as much as possible.

This also closes NixOS#1876.

Conflicts:
	pkgs/development/interpreters/lua-5/5.2.nix
	pkgs/development/libraries/SDL/default.nix
	pkgs/development/libraries/glew/default.nix
	pkgs/top-level/all-packages.nix
@aszlig
Copy link
Member Author

aszlig commented Mar 12, 2014

Merged into #1928.

@aszlig aszlig closed this Mar 12, 2014
@aszlig aszlig deleted the mingw-w64 branch March 12, 2014 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant