forked from mirrors/nixpkgs
clang-wrapper: Remove explicit dependency on libc++
Now libc++ is just another build input propagated from clang-wrapper.
This commit is contained in:
parent
84a586fa9e
commit
1e6dfdf29c
|
@ -70,17 +70,11 @@ fi
|
||||||
doSubstitute() {
|
doSubstitute() {
|
||||||
local src=$1
|
local src=$1
|
||||||
local dst=$2
|
local dst=$2
|
||||||
local uselibcxx=
|
|
||||||
local uselibcxxabi=
|
|
||||||
if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi
|
|
||||||
if test -n "$libcxxabi" && echo $dst | fgrep ++; then uselibcxxabi=$libcxxabi; fi
|
|
||||||
# Can't use substitute() here, because replace may not have been
|
# Can't use substitute() here, because replace may not have been
|
||||||
# built yet (in the bootstrap).
|
# built yet (in the bootstrap).
|
||||||
sed \
|
sed \
|
||||||
-e "s^@out@^$out^g" \
|
-e "s^@out@^$out^g" \
|
||||||
-e "s^@shell@^$shell^g" \
|
-e "s^@shell@^$shell^g" \
|
||||||
-e "s^@libcxx@^$uselibcxx^g" \
|
|
||||||
-e "s^@libcxxabi@^$uselibcxxabi^g" \
|
|
||||||
-e "s^@clang@^$clang^g" \
|
-e "s^@clang@^$clang^g" \
|
||||||
-e "s^@clangProg@^$clangProg^g" \
|
-e "s^@clangProg@^$clangProg^g" \
|
||||||
-e "s^@binutils@^$binutils^g" \
|
-e "s^@binutils@^$binutils^g" \
|
||||||
|
@ -151,3 +145,5 @@ cp -p $utils $out/nix-support/utils.sh
|
||||||
if test -z "$nativeTools"; then
|
if test -z "$nativeTools"; then
|
||||||
echo $clang $binutils $libc > $out/nix-support/propagated-user-env-packages
|
echo $clang $binutils $libc > $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo $extraPackages > $out/nix-support/propagated-native-build-inputs
|
||||||
|
|
|
@ -79,11 +79,6 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
|
||||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty"
|
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "@libcxx@"; then
|
|
||||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1 -stdlib=libc++"
|
|
||||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -L@libcxxabi@/lib"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add the flags for the C compiler proper.
|
# Add the flags for the C compiler proper.
|
||||||
extraAfter=($NIX_CFLAGS_COMPILE)
|
extraAfter=($NIX_CFLAGS_COMPILE)
|
||||||
extraBefore=()
|
extraBefore=()
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||||
, clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
, clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
||||||
, zlib ? null, libcxx ? null
|
, zlib ? null, extraPackages ? []
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert nativeTools -> nativePrefix != "";
|
assert nativeTools -> nativePrefix != "";
|
||||||
|
@ -35,9 +35,7 @@ stdenv.mkDerivation {
|
||||||
utils = ../gcc-wrapper/utils.sh;
|
utils = ../gcc-wrapper/utils.sh;
|
||||||
addFlags = ./add-flags;
|
addFlags = ./add-flags;
|
||||||
|
|
||||||
inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx;
|
inherit nativeTools nativeLibc nativePrefix clang clangVersion extraPackages;
|
||||||
|
|
||||||
libcxxabi = libcxx.abi or null;
|
|
||||||
|
|
||||||
gcc = clang.gcc;
|
gcc = clang.gcc;
|
||||||
libc = if nativeLibc then null else libc;
|
libc = if nativeLibc then null else libc;
|
||||||
|
|
|
@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
|
||||||
# Remove a Makefile that causes many retained dependencies.
|
# Remove a Makefile that causes many retained dependencies.
|
||||||
postInstall = "rm $out/include/c++/v1/Makefile";
|
postInstall = "rm $out/include/c++/v1/Makefile";
|
||||||
|
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://libcxx.llvm.org/;
|
homepage = http://libcxx.llvm.org/;
|
||||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||||
|
|
2
pkgs/development/libraries/libc++/setup-hook.sh
Normal file
2
pkgs/development/libraries/libc++/setup-hook.sh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem @out@/include/c++/v1 -stdlib=libc++"
|
||||||
|
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -stdlib=libc++"
|
|
@ -28,11 +28,12 @@ import ../generic rec {
|
||||||
nativeTools = false;
|
nativeTools = false;
|
||||||
nativeLibc = true;
|
nativeLibc = true;
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
libcxx = if haveLibCxx then pkgs.libcxx.override {
|
extraPackages =
|
||||||
libcxxabi = pkgs.libcxxabi.override {
|
stdenv.lib.optional haveLibCxx (pkgs.libcxx.override {
|
||||||
libunwind = pkgs.libunwindNative;
|
libcxxabi = pkgs.libcxxabi.override {
|
||||||
};
|
libunwind = pkgs.libunwindNative;
|
||||||
} else null;
|
};
|
||||||
|
});
|
||||||
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
|
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
|
||||||
clang = if useClang33 then pkgs.clang_33.clang else pkgs.clang.clang;
|
clang = if useClang33 then pkgs.clang_33.clang else pkgs.clang.clang;
|
||||||
coreutils = pkgs.coreutils;
|
coreutils = pkgs.coreutils;
|
||||||
|
|
Loading…
Reference in a new issue