ghc: Remove old cross work

That way the next commit can apply a similar diff to each GHC.
This commit is contained in:
John Ericson 2017-02-02 11:44:11 -05:00 committed by John Ericson
parent 54ead73271
commit bc16cfc009
4 changed files with 31 additions and 118 deletions

View File

@ -1,6 +1,5 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform , buildPlatform, hostPlatform, targetPlatform
, selfPkgs, cross ? null
# build-tools # build-tools
, bootPkgs, alex, happy, hscolour, llvm_39 , bootPkgs, alex, happy, hscolour, llvm_39
@ -29,7 +28,7 @@ let
BuildFlavour = perf-cross BuildFlavour = perf-cross
''; '';
in in
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
version = "8.2.2"; version = "8.2.2";
name = "${targetPrefix}ghc-${version}"; name = "${targetPrefix}ghc-${version}";
@ -89,11 +88,6 @@ stdenv.mkDerivation (rec {
passthru = { passthru = {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
crossCompiler = selfPkgs.ghc.override {
cross = targetPlatform;
bootPkgs = selfPkgs;
};
}; };
meta = { meta = {
@ -103,24 +97,4 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs (cross != null) { }
configureFlags = [
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
"AR=${stdenv.cc.bintools}/bin/${cross.config}-ar"
"NM=${stdenv.cc.bintools}/bin/${cross.config}-nm"
"RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
configurePlatforms = [];
passthru = {
inherit bootPkgs cross;
cc = "${stdenv.cc}/bin/${cross.config}-cc";
ld = "${stdenv.cc}/bin/${cross.config}-ld";
};
})

View File

@ -1,6 +1,5 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform , buildPlatform, hostPlatform, targetPlatform
, selfPkgs, cross ? null
# build-tools # build-tools
, bootPkgs, alex, happy , bootPkgs, alex, happy
@ -33,7 +32,7 @@ let
BuildFlavour = perf-cross BuildFlavour = perf-cross
''; '';
in in
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
inherit version rev; inherit version rev;
name = "${targetPrefix}ghc-${version}"; name = "${targetPrefix}ghc-${version}";
@ -95,11 +94,6 @@ stdenv.mkDerivation (rec {
passthru = { passthru = {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
crossCompiler = selfPkgs.ghc.override {
cross = targetPlatform;
bootPkgs = selfPkgs;
};
}; };
meta = { meta = {
@ -109,24 +103,4 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs (cross != null) { }
configureFlags = [
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
"AR=${stdenv.cc.bintools}/bin/${cross.config}-ar"
"NM=${stdenv.cc.bintools}/bin/${cross.config}-nm"
"RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
configurePlatforms = [];
passthru = {
inherit bootPkgs cross;
cc = "${stdenv.cc}/bin/${cross.config}-cc";
ld = "${stdenv.cc}/bin/${cross.config}-ld";
};
})

View File

@ -1,6 +1,5 @@
{ stdenv, targetPackages { stdenv, targetPackages
, buildPlatform, hostPlatform, targetPlatform , buildPlatform, hostPlatform, targetPlatform
, selfPkgs, cross ? null
# build-tools # build-tools
, bootPkgs, alex, happy , bootPkgs, alex, happy
@ -33,7 +32,7 @@ let
BuildFlavour = perf-cross BuildFlavour = perf-cross
''; '';
in in
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
inherit version rev; inherit version rev;
name = "${targetPrefix}ghc-${version}"; name = "${targetPrefix}ghc-${version}";
@ -95,11 +94,6 @@ stdenv.mkDerivation (rec {
passthru = { passthru = {
inherit bootPkgs targetPrefix; inherit bootPkgs targetPrefix;
} // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
crossCompiler = selfPkgs.ghc.override {
cross = targetPlatform;
bootPkgs = selfPkgs;
};
}; };
meta = { meta = {
@ -109,24 +103,4 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs (cross != null) { }
configureFlags = [
"CC=${stdenv.cc}/bin/${cross.config}-cc"
"LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
"AR=${stdenv.cc.bintools}/bin/${cross.config}-ar"
"NM=${stdenv.cc.bintools}/bin/${cross.config}-nm"
"RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
configurePlatforms = [];
passthru = {
inherit bootPkgs cross;
cc = "${stdenv.cc}/bin/${cross.config}-cc";
ld = "${stdenv.cc}/bin/${cross.config}-ld";
};
})

View File

@ -1,4 +1,7 @@
{ pkgs, lib, newScope, stdenv, buildPlatform, targetPlatform, cabal-install }: { buildPackages, pkgs
, newScope, stdenv
, buildPlatform, targetPlatform
}:
let let
# These are attributes in compiler and packages that don't support integer-simple. # These are attributes in compiler and packages that don't support integer-simple.
@ -76,27 +79,22 @@ in rec {
inherit (bootPkgs) hscolour alex happy; inherit (bootPkgs) hscolour alex happy;
inherit buildPlatform targetPlatform; inherit buildPlatform targetPlatform;
sphinx = pkgs.python3Packages.sphinx; sphinx = pkgs.python3Packages.sphinx;
selfPkgs = packages.ghc822;
}; };
ghc841 = callPackage ../development/compilers/ghc/8.4.1.nix rec { ghc841 = callPackage ../development/compilers/ghc/8.4.1.nix rec {
bootPkgs = packages.ghc821Binary; bootPkgs = packages.ghc821Binary;
inherit (bootPkgs) alex happy; inherit (bootPkgs) alex happy;
inherit buildPlatform targetPlatform;
selfPkgs = packages.ghc841;
}; };
ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec { ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec {
bootPkgs = packages.ghc821Binary; bootPkgs = packages.ghc821Binary;
inherit (bootPkgs) alex happy; inherit (bootPkgs) alex happy;
inherit buildPlatform targetPlatform;
selfPkgs = packages.ghcHEAD;
}; };
ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs { ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs {
bootPkgs = packages.ghc7103; bootPkgs = packages.ghc7103;
inherit cabal-install; inherit (pkgs) cabal-install;
}; };
ghcjsHEAD = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { ghcjsHEAD = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix {
bootPkgs = packages.ghc802; bootPkgs = packages.ghc802;
inherit cabal-install; inherit (pkgs) cabal-install;
}; };
ghcHaLVM240 = callPackage ../development/compilers/halvm/2.4.0.nix rec { ghcHaLVM240 = callPackage ../development/compilers/halvm/2.4.0.nix rec {
bootPkgs = packages.ghc7103Binary; bootPkgs = packages.ghc7103Binary;
@ -110,19 +108,17 @@ in rec {
# The integer-simple attribute set contains all the GHC compilers # The integer-simple attribute set contains all the GHC compilers
# build with integer-simple instead of integer-gmp. # build with integer-simple instead of integer-gmp.
integer-simple = integer-simple = let
let integerSimpleGhcNames = integerSimpleGhcNames = pkgs.lib.filter
pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) (name: ! builtins.elem name integerSimpleExcludes)
(pkgs.lib.attrNames compiler); (pkgs.lib.attrNames compiler);
integerSimpleGhcs = pkgs.lib.genAttrs integerSimpleGhcNames in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs
(name: compiler."${name}".override { enableIntegerSimple = true; }); integerSimpleGhcNames
in pkgs.recurseIntoAttrs (integerSimpleGhcs // { (name: compiler."${name}".override { enableIntegerSimple = true; }));
ghcHEAD = integerSimpleGhcs.ghcHEAD.override { selfPkgs = packages.integer-simple.ghcHEAD; };
});
}; };
packages = { # Always get compilers from `buildPackages`
packages = let inherit (buildPackages.haskell) compiler; in {
ghc7103 = callPackage ../development/haskell-modules { ghc7103 = callPackage ../development/haskell-modules {
ghc = compiler.ghc7103; ghc = compiler.ghc7103;
@ -152,11 +148,6 @@ in rec {
ghc = compiler.ghcHEAD; ghc = compiler.ghcHEAD;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
}; };
# TODO Support for multiple variants here
ghcCross = callPackage ../development/haskell-modules {
ghc = compiler.ghcHEAD.crossCompiler;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
};
ghcjs = callPackage ../development/haskell-modules { ghcjs = callPackage ../development/haskell-modules {
ghc = compiler.ghcjs; ghc = compiler.ghcjs;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
@ -174,9 +165,9 @@ in rec {
# The integer-simple attribute set contains package sets for all the GHC compilers # The integer-simple attribute set contains package sets for all the GHC compilers
# using integer-simple instead of integer-gmp. # using integer-simple instead of integer-gmp.
integer-simple = integer-simple = let
let integerSimpleGhcNames = integerSimpleGhcNames = pkgs.lib.filter
pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) (name: ! builtins.elem name integerSimpleExcludes)
(pkgs.lib.attrNames packages); (pkgs.lib.attrNames packages);
in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override { in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override {
ghc = compiler.integer-simple."${name}"; ghc = compiler.integer-simple."${name}";