From 6b6c06e5d725afeb7b6691d0e211b1f5844958a5 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 13 Feb 2023 13:50:09 -0800 Subject: cc-wrapper: allow non-clang compilers to use gccForLibs codepath cc-wrapper has essentially two separate codepaths: the `gccForLibs` codepath, used only by non-gcc (i.e. clang) compilers, and the "other" codepath. This PR allows non-clang compilers to opt-in to the `gccForLibs` codepath (off by default). To allow this, a new parameter `ccForLibs` is exposed, since it would be extremely confusing for gcc to be able to use `gccForLibs` but not do so by default. --- pkgs/build-support/cc-wrapper/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkgs/build-support/cc-wrapper') diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 6520c04f5e8a8..96fd8b66bb428 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -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) -- cgit 1.4.1