From e3f2e2e10b8cf2065800358a90ef04ea41e708eb Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Sat, 7 Sep 2013 11:03:26 +0200 Subject: [PATCH] libcxx: Update to 190100 and build with libc++abi. --- pkgs/development/libraries/libc++/default.nix | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libc++/default.nix b/pkgs/development/libraries/libc++/default.nix index bed953119151..1d4ef158113a 100644 --- a/pkgs/development/libraries/libc++/default.nix +++ b/pkgs/development/libraries/libc++/default.nix @@ -1,19 +1,43 @@ -{ stdenv, fetchsvn, cmake }: +{ stdenv, fetchsvn, cmake, libunwind }: -let rev = "165151"; in +let rev = "190100"; in -stdenv.mkDerivation { +stdenv.mkDerivation rec { name = "libc++-pre${rev}"; src = fetchsvn { url = "http://llvm.org/svn/llvm-project/libcxx/trunk"; inherit rev; - sha256 = "00l8xx5nc3cjlmln7c1sy1i4v844has9kbfxrsziwkalzbgwaslz"; + sha256 = "0hnfvzzrkj797kp9sk2yncvbmiyx0d72k8bys3z7l6i47d37xv03"; + }; + + cxxabi = fetchsvn { + url = "http://llvm.org/svn/llvm-project/libcxxabi/trunk"; + inherit rev; + sha256 = "1kdyvngwd229cgmcqpawaf0qizas8bqc0g8s08fmbgwsrh1qrryp"; }; buildInputs = [ cmake ]; - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; + preConfigure = '' + sed -i 's/;cxa_demangle.h//' CMakeLists.txt + cp -R ${cxxabi} cxxabi + chmod u+w -R cxxabi # umm + (export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include"; + export NIX_CFLAGS_LINK="-L${libunwind}/lib -lunwind"; + cd cxxabi/lib + sed -e s,-lstdc++,, -i buildit # do not link to libstdc++! + ./buildit + mkdir -p $out/lib && cp libc++abi.so.1.0 $out/lib + cd $out/lib + ln -s libc++abi.so.1.0 libc++abi.so + ln -s libc++abi.so.1.0 libc++abi.so.1) + ''; + + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" + "-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${cxxabi}/include" + "-DLIBCXX_CXX_ABI=libcxxabi" ]; + buildPhase = ''NIX_CFLAGS_LINK="-L$out/lib -lc++abi" make''; enableParallelBuilding = true;