Skip to content

Commit

Permalink
cc-wrapper: use isClang codepath for externally-bootstrapped gcc
Browse files Browse the repository at this point in the history
This commit generalizes the `useGccForLibs` feature beyond only
`isClang`.  In particular that codepath can now be used by
explicitly setting `useCcForLibs`, which otherwise is on if and only
if `cc` is an externally-bootstrapped gcc (which behaves much more
like clang from a `cc-wrapper` perspective).
  • Loading branch information
Adam Joseph committed Jan 11, 2023
1 parent f774386 commit 9c7e9ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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,7 @@
, lib
, stdenvNoCC
, cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
, gccForLibs ? null
, gccForLibs ? if useCcForLibs then cc else null
, zlib ? null
, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
, propagateDoc ? cc != null && cc ? man
Expand All @@ -18,6 +18,7 @@
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
, buildPackages ? {}
, libcxx ? null
, useCcForLibs ? isClang || (cc.passthru.enableExternalBootstrap or false)
}:

with lib;
Expand Down Expand Up @@ -63,7 +64,7 @@ let
then import ../expand-response-params { inherit (buildPackages) stdenv; }
else "";

useGccForLibs = isClang
useGccForLibs = useCcForLibs
&& libcxx == null
&& !stdenv.targetPlatform.isDarwin
&& !(stdenv.targetPlatform.useLLVM or false)
Expand Down

0 comments on commit 9c7e9ef

Please sign in to comment.