Merge pull request #216232 from amjoseph-nixpkgs/pr/cc-wrapper/useCcForLibs

cc-wrapper: allow non-clang compilers to use gccForLibs codepath
This commit is contained in:
Sergei Trofimovich 2023-02-21 19:41:25 +00:00 committed by GitHub
commit 3bc81feb0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,6 @@
, lib
, stdenvNoCC
, cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
, gccForLibs ? null
, zlib ? null
, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
, propagateDoc ? cc != null && cc ? man
@ -18,6 +17,9 @@
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
, buildPackages ? {}
, libcxx ? null
, gccForLibs ? if useCcForLibs then cc else null
# same as `gccForLibs`, but generalized beyond clang
, useCcForLibs ? isClang
}:
with lib;
@ -61,7 +63,7 @@ let
expand-response-params =
lib.optionalString ((buildPackages.stdenv.hasCC or false) && buildPackages.stdenv.cc != "/dev/null") (import ../expand-response-params { inherit (buildPackages) stdenv; });
useGccForLibs = isClang
useGccForLibs = useCcForLibs
&& libcxx == null
&& !stdenv.targetPlatform.isDarwin
&& !(stdenv.targetPlatform.useLLVM or false)