diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index f9b24f291aaa..1727cf0f871d 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -285,7 +285,10 @@ let buildCC = buildPackages.stdenv.cc; targetCC = builtins.head toolsForTarget; - installCC = pkgsHostTarget.targetPackages.stdenv.cc; + installCC = + if targetPlatform.isGhcjs + then pkgsHostTarget.emscripten + else pkgsHostTarget.targetPackages.stdenv.cc; # toolPath calculates the absolute path to the name tool associated with a # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take