Merge pull request #148079 from sternenseemann/ghc-set-clang-only-if-use-llvm
haskell.compiler.*: only set CLANG to match llc/opt
This commit is contained in:
commit
c85d141221
5 changed files with 20 additions and 35 deletions
|
@ -240,13 +240,10 @@ stdenv.mkDerivation (rec {
|
|||
'' + lib.optionalString useLLVM ''
|
||||
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
|
||||
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (targetCC.isClang || (useLLVM && stdenv.targetPlatform.isDarwin)) (let
|
||||
# LLVM backend on Darwin needs clang, if we are already using clang, might as well set the environment variable.
|
||||
# See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
clang = if targetCC.isClang then targetCC else llvmPackages.clang;
|
||||
in ''
|
||||
export CLANG="${clang}/bin/${clang.targetPrefix}clang"
|
||||
'') + ''
|
||||
'' + 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"
|
||||
'' + ''
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
|
|
|
@ -227,13 +227,10 @@ stdenv.mkDerivation (rec {
|
|||
'' + lib.optionalString useLLVM ''
|
||||
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
|
||||
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (targetCC.isClang || (useLLVM && stdenv.targetPlatform.isDarwin)) (let
|
||||
# LLVM backend on Darwin needs clang, if we are already using clang, might as well set the environment variable.
|
||||
# See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
clang = if targetCC.isClang then targetCC else llvmPackages.clang;
|
||||
in ''
|
||||
export CLANG="${clang}/bin/${clang.targetPrefix}clang"
|
||||
'') + ''
|
||||
'' + 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"
|
||||
'' + ''
|
||||
|
||||
echo -n "${buildMK dontStrip}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
|
|
|
@ -206,13 +206,10 @@ stdenv.mkDerivation (rec {
|
|||
'' + lib.optionalString useLLVM ''
|
||||
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
|
||||
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (targetCC.isClang || (useLLVM && stdenv.targetPlatform.isDarwin)) (let
|
||||
# LLVM backend on Darwin needs clang, if we are already using clang, might as well set the environment variable.
|
||||
# See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
clang = if targetCC.isClang then targetCC else llvmPackages.clang;
|
||||
in ''
|
||||
export CLANG="${clang}/bin/${clang.targetPrefix}clang"
|
||||
'') + ''
|
||||
'' + 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"
|
||||
'' + ''
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
|
|
|
@ -207,13 +207,10 @@ stdenv.mkDerivation (rec {
|
|||
'' + lib.optionalString useLLVM ''
|
||||
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
|
||||
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (targetCC.isClang || (useLLVM && stdenv.targetPlatform.isDarwin)) (let
|
||||
# LLVM backend on Darwin needs clang, if we are already using clang, might as well set the environment variable.
|
||||
# See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
clang = if targetCC.isClang then targetCC else llvmPackages.clang;
|
||||
in ''
|
||||
export CLANG="${clang}/bin/${clang.targetPrefix}clang"
|
||||
'') + ''
|
||||
'' + 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"
|
||||
'' + ''
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
|
|
|
@ -220,13 +220,10 @@ stdenv.mkDerivation (rec {
|
|||
'' + lib.optionalString useLLVM ''
|
||||
export LLC="${lib.getBin llvmPackages.llvm}/bin/llc"
|
||||
export OPT="${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (targetCC.isClang || (useLLVM && stdenv.targetPlatform.isDarwin)) (let
|
||||
# LLVM backend on Darwin needs clang, if we are already using clang, might as well set the environment variable.
|
||||
# See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
clang = if targetCC.isClang then targetCC else llvmPackages.clang;
|
||||
in ''
|
||||
export CLANG="${clang}/bin/${clang.targetPrefix}clang"
|
||||
'') + ''
|
||||
'' + 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"
|
||||
'' + ''
|
||||
|
||||
# otherwise haddock fails when generating the compiler docs
|
||||
export LANG=C.UTF-8
|
||||
|
|
Loading…
Reference in a new issue