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 <sternenseemann@systemli.org>
This commit is contained in:
Ryan Burns 2021-12-10 18:42:56 -08:00 committed by sterni
parent 093aa2f95f
commit fd421a9fd5

View file

@ -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