From 8a526589182e37c3bb66b637f1b8208ca901ff83 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 12 May 2019 00:15:10 -0400 Subject: [PATCH 1/2] ghc: use ncg for cross buildsystem We can use ncg for all x86 builds. Fixes #61262 --- pkgs/development/compilers/ghc/8.6.4.nix | 5 +++-- pkgs/development/compilers/ghc/8.6.5.nix | 5 +++-- pkgs/development/compilers/ghc/8.8.1.nix | 5 +++-- pkgs/development/compilers/ghc/head.nix | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.6.4.nix b/pkgs/development/compilers/ghc/8.6.4.nix index 640709aba1b8..54c53691574e 100644 --- a/pkgs/development/compilers/ghc/8.6.4.nix +++ b/pkgs/development/compilers/ghc/8.6.4.nix @@ -9,7 +9,7 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) +, useLLVM ? !stdenv.targetPlatform.isx86 , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. @@ -31,7 +31,8 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index e891ff42ff60..bc45540036d2 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -9,7 +9,7 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) +, useLLVM ? !stdenv.targetPlatform.isx86 , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. @@ -31,7 +31,8 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ diff --git a/pkgs/development/compilers/ghc/8.8.1.nix b/pkgs/development/compilers/ghc/8.8.1.nix index 9772d045b765..ad2d64866f85 100644 --- a/pkgs/development/compilers/ghc/8.8.1.nix +++ b/pkgs/development/compilers/ghc/8.8.1.nix @@ -9,7 +9,7 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) +, useLLVM ? !stdenv.targetPlatform.isx86 , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. @@ -31,7 +31,8 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 88b273500dc0..46d8dfafd0fe 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -6,7 +6,7 @@ , libiconv ? null, ncurses -, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) +, useLLVM ? !stdenv.targetPlatform.isx86 , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. @@ -29,7 +29,8 @@ , version ? "8.7.20190115" , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ From 490d9fd50967707d575a5b40aee6b3d216aa7c5c Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 12 May 2019 00:17:40 -0400 Subject: [PATCH 2/2] release-cross: use latest stable ghc Previously on ghc 8.4.4, but we can now use 8.6.5 to address the issue. --- pkgs/top-level/release-cross.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index acccd155e08d..339973f05748 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -31,7 +31,7 @@ let buildPackages.gcc = nativePlatforms; coreutils = nativePlatforms; haskell.packages.ghcHEAD.hello = nativePlatforms; - haskell.packages.ghc844.hello = nativePlatforms; + haskellPackages.hello = nativePlatforms; }; linuxCommon = lib.recursiveUpdate gnuCommon {