From be02229f0684a2de32f8e2f38db72b616219ef2b Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 25 Oct 2016 10:29:40 -0400 Subject: [PATCH] Add libcxxStdenv attribute to recent llvm package sets --- pkgs/development/compilers/llvm/3.7/default.nix | 13 ++++++++++++- pkgs/development/compilers/llvm/3.8/default.nix | 13 ++++++++++++- pkgs/development/compilers/llvm/3.9/default.nix | 13 ++++++++++++- pkgs/top-level/all-packages.nix | 6 ++++-- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix index d7864d11d7bf..3df20086f79b 100644 --- a/pkgs/development/compilers/llvm/3.7/default.nix +++ b/pkgs/development/compilers/llvm/3.7/default.nix @@ -1,4 +1,4 @@ -{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC }: +{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -24,8 +24,19 @@ let clang = wrapCC self.clang-unwrapped; + 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; + libcxxStdenv = overrideCC stdenv self.libcxxClang; + lldb = callPackage ./lldb.nix {}; libcxx = callPackage ./libc++ {}; diff --git a/pkgs/development/compilers/llvm/3.8/default.nix b/pkgs/development/compilers/llvm/3.8/default.nix index df1a775ef968..04cd9f791e62 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 }: +{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -24,8 +24,19 @@ let clang = wrapCC self.clang-unwrapped; + 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; + libcxxStdenv = overrideCC stdenv self.libcxxClang; + lldb = callPackage ./lldb.nix {}; libcxx = callPackage ./libc++ {}; diff --git a/pkgs/development/compilers/llvm/3.9/default.nix b/pkgs/development/compilers/llvm/3.9/default.nix index 17351ae87366..49fdad931b69 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 }: +{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }: let callPackage = newScope (self // { inherit stdenv isl version fetch; }); @@ -24,8 +24,19 @@ let clang = wrapCC self.clang-unwrapped; + 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; + libcxxStdenv = overrideCC stdenv self.libcxxClang; + lldb = callPackage ./lldb.nix {}; libcxx = callPackage ./libc++ {}; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 146e13c21e32..4402d1697638 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4520,7 +4520,7 @@ in #Use this instead of stdenv to build with clang clangStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.stdenv; - libcxxStdenv = stdenvAdapters.overrideCC stdenv (clangWrapSelf llvmPackages.clang-unwrapped); + libcxxStdenv = lowPrio llvmPackages.libcxxStdenv; clean = callPackage ../development/compilers/clean { }; @@ -5247,7 +5247,9 @@ in inherit libc extraBuildCommands; }; - wrapCC = wrapCCWith (callPackage ../build-support/cc-wrapper) stdenv.cc.libc ""; + ccWrapperFun = callPackage ../build-support/cc-wrapper; + + wrapCC = wrapCCWith ccWrapperFun stdenv.cc.libc ""; # legacy version, used for gnat bootstrapping wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old { nativeTools = stdenv.cc.nativeTools or false;