Merge pull request #42311 from obsidiansystems/haskell-enable-shared-defaults

haskell: make generic builder follow compiler’s shared config
This commit is contained in:
John Ericson 2018-06-21 18:07:11 -04:00 committed by GitHub
commit e050011aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 4 deletions

View File

@ -153,7 +153,10 @@ stdenv.mkDerivation rec {
[ $(./main) == "yes" ] [ $(./main) == "yes" ]
''; '';
passthru = { targetPrefix = ""; }; passthru = {
targetPrefix = "";
enableShared = true;
};
meta.license = stdenv.lib.licenses.bsd3; meta.license = stdenv.lib.licenses.bsd3;
meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"]; meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"];

View File

@ -177,6 +177,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
inherit llvmPackages; inherit llvmPackages;
inherit enableShared;
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-7.10.3"; haskellCompilerName = "ghc-7.10.3";

View File

@ -183,6 +183,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
inherit llvmPackages; inherit llvmPackages;
inherit enableShared;
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-8.0.2"; haskellCompilerName = "ghc-8.0.2";

View File

@ -155,7 +155,10 @@ stdenv.mkDerivation rec {
[ $(./main) == "yes" ] [ $(./main) == "yes" ]
''; '';
passthru = { targetPrefix = ""; }; passthru = {
targetPrefix = "";
enableShared = true;
};
meta.license = stdenv.lib.licenses.bsd3; meta.license = stdenv.lib.licenses.bsd3;
# AArch64 should work in theory but eventually some builds start segfaulting # AArch64 should work in theory but eventually some builds start segfaulting

View File

@ -201,6 +201,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
inherit llvmPackages; inherit llvmPackages;
inherit enableShared;
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-8.2.2"; haskellCompilerName = "ghc-8.2.2";

View File

@ -195,6 +195,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
inherit llvmPackages; inherit llvmPackages;
inherit enableShared;
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-8.4.3"; haskellCompilerName = "ghc-8.4.3";

View File

@ -191,6 +191,7 @@ stdenv.mkDerivation rec {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
inherit llvmPackages; inherit llvmPackages;
inherit enableShared;
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-8.5"; haskellCompilerName = "ghc-8.5";

View File

@ -42,6 +42,8 @@ let
inherit (bootGhcjs) version; inherit (bootGhcjs) version;
isGhcjs = true; isGhcjs = true;
enableShared = true;
socket-io = nodePackages."socket.io"; socket-io = nodePackages."socket.io";
# Relics of the old GHCJS build system # Relics of the old GHCJS build system
@ -96,4 +98,3 @@ in stdenv.mkDerivation {
meta.platforms = passthru.bootPkgs.ghc.meta.platforms; meta.platforms = passthru.bootPkgs.ghc.meta.platforms;
} }

View File

@ -179,6 +179,8 @@ in mkDerivation (rec {
# let us assume ghcjs is never actually cross compiled # let us assume ghcjs is never actually cross compiled
targetPrefix = ""; targetPrefix = "";
enableShared = true;
inherit stage1Packages; inherit stage1Packages;
mkStage2 = stage2 { mkStage2 = stage2 {
inherit ghcjsBoot; inherit ghcjsBoot;

View File

@ -30,7 +30,7 @@ in
, profilingDetail ? "all-functions" , profilingDetail ? "all-functions"
# TODO enable shared libs for cross-compiling # TODO enable shared libs for cross-compiling
, enableSharedExecutables ? false , enableSharedExecutables ? false
, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) , enableSharedLibraries ? (ghc.enableShared or false)
, enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin
, enableStaticLibraries ? !hostPlatform.isWindows , enableStaticLibraries ? !hostPlatform.isWindows
, enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" , enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"