haskell generic builder: Disable static libs on Windows because no -staticlib
The reason why this does not work is not that we can't built static objects, we can, but we can't use `-staticlib` on GHC on windows. `-staticlib` rolls all dependencies into a combined archive. While this would work on windows if we used gnu ar and MRI script, GHC can't rely on GNU ar, and as such has a quick archive concatenation module for GNU and BSD archives only.
This commit is contained in:
parent
38fbdcc726
commit
a4d5dbd45d
@ -31,7 +31,7 @@ in
|
||||
, enableSharedExecutables ? false
|
||||
, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
|
||||
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
|
||||
, enableStaticLibraries ? true
|
||||
, enableStaticLibraries ? !hostPlatform.isWindows
|
||||
, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
|
||||
, extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? []
|
||||
, homepage ? "http://hackage.haskell.org/package/${pname}"
|
||||
@ -68,6 +68,10 @@ in
|
||||
|
||||
assert editedCabalFile != null -> revision != null;
|
||||
|
||||
# --enable-static does not work on windows. This is a bug in GHC.
|
||||
# --enable-static will pass -staticlib to ghc, which only works for mach-o and elf.
|
||||
assert hostPlatform.isWindows -> enableStaticLibraries == false;
|
||||
|
||||
let
|
||||
|
||||
inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast
|
||||
|
Loading…
Reference in New Issue
Block a user