cc-wrapper: match useGccForLibs conditional order

This breaks an evaluation cycle between `cc` and `gccForLibs` for cross
builds, fixing an infinite recursion error.
wip/yesman
arcnmx 3 years ago
parent 7ed23e37bd
commit 2f1131cff7
  1. 5
      pkgs/build-support/cc-wrapper/default.nix

@ -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
''

Loading…
Cancel
Save