summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/generic-builder.nix
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-12-25 14:36:13 -0500
committerJohn Ericson <git@JohnEricson.me>2019-12-25 14:36:13 -0500
commit9cbbe2b00f91b699a887b6844414c2612f82d85f (patch)
treef404d9ec8affdcf2bd876a7deb9cbf94851d21e9 /pkgs/development/haskell-modules/generic-builder.nix
parent49daa0aa64aea9143f9deb75bf277670dac90e1f (diff)
parentd8dd3014120af31d4567de8247900a1088ec6e7b (diff)
downloadnixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar.gz
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar.bz2
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar.lz
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar.xz
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.tar.zst
nixpkgs-9cbbe2b00f91b699a887b6844414c2612f82d85f.zip
Merge branch 'ghcjs-cross-without-cc-common' into ghcjs-cross-without-cc
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index e6edc3a2bc5..2ae33138696 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.