@@ -31,7 +31,7 @@ in
3131, enableSharedExecutables ? false
3232, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
3333, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
34−, enableStaticLibraries ? true
34+, enableStaticLibraries ? !hostPlatform.isWindows
3535, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
3636, extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? []
3737, homepage ? "http://hackage.haskell.org/package/${pname}"
@@ -68,6 +68,10 @@ in
6868
6969assert editedCabalFile != null -> revision != null;
7070
71+# --enable-static does not work on windows. This is a bug in GHC.
72+# --enable-static will pass -staticlib to ghc, which only works for mach-o and elf.
73+assert hostPlatform.isWindows -> enableStaticLibraries == false;
74+
7175let
7276
7377 inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast