From 92f96f47b05543074e61f1879769d52aa3ddfe66 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 17 Jun 2020 20:33:56 +0000 Subject: treewide: Get rid of `cc.gcc` Instead, we have a new `gccForLibs`, which has the appropriate definition for e.g. avoiding `x86_32` linking problems. --- pkgs/build-support/cc-wrapper/default.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 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 1fef3c45908..774567f9247 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -8,6 +8,7 @@ { name ? "" , 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 @@ -262,11 +263,11 @@ stdenv.mkDerivation { ## ## GCC libs for non-GCC support ## - + optionalString (isClang && libcxx == null && cc ? gcc) '' + + optionalString (isClang && libcxx == null && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs != null) '' - echo "-B${cc.gcc}/lib/gcc/${targetPlatform.config}/${cc.gcc.version}" >> $out/nix-support/cc-cflags - echo "-L${cc.gcc}/lib/gcc/${targetPlatform.config}/${cc.gcc.version}" >> $out/nix-support/cc-ldflags - echo "-L${cc.gcc.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags + 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 + echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags '' ## @@ -306,14 +307,15 @@ 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 || cc.gcc.langCC or false || (isGNU && cc.langCC or false)) '' + + optionalString (libcxx != null || (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) '' touch "$out/nix-support/libcxx-cxxflags" touch "$out/nix-support/libcxx-ldflags" - '' + optionalString (libcxx == null && cc ? gcc) '' - for dir in ${cc.gcc}/include/c++/*; do + '' + + optionalString (libcxx == null && (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false)) '' + for dir in ${gccForLibs}/include/c++/*; do echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags done - for dir in ${cc.gcc}/include/c++/*/${targetPlatform.config}; do + for dir in ${gccForLibs}/include/c++/*/${targetPlatform.config}; do echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags done '' -- cgit 1.4.1