Merge pull request #119068 from arcnmx/fix-cc-gccforlibs

cc-wrapper: match useGccForLibs conditional order
This commit is contained in:
John Ericson 2021-04-10 22:41:57 -04:00 committed by GitHub
commit 4b21d06df0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,10 +299,11 @@ stdenv.mkDerivation {
# vs libstdc++, etc.) since Darwin isn't `useLLVM` on all counts. (See
# https://clang.llvm.org/docs/Toolchain.html for all the axes one might
# break `useLLVM` into.)
+ optionalString (isClang && gccForLibs != null
+ optionalString (isClang
&& targetPlatform.isLinux
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false)
&& !(stdenv.targetPlatform.useLLVM or false)) ''
&& !(stdenv.targetPlatform.useLLVM or false)
&& gccForLibs != null) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
''