From 2f1131cff7ccff5fc2e7a29358984d200940215e Mon Sep 17 00:00:00 2001 From: arcnmx Date: Sat, 10 Apr 2021 10:39:07 -0700 Subject: [PATCH] cc-wrapper: match useGccForLibs conditional order This breaks an evaluation cycle between `cc` and `gccForLibs` for cross builds, fixing an infinite recursion error. --- pkgs/build-support/cc-wrapper/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 31689022b32..60915d6645a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/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 ''