diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index b2ff43ca0989336..f7ee4a6fd4f5430 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -472,6 +472,16 @@ stdenv.mkDerivation (rec { "otool command" "${toolPath "otool" installCC}" \ "install_name_tool command" "${toolPath "install_name_tool" installCC}" '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + # FIXME(@sternenseemann): use installCC instead if possible + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + '' + '' # Install the bash completion file. diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index e4a48e29624db3f..1e42f70d66a50e6 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -620,6 +620,16 @@ stdenv.mkDerivation ({ "otool command" "${toolPath "otool" installCC}" \ "install_name_tool command" "${toolPath "install_name_tool" installCC}" '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + # FIXME(@sternenseemann): use installCC instead if possible + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + '' # Work around a GHC bug which causes unlit to be installed under a different # name than is used in the settings file. # https://gitlab.haskell.org/ghc/ghc/-/issues/23317 diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 31fd9ff405d6834..59897f9949eadb1 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -489,6 +489,16 @@ stdenv.mkDerivation (rec { "otool command" "${toolPath "otool" installCC}" \ "install_name_tool command" "${toolPath "install_name_tool" installCC}" '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + # FIXME(@sternenseemann): use installCC instead if possible + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + '' + '' # Install the bash completion file.