summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2020-09-11 14:18:32 +0200
committerVladimír Čunát <v@cunat.cz>2020-09-11 14:24:13 +0200
commite88e14ec8da1c6696d2a24eb93a6ee10e2bea117 (patch)
tree01bc60c313c2d1e8f19afe6f31cae7445ef404b4 /pkgs/build-support/cc-wrapper
parenta834677062acd142c52ceb7fbae0f91edf8ed03f (diff)
parent8149ab158b6a6210db36cf698e6e63039e0c96ae (diff)
downloadnixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar.gz
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar.bz2
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar.lz
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar.xz
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.tar.zst
nixpkgs-e88e14ec8da1c6696d2a24eb93a6ee10e2bea117.zip
Merge branch 'master' into staging-next
A few thousand rebuilds per platform have arrived in the meantime.
Diffstat (limited to 'pkgs/build-support/cc-wrapper')
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index bfb15f2f783..0e4e76d7284 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -61,6 +61,12 @@ let
     then import ../expand-response-params { inherit (buildPackages) stdenv; }
     else "";
 
+  useGccForLibs = isClang
+    && libcxx == null
+    && !(stdenv.targetPlatform.useLLVM or false)
+    && !(stdenv.targetPlatform.useAndroidPrebuilt or false)
+    && gccForLibs != null;
+
   # older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu
   isGccArchSupported = arch:
     if isGNU then
@@ -272,7 +278,7 @@ stdenv.mkDerivation {
     ##
     ## GCC libs for non-GCC support
     ##
-    + optionalString (isClang && libcxx == null && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs != null) ''
+    + optionalString useGccForLibs ''
 
       echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
       echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
@@ -316,11 +322,11 @@ stdenv.mkDerivation {
 
     # We have a libc++ directly, we have one via "smuggled" GCC, or we have one
     # bundled with the C compiler because it is GCC
-    + optionalString (libcxx != null || (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) ''
+    + optionalString (libcxx != null || (useGccForLibs && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) ''
       touch "$out/nix-support/libcxx-cxxflags"
       touch "$out/nix-support/libcxx-ldflags"
     ''
-    + optionalString (libcxx == null && (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false)) ''
+    + optionalString (libcxx == null && (useGccForLibs && gccForLibs.langCC or false)) ''
       for dir in ${gccForLibs}/include/c++/*; do
         echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
       done