From d8dd3014120af31d4567de8247900a1088ec6e7b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 25 Dec 2019 14:34:40 -0500 Subject: [PATCH] haskell generic-builder: Hack so CPP without a CC works --- pkgs/development/haskell-modules/generic-builder.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index e27769d9c766..018979cf7aed 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -133,8 +133,11 @@ let crossCabalFlags = [ "--with-ghc=${ghcCommand}" "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg" + # Pass the "wrong" C compiler rather than none at all so packages that just + # use the C preproccessor still work, see + # https://github.com/haskell/cabal/issues/6466 for details. + "--with-gcc=${(if stdenv.hasCC then stdenv else buildPackages.stdenv).cc.targetPrefix}cc" ] ++ optionals stdenv.hasCC [ - "--with-gcc=${stdenv.cc.targetPrefix}cc" "--with-ld=${stdenv.cc.bintools.targetPrefix}ld" "--with-ar=${stdenv.cc.bintools.targetPrefix}ar" # use the one that comes with the cross compiler.