From f90244c970dbc053cee0fdb9b73eb98493d65fde Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 17 May 2021 17:22:47 +0200 Subject: [PATCH] haskell.compiler.ghcHEAD: disable DWARF on non x86 The broken build of ghcHEAD on aarch64-linux results from rts/Libdw.c not supporting that platform. Seemingly this particular file is only relevant for DWARF support in GHC, so we disable that on unsupported platforms. --- pkgs/development/compilers/ghc/head.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 60371ec5a1b..8a2a6397257 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -10,7 +10,9 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, enableDwarf ? !stdenv.targetPlatform.isDarwin && + # Libdw.c only supports x86_64, i686 and s390x +, enableDwarf ? stdenv.targetPlatform.isx86 && + !stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isWindows , elfutils # for DWARF support @@ -258,10 +260,7 @@ stdenv.mkDerivation (rec { homepage = "http://haskell.org/ghc"; description = "The Glasgow Haskell Compiler"; maintainers = with lib.maintainers; [ marcweber andres peti ]; - inherit (ghc.meta) license; - # GHC-HEAD does not appear to compile on aarch64. - broken = stdenv.isAarch64; - platforms = builtins.filter (p: p != "aarch64-linux") ghc.meta.platforms; + inherit (ghc.meta) license platforms; }; dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);