Skip to content

Commit

Permalink
haskell.compiler.*: set correct runtime LLVM tools in settings
Browse files Browse the repository at this point in the history
Note that the clang command should be adapted in the future as done for
CLANG in #338782.
  • Loading branch information
sternenseemann committed Sep 8, 2024
1 parent 6e07628 commit df16902
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkgs/development/compilers/ghc/8.10.7.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,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
Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/compilers/ghc/common-make-native-bignum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit df16902

Please sign in to comment.