Skip to content

Commit 258c62d

Browse files
native aarch64 support
1 parent 6c57d4f commit 258c62d

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

compiler/ghc/default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# build-tools
99
, bootPkgs
10-
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4, sphinx
10+
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4, sphinx, numactl
1111
, autoreconfHook
1212
, bash
1313

@@ -116,7 +116,8 @@ let
116116
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
117117
++ [targetLibffi]
118118
++ stdenv.lib.optional (!enableIntegerSimple) gmp
119-
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
119+
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
120+
++ stdenv.lib.optional platform.isLinux numactl;
120121

121122
toolsForTarget =
122123
if hostPlatform == buildPlatform then
@@ -221,7 +222,7 @@ in let configured-src = stdenv.mkDerivation (rec {
221222

222223
outputs = [ "out" ];
223224
phases = [ "unpackPhase" "patchPhase" ]
224-
++ stdenv.lib.optional (ghc-patches != []) "autoreconfPhase"
225+
# ++ stdenv.lib.optional (ghc-patches != []) "autoreconfPhase"
225226
++ [ "configurePhase" "installPhase" ];
226227
installPhase = "cp -r . $out";
227228
});

compiler/old-ghc-nix/old-ghc-nix.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"url": "https://github.com/angerman/old-ghc-nix",
3-
"rev": "bf640c1a3f55203bb7492a366c6492ff3c211332",
4-
"date": "2020-02-27T19:53:36+08:00",
5-
"sha256": "050g06911rpmvn66y5lmnszswz17flw3b979imdchc2apji6a1sm",
2+
"url": "https://github.com/traviswhitaker/old-ghc-nix",
3+
"rev": "0d136da6e48de6d1256c8aa2b281662e93f9e486",
4+
"sha256": "1cp6aksb6ldgjb5zyqikyjrjij79n9z7wd86migph0wp19vmszkf",
65
"fetchSubmodules": false
76
}

nix-tools/regenerate.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ in
5454
# "stm" "terminfo"
5555
];
5656
}];
57-
}).nix-tools.components.exes.plan-to-nix; in
57+
}).nix-tools.components.exes.plan-to-nix;
58+
bootstrap = if pkgs.targetPlatform.isAarch64
59+
then haskell-nix.bootstrap.compiler.ghc882
60+
else haskell-nix.bootstrap.compiler.ghc844;
61+
in
5862
with builtins;
5963
with stdenv.lib;
6064
writeShellScriptBin "update-nix-tools" ''

overlays/bootstrap.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,20 @@ let
2828
fi
2929
done
3030
'';
31+
buildBootstrapper =
32+
if final.targetPlatform.isAarch64
33+
then final.buildPackages.haskell-nix.bootstrap.compiler.ghc882
34+
else final.buildPackages.haskell-nix.bootstrap.compiler.ghc844;
35+
buildBuildBootstrapper =
36+
if final.targetPlatform.isAarch64
37+
then final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc882
38+
else final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc844;
3139
in {
3240
haskell-nix = prev.haskell-nix // {
3341
# Use this to disable the existing haskell infra structure for testing purposes
3442
compiler =
3543
let bootPkgs = with final.buildPackages; {
36-
ghc = buildPackages.haskell-nix.bootstrap.compiler.ghc844;
44+
ghc = buildBuildBootstrapper;
3745
alex = final.haskell-nix.bootstrap.packages.alex-tool {
3846
checkMaterialization = false;
3947
};
@@ -438,7 +446,7 @@ in {
438446

439447

440448
# the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
441-
bootstrap = with final.haskell-nix; let ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc844; in {
449+
bootstrap = with final.haskell-nix; let ghc = buildBootstrapper; in {
442450
# XXX: import ../. will throw away all other overlays, config values, ...
443451
# this is not ideal!
444452
# get binary compilers for bootstrapping. We'll put the eventual proper
@@ -474,9 +482,10 @@ in {
474482
} // args);
475483
alex = bootstrap.packages.alex-tool {};
476484
happy-tool = args: tool "happy" ({
477-
version = "1.19.11";
485+
version = "1.19.12";
478486
# Only a boot compiler is suitable here
479487
ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
488+
inherit (bootstrap.packages) cabal-install nix-tools hpack;
480489
index-state = final.haskell-nix.internalHackageIndexState;
481490
materialized = ../materialized/bootstrap/happy;
482491
} // args);

0 commit comments

Comments
 (0)