haskell: Inline static overlay
We don't force `enableStaticLibraries` for Windows or WASM because it will just fail an assertion.
This commit is contained in:
parent
178ec8974f
commit
a52f9a18bf
@ -33,7 +33,7 @@ in
|
|||||||
, profilingDetail ? "exported-functions"
|
, profilingDetail ? "exported-functions"
|
||||||
# TODO enable shared libs for cross-compiling
|
# TODO enable shared libs for cross-compiling
|
||||||
, enableSharedExecutables ? false
|
, enableSharedExecutables ? false
|
||||||
, enableSharedLibraries ? (ghc.enableShared or false)
|
, enableSharedLibraries ? !stdenv.hostPlatform.isStatic && (ghc.enableShared or false)
|
||||||
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
|
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
|
||||||
, enableStaticLibraries ? !(stdenv.hostPlatform.isWindows or stdenv.hostPlatform.isWasm)
|
, enableStaticLibraries ? !(stdenv.hostPlatform.isWindows or stdenv.hostPlatform.isWasm)
|
||||||
, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
|
, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
|
||||||
|
@ -50,15 +50,6 @@ self: super: let
|
|||||||
# ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
|
# ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
|
||||||
;
|
;
|
||||||
|
|
||||||
# Force everything to link statically.
|
|
||||||
haskellStaticAdapter = self: super: {
|
|
||||||
mkDerivation = attrs: super.mkDerivation (attrs // {
|
|
||||||
enableSharedLibraries = false;
|
|
||||||
enableSharedExecutables = false;
|
|
||||||
enableStaticLibraries = true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
removeUnknownConfigureFlags = f: with self.lib;
|
removeUnknownConfigureFlags = f: with self.lib;
|
||||||
remove "--disable-shared"
|
remove "--disable-shared"
|
||||||
(remove "--enable-static" f);
|
(remove "--enable-static" f);
|
||||||
@ -102,12 +93,6 @@ in {
|
|||||||
clangStdenv = foldl (flip id) super.clangStdenv staticAdapters;
|
clangStdenv = foldl (flip id) super.clangStdenv staticAdapters;
|
||||||
libcxxStdenv = foldl (flip id) super.libcxxStdenv staticAdapters;
|
libcxxStdenv = foldl (flip id) super.libcxxStdenv staticAdapters;
|
||||||
|
|
||||||
haskell = super.haskell // {
|
|
||||||
packageOverrides = composeExtensions
|
|
||||||
(super.haskell.packageOverrides or (_: _: {}))
|
|
||||||
haskellStaticAdapter;
|
|
||||||
};
|
|
||||||
|
|
||||||
zlib = super.zlib.override {
|
zlib = super.zlib.override {
|
||||||
# Don’t use new stdenv zlib because
|
# Don’t use new stdenv zlib because
|
||||||
# it doesn’t like the --disable-shared flag
|
# it doesn’t like the --disable-shared flag
|
||||||
|
Loading…
Reference in New Issue
Block a user