haskell.compiler.*: use build->target LLVM in build

This is no substantial change, as we already assert that the
build->target and host->target LLVM are the same, but this brings the
terminology in the file in a more consistent order, since we use
build->target for CC/CXX and bintools already.

In fact we should be passing build->target to configure always,
host->target would come into play when updating GHC's settings file
after installing.
This commit is contained in:
sternenseemann 2021-12-01 18:37:24 +01:00
parent 512c0ee78a
commit c610be58c0
5 changed files with 15 additions and 15 deletions

View file

@ -238,11 +238,11 @@ stdenv.mkDerivation (rec {
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
'' + lib.optionalString useLLVM ''
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
export CLANG="${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
'' + ''
echo -n "${buildMK}" > mk/build.mk

View file

@ -225,11 +225,11 @@ stdenv.mkDerivation (rec {
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
'' + lib.optionalString useLLVM ''
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
export CLANG="${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
'' + ''
echo -n "${buildMK dontStrip}" > mk/build.mk

View file

@ -204,11 +204,11 @@ stdenv.mkDerivation (rec {
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
'' + lib.optionalString useLLVM ''
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
export CLANG="${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
'' + ''
echo -n "${buildMK}" > mk/build.mk

View file

@ -205,11 +205,11 @@ stdenv.mkDerivation (rec {
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
'' + lib.optionalString useLLVM ''
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
export CLANG="${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
'' + ''
echo -n "${buildMK}" > mk/build.mk

View file

@ -218,11 +218,11 @@ stdenv.mkDerivation (rec {
export OTOOL="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}otool"
export INSTALL_NAME_TOOL="${bintoolsFor.install_name_tool}/bin/${bintoolsFor.install_name_tool.targetPrefix}install_name_tool"
'' + lib.optionalString useLLVM ''
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
export CLANG="${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
'' + ''
# otherwise haddock fails when generating the compiler docs