Use mingw-w64 for 32bit Windows builds as well.
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 <aszlig@redmoonstudios.org>
This commit is contained in:
parent
ae0b5d6813
commit
e64b342fa8
@ -159,10 +159,8 @@ let version = "4.6.3";
|
|||||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
# 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.
|
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||||
" --disable-shared" +
|
" --disable-shared" +
|
||||||
(if cross.config == "x86_64-w64-mingw32" then
|
|
||||||
# To keep ABI compatibility with upstream mingw-w64
|
# To keep ABI compatibility with upstream mingw-w64
|
||||||
" --enable-fully-dynamic-string"
|
" --enable-fully-dynamic-string"
|
||||||
else "")
|
|
||||||
else (if cross.libc == "uclibc" then
|
else (if cross.libc == "uclibc" then
|
||||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||||
# and as I don't know how to pass it, I disable libgomp.
|
# and as I don't know how to pass it, I disable libgomp.
|
||||||
|
@ -175,10 +175,8 @@ let version = "4.8.2";
|
|||||||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
# 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.
|
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||||
" --disable-shared" +
|
" --disable-shared" +
|
||||||
(if cross.config == "x86_64-w64-mingw32" then
|
|
||||||
# To keep ABI compatibility with upstream mingw-w64
|
# To keep ABI compatibility with upstream mingw-w64
|
||||||
" --enable-fully-dynamic-string"
|
" --enable-fully-dynamic-string"
|
||||||
else "")
|
|
||||||
else (if cross.libc == "uclibc" then
|
else (if cross.libc == "uclibc" then
|
||||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||||
# and as I don't know how to pass it, I disable libgomp.
|
# and as I don't know how to pass it, I disable libgomp.
|
||||||
|
@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
crossAttrs = let
|
crossAttrs = let
|
||||||
isMingwW64 = stdenv.cross.config == "x86_64-w64-mingw32";
|
isMingw = stdenv.cross.libc == "msvcrt";
|
||||||
in {
|
in {
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
makeFlagsArray=(
|
makeFlagsArray=(
|
||||||
@ -61,9 +61,9 @@ stdenv.mkDerivation rec {
|
|||||||
RANLIB=${stdenv.cross.config}-ranlib
|
RANLIB=${stdenv.cross.config}-ranlib
|
||||||
V=${majorVersion}
|
V=${majorVersion}
|
||||||
R=${version}
|
R=${version}
|
||||||
${stdenv.lib.optionals isMingwW64 "mingw"}
|
${stdenv.lib.optionals isMingw "mingw"}
|
||||||
)
|
)
|
||||||
'' + stdenv.lib.optionalString isMingwW64 ''
|
'' + stdenv.lib.optionalString isMingw ''
|
||||||
installFlagsArray=(
|
installFlagsArray=(
|
||||||
TO_BIN="lua.exe luac.exe"
|
TO_BIN="lua.exe luac.exe"
|
||||||
TO_LIB="liblua.a lua52.dll"
|
TO_LIB="liblua.a lua52.dll"
|
||||||
|
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
crossAttrs = {
|
crossAttrs = {
|
||||||
configureFlags = configureFlagsFun {
|
configureFlags = configureFlagsFun {
|
||||||
alsaSupport = stdenv.cross.config != "x86_64-w64-mingw32";
|
alsaSupport = stdenv.cross.libc != "msvcrt";
|
||||||
alsaLib = alsaLib.crossDrv;
|
alsaLib = alsaLib.crossDrv;
|
||||||
} + "--disable-directx";
|
} + "--disable-directx";
|
||||||
};
|
};
|
||||||
|
@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
|
|||||||
"CC=${stdenv.cross.config}-gcc"
|
"CC=${stdenv.cross.config}-gcc"
|
||||||
"LD=${stdenv.cross.config}-gcc"
|
"LD=${stdenv.cross.config}-gcc"
|
||||||
"STRIP="
|
"STRIP="
|
||||||
] ++ optional (stdenv.cross.config == "x86_64-w64-mingw32") "SYSTEM=mingw";
|
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "An OpenGL extension loading library for C(++)";
|
description = "An OpenGL extension loading library for C(++)";
|
||||||
|
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
# XXX: test failure on Cygwin
|
# XXX: test failure on Cygwin
|
||||||
# we are running out of stack on both freeBSDs on Hydra
|
# we are running out of stack on both freeBSDs on Hydra
|
||||||
|
|
||||||
crossAttrs = optionalAttrs (stdenv.cross.config == "x86_64-w64-mingw32") {
|
crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") {
|
||||||
buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
|
buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -148,8 +148,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
crossAttrs = let
|
crossAttrs = let
|
||||||
isMingw = stdenv.cross.config == "i686-pc-mingw32" ||
|
isMingw = stdenv.cross.libc == "msvcrt";
|
||||||
stdenv.cross.config == "x86_64-w64-mingw32";
|
|
||||||
in {
|
in {
|
||||||
# I've not tried any case other than i686-pc-mingw32.
|
# I've not tried any case other than i686-pc-mingw32.
|
||||||
# -nomake tools: it fails linking some asian language symbols
|
# -nomake tools: it fails linking some asian language symbols
|
||||||
|
@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
|
|||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd mingw-w64-headers
|
cd mingw-w64-headers
|
||||||
'';
|
'';
|
||||||
configureFlags = "--without-crt --host=x86_64-w64-mingw32";
|
configureFlags = "--without-crt";
|
||||||
} else if onlyPthreads then {
|
} else if onlyPthreads then {
|
||||||
name = name + "-pthreads";
|
name = name + "-pthreads";
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
@ -2419,9 +2419,7 @@ let
|
|||||||
|
|
||||||
gccCrossStageStatic = let
|
gccCrossStageStatic = let
|
||||||
isMingw = (stdenv.cross.libc == "msvcrt");
|
isMingw = (stdenv.cross.libc == "msvcrt");
|
||||||
isMingw64 = isMingw && stdenv.cross.config == "x86_64-w64-mingw32";
|
libcCross1 = if isMingw then windows.mingw_w64_headers else null;
|
||||||
libcCross1 = if isMingw64 then windows.mingw_w64_headers else
|
|
||||||
if isMingw then windows.mingw_headers1 else null;
|
|
||||||
in
|
in
|
||||||
wrapGCCCross {
|
wrapGCCCross {
|
||||||
gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } (
|
gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } (
|
||||||
@ -4235,9 +4233,7 @@ let
|
|||||||
# We can choose:
|
# We can choose:
|
||||||
libcCrossChooser = name : if name == "glibc" then glibcCross
|
libcCrossChooser = name : if name == "glibc" then glibcCross
|
||||||
else if name == "uclibc" then uclibcCross
|
else if name == "uclibc" then uclibcCross
|
||||||
else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
|
else if name == "msvcrt" then windows.mingw_w64
|
||||||
windows.mingw_w64
|
|
||||||
else if name == "msvcrt" then windows.mingw_headers3
|
|
||||||
else throw "Unknown libc";
|
else throw "Unknown libc";
|
||||||
|
|
||||||
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
|
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
|
||||||
|
@ -140,11 +140,11 @@ in {
|
|||||||
crossUltraSparcLinux = mapTestOnCross crossSystem basic;
|
crossUltraSparcLinux = mapTestOnCross crossSystem basic;
|
||||||
}) // (
|
}) // (
|
||||||
|
|
||||||
/* Test some cross builds on mingw32 */
|
/* Test some cross builds on 32 bit mingw-w64 */
|
||||||
let
|
let
|
||||||
crossSystem = {
|
crossSystem = {
|
||||||
config = "i686-pc-mingw32";
|
config = "i686-w64-mingw32";
|
||||||
arch = "x86";
|
arch = "x86"; # Irrelevant
|
||||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||||
platform = {};
|
platform = {};
|
||||||
};
|
};
|
||||||
@ -161,11 +161,10 @@ in {
|
|||||||
};
|
};
|
||||||
}) // (
|
}) // (
|
||||||
|
|
||||||
/* Test some cross builds on mingw-w64 */
|
/* Test some cross builds on 64 bit mingw-w64 */
|
||||||
let
|
let
|
||||||
crossSystem = {
|
crossSystem = {
|
||||||
# That's the triplet they use in the mingw-w64 docs,
|
# That's the triplet they use in the mingw-w64 docs.
|
||||||
# and it's relevant for nixpkgs conditions.
|
|
||||||
config = "x86_64-w64-mingw32";
|
config = "x86_64-w64-mingw32";
|
||||||
arch = "x86_64"; # Irrelevant
|
arch = "x86_64"; # Irrelevant
|
||||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user