From fd421a9fd535a59cd5a4a832b4760c178dfebfc4 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Fri, 10 Dec 2021 18:42:56 -0800 Subject: [PATCH] haskell.packages.ghcHEAD: refine enableDwarf platform condition for darwin enableDwarf requires elfutils on the host, which doesn't support darwin. Instead of hardcoded isDarwin/isWindows, switch to self-documenting availableOn conditional for elfutils. Fixes ghcHEAD cross-compilation when build = host = darwin, target = linux. Co-authored-by: sternenseemann --- pkgs/development/compilers/ghc/head.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 9a5767446158..a76964794015 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -12,9 +12,10 @@ libffi ? null # Libdw.c only supports x86_64, i686 and s390x -, enableDwarf ? stdenv.targetPlatform.isx86 && - !stdenv.targetPlatform.isDarwin && - !stdenv.targetPlatform.isWindows +, enableDwarf ? (stdenv.targetPlatform.isx86 || + (stdenv.targetPlatform.isS390 && stdenv.targetPlatform.is64bit)) && + lib.meta.availableOn stdenv.hostPlatform elfutils && + lib.meta.availableOn stdenv.targetPlatform elfutils , elfutils # for DWARF support , useLLVM ? !(stdenv.targetPlatform.isx86