Merge pull request #33042 from obsidiansystems/darwin-cxx

darwin stdenv: Make stdenv.cc, not stdenv itself, bring in libcxx
This commit is contained in:
John Ericson 2017-12-26 10:54:59 -08:00 committed by GitHub
commit 696f3e702d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 25 deletions

View File

@ -44,15 +44,11 @@ let
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 = 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 {};

View File

@ -41,15 +41,11 @@ let
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 = 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 {};

View File

@ -41,15 +41,11 @@ let
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 = 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 {};

View File

@ -56,15 +56,11 @@ let
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 = 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;
});
lld = callPackage ./lld.nix {};

View File

@ -56,15 +56,11 @@ let
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 = 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;
});
lld = callPackage ./lld.nix {};

View File

@ -58,6 +58,7 @@ in rec {
extraPreHook ? "",
extraNativeBuildInputs,
extraBuildInputs,
libcxx,
allowedRequisites ? null}:
let
buildPackages = lib.optionalAttrs (last ? stdenv) {
@ -82,6 +83,8 @@ in rec {
inherit shell;
inherit (last) stdenvNoCC;
extraPackages = lib.optional (libcxx != null) libcxx;
nativeTools = false;
nativeLibc = false;
inherit buildPackages coreutils gnugrep bintools;
@ -176,6 +179,7 @@ in rec {
extraNativeBuildInputs = [];
extraBuildInputs = [];
libcxx = null;
};
stage1 = prevStage: let
@ -183,7 +187,8 @@ in rec {
in with prevStage; stageFun 1 prevStage {
extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
extraNativeBuildInputs = [];
extraBuildInputs = [ pkgs.libcxx ];
extraBuildInputs = [ ];
libcxx = pkgs.libcxx;
allowedRequisites =
[ bootstrapTools ] ++ (with pkgs; [ libcxx libcxxabi ]) ++ [ pkgs.darwin.Libsystem ];
@ -210,7 +215,8 @@ in rec {
'';
extraNativeBuildInputs = [ pkgs.xz ];
extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
extraBuildInputs = [ pkgs.darwin.CF ];
libcxx = pkgs.libcxx;
allowedRequisites =
[ bootstrapTools ] ++
@ -242,7 +248,8 @@ in rec {
# and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
# patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
extraBuildInputs = [ pkgs.darwin.CF ];
libcxx = pkgs.libcxx;
extraPreHook = ''
export PATH=${pkgs.bash}/bin:$PATH
@ -277,7 +284,9 @@ in rec {
in with prevStage; stageFun 4 prevStage {
shell = "${pkgs.bash}/bin/bash";
extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
extraBuildInputs = [ pkgs.darwin.CF ];
libcxx = pkgs.libcxx;
extraPreHook = ''
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
'';
@ -347,10 +356,11 @@ in rec {
cc = pkgs.llvmPackages.clang-unwrapped;
bintools = pkgs.darwin.binutils;
libc = pkgs.darwin.Libsystem;
extraPackages = [ pkgs.libcxx ];
};
extraNativeBuildInputs = [];
extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
extraBuildInputs = [ pkgs.darwin.CF ];
extraAttrs = {
inherit platform bootstrapTools;