2014-09-24 13:43:05 +01:00
|
|
|
{ lib, stdenv, fetchurl, cmake, libcxxabi, fixDarwinDylibNames }:
|
2012-10-08 07:32:09 +01:00
|
|
|
|
2015-08-17 11:02:17 +01:00
|
|
|
let version = "3.5.2"; in
|
2012-10-08 07:32:09 +01:00
|
|
|
|
2014-09-24 12:15:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
Add full llvm build, update libc++ and dragonegg
Some packages in the llvm suite (e.g. compiler-rt) cannot be built
separate from the build of llvm, and while some others (e.g. clang) can
the combined build is much better tested (we've had to work around
annoying issues before). So this puts llvm, clang, clang-tools-extra,
compiler-rt, lld, lldb, and polly all into one big build (llvmFull).
This build includes a static llvm, as dynamic is similarly less tested
and has known failures.
This also updates libc++ and dragonegg. libc++ now builds against
libc++abi as a separate package rather than building it during the
libc++ build.
The clang purity patch is gone. Instead, we simply set --sysroot to
/var/empty for pure builds, as all impure paths are either looked up in
the gcc prefix (which we hard-code at compile time) or in the sysroot.
This also means that if NIX_ENFORCE_PURITY is 0 then clang will look in
the normal Linux paths by default, which is the proper behavior IMO.
polly required an updated isl. When stdenv-updates is merged, perhaps we
can update the isl used by gcc and avoid having two versions.
Since llvm on its own is now separate from the llvm used by clang, I've
removed myself as maintainer from llvm and will leave maintenance of
that to those who are interested in llvm separate from clang.
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-20 10:23:17 +00:00
|
|
|
name = "libc++-${version}";
|
2012-10-08 07:32:09 +01:00
|
|
|
|
Add full llvm build, update libc++ and dragonegg
Some packages in the llvm suite (e.g. compiler-rt) cannot be built
separate from the build of llvm, and while some others (e.g. clang) can
the combined build is much better tested (we've had to work around
annoying issues before). So this puts llvm, clang, clang-tools-extra,
compiler-rt, lld, lldb, and polly all into one big build (llvmFull).
This build includes a static llvm, as dynamic is similarly less tested
and has known failures.
This also updates libc++ and dragonegg. libc++ now builds against
libc++abi as a separate package rather than building it during the
libc++ build.
The clang purity patch is gone. Instead, we simply set --sysroot to
/var/empty for pure builds, as all impure paths are either looked up in
the gcc prefix (which we hard-code at compile time) or in the sysroot.
This also means that if NIX_ENFORCE_PURITY is 0 then clang will look in
the normal Linux paths by default, which is the proper behavior IMO.
polly required an updated isl. When stdenv-updates is merged, perhaps we
can update the isl used by gcc and avoid having two versions.
Since llvm on its own is now separate from the llvm used by clang, I've
removed myself as maintainer from llvm and will leave maintenance of
that to those who are interested in llvm separate from clang.
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-20 10:23:17 +00:00
|
|
|
src = fetchurl {
|
2015-02-03 22:02:59 +00:00
|
|
|
url = "http://llvm.org/releases/${version}/libcxx-${version}.src.tar.xz";
|
2015-08-17 11:02:17 +01:00
|
|
|
sha256 = "0irnl54fwzh2hzn9x4jfvnfyq5kd0zn0iwbzdivgwhqzw6fjdwdv";
|
2013-09-07 10:03:26 +01:00
|
|
|
};
|
|
|
|
|
2015-02-03 22:02:59 +00:00
|
|
|
# instead of allowing libc++ to link with /usr/lib/libc++abi.dylib,
|
|
|
|
# force it to link with our copy
|
|
|
|
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace lib/CMakeLists.txt \
|
|
|
|
--replace 'OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib' \
|
|
|
|
'OSX_RE_EXPORT_LINE "${libcxxabi}/lib/libc++abi.dylib' \
|
|
|
|
--replace '"''${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"' \
|
|
|
|
'"${libcxxabi}/lib/libc++abi.dylib"'
|
|
|
|
'';
|
|
|
|
|
2017-11-08 21:01:20 +00:00
|
|
|
patches = [
|
|
|
|
./darwin.patch
|
|
|
|
# glibc 2.26 fix
|
|
|
|
./xlocale-glibc-2.26.patch
|
|
|
|
];
|
2013-09-07 10:03:26 +01:00
|
|
|
|
2014-09-24 13:43:05 +01:00
|
|
|
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
2016-08-25 22:11:27 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
|
|
|
|
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
|
|
|
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
|
|
|
"-DLIBCXX_CXX_ABI=libcxxabi"
|
|
|
|
];
|
2012-10-08 07:32:09 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-07-27 22:25:34 +01:00
|
|
|
linkCxxAbi = stdenv.isLinux;
|
|
|
|
|
2018-05-07 18:07:19 +01:00
|
|
|
setupHooks = [
|
|
|
|
../../../../../build-support/setup-hooks/role.bash
|
|
|
|
./setup-hook.sh
|
|
|
|
];
|
2014-09-24 16:55:05 +01:00
|
|
|
|
2012-10-08 07:32:09 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://libcxx.llvm.org/;
|
|
|
|
description = "A new implementation of the C++ standard library, targeting C++11";
|
2017-02-11 22:13:29 +00:00
|
|
|
license = with stdenv.lib.licenses; [ ncsa mit ];
|
2014-08-22 00:15:31 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2012-10-08 07:32:09 +01:00
|
|
|
};
|
|
|
|
}
|