From ad486c48a66ee72283e37d6da52a5f74ae56413f Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 11 Sep 2017 20:44:32 +0200 Subject: [PATCH] llvm-packages: apply cc-wrapper/stdenv changes to older versions --- .../compilers/llvm/3.7/default.nix | 30 +++++++++++++++---- .../compilers/llvm/3.8/default.nix | 27 +++++++++++++---- .../compilers/llvm/3.9/default.nix | 27 +++++++++++++---- 3 files changed, 66 insertions(+), 18 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix index b7155defb43..432443e1a89 100644 --- a/pkgs/development/compilers/llvm/3.7/default.nix +++ b/pkgs/development/compilers/llvm/3.7/default.nix @@ -1,4 +1,7 @@ -{ newScope, stdenv, cmake, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }: +{ newScope, stdenv, libstdcxxHook, cmake, libxml2, python2, isl, fetchurl +, overrideCC, wrapCC, ccWrapperFun, darwin +}: + let callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl version fetch; }); @@ -22,20 +25,35 @@ let inherit clang-tools-extra_src stdenv; }; - clang = wrapCC self.clang-unwrapped; + clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; + + libstdcxxClang = ccWrapperFun { + cc = self.clang-unwrapped; + /* FIXME is this right? */ + inherit (stdenv.cc) libc nativeTools nativeLibc; + extraPackages = [ libstdcxxHook ]; + }; libcxxClang = ccWrapperFun { cc = self.clang-unwrapped; - isClang = true; - inherit (self) stdenv; /* FIXME is this right? */ inherit (stdenv.cc) libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; - stdenv = overrideCC stdenv self.clang; + stdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.clang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); - libcxxStdenv = overrideCC stdenv self.libcxxClang; + libcxxStdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.libcxxClang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); lldb = callPackage ./lldb.nix {}; diff --git a/pkgs/development/compilers/llvm/3.8/default.nix b/pkgs/development/compilers/llvm/3.8/default.nix index 04cd9f791e6..453d2c1f04b 100644 --- a/pkgs/development/compilers/llvm/3.8/default.nix +++ b/pkgs/development/compilers/llvm/3.8/default.nix @@ -1,4 +1,4 @@ -{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }: +{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -22,20 +22,35 @@ let inherit clang-tools-extra_src stdenv; }; - clang = wrapCC self.clang-unwrapped; + clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; + + libstdcxxClang = ccWrapperFun { + cc = self.clang-unwrapped; + /* FIXME is this right? */ + inherit (stdenv.cc) libc nativeTools nativeLibc; + extraPackages = [ libstdcxxHook ]; + }; libcxxClang = ccWrapperFun { cc = self.clang-unwrapped; - isClang = true; - inherit (self) stdenv; /* FIXME is this right? */ inherit (stdenv.cc) libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; - stdenv = overrideCC stdenv self.clang; + stdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.clang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); - libcxxStdenv = overrideCC stdenv self.libcxxClang; + libcxxStdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.libcxxClang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); lldb = callPackage ./lldb.nix {}; diff --git a/pkgs/development/compilers/llvm/3.9/default.nix b/pkgs/development/compilers/llvm/3.9/default.nix index a01e47efb75..755b417c78d 100644 --- a/pkgs/development/compilers/llvm/3.9/default.nix +++ b/pkgs/development/compilers/llvm/3.9/default.nix @@ -1,4 +1,4 @@ -{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }: +{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -22,20 +22,35 @@ let inherit clang-tools-extra_src stdenv; }; - clang = wrapCC self.clang-unwrapped; + clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang; + + libstdcxxClang = ccWrapperFun { + cc = self.clang-unwrapped; + /* FIXME is this right? */ + inherit (stdenv.cc) libc nativeTools nativeLibc; + extraPackages = [ libstdcxxHook ]; + }; libcxxClang = ccWrapperFun { cc = self.clang-unwrapped; - isClang = true; - inherit (self) stdenv; /* FIXME is this right? */ inherit (stdenv.cc) libc nativeTools nativeLibc; extraPackages = [ self.libcxx self.libcxxabi ]; }; - stdenv = overrideCC stdenv self.clang; + stdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.clang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); - libcxxStdenv = overrideCC stdenv self.libcxxClang; + libcxxStdenv = stdenv.override (drv: { + allowedRequisites = null; + cc = self.libcxxClang; + # Don't include the libc++ and libc++abi from the original stdenv. + extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF; + }); lldb = callPackage ./lldb.nix {};