Skip to content

Commit

Permalink
Merge pull request #216232 from amjoseph-nixpkgs/pr/cc-wrapper/useCcF…
Browse files Browse the repository at this point in the history
…orLibs

cc-wrapper: allow non-clang compilers to use gccForLibs codepath
  • Loading branch information
trofi authored Feb 21, 2023
2 parents 3057968 + 6b6c06e commit 3bc81fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3bc81fe

Please sign in to comment.