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