@@ -11,7 +11,6 @@
1111, version
1212, release_version
1313, zlib
14−, compiler-rt_src
1514, libcxxabi
1615, debugVersion ? false
1716, enableManpages ? false
@@ -33,8 +32,6 @@ in stdenv.mkDerivation (rec {
3332 unpackFile ${src}
3433 mv llvm-${version}* llvm
3534 sourceRoot=$PWD/llvm
36− unpackFile ${compiler-rt_src}
37− mv compiler-rt-* $sourceRoot/projects/compiler-rt
3835 '';
3936
4037 outputs = [ "out" "python" ]
@@ -48,15 +45,7 @@ in stdenv.mkDerivation (rec {
4845
4946 propagatedBuildInputs = [ ncurses zlib ];
5047
51− # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
52− # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
53− # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
54− # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
55− # a flag and turn the flag off during the stdenv build.
5648 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
57− substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \
58− --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
59−
6049 substituteInPlace cmake/modules/AddLLVM.cmake \
6150 --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir INSTALL_NAME_DIR "$lib/lib")" \
6251 --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
@@ -70,15 +59,11 @@ in stdenv.mkDerivation (rec {
7059 substituteInPlace unittests/Support/CMakeLists.txt \
7160 --replace "Path.cpp" ""
7261 rm unittests/Support/Path.cpp
73−
74− # Revert compiler-rt commit that makes codesign mandatory
75− patch -p1 -i ${./compiler-rt-codesign.patch} -d projects/compiler-rt
7662 '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
7763 patch -p1 -i ${../TLI-musl.patch}
7864 substituteInPlace unittests/Support/CMakeLists.txt \
7965 --replace "add_subdirectory(DynamicLibrary)" ""
8066 rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
81− patch -p1 -i ${./sanitizers-nongnu.patch} -d projects/compiler-rt
8267 '';
8368
8469 # hacky fix: created binaries need to be run before installation
@@ -93,7 +78,6 @@ in stdenv.mkDerivation (rec {
9378 "-DLLVM_BUILD_TESTS=ON"
9479 "-DLLVM_ENABLE_FFI=ON"
9580 "-DLLVM_ENABLE_RTTI=ON"
96− "-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code
9781 ]
9882 ++ stdenv.lib.optional enableSharedLibraries
9983 "-DLLVM_LINK_LLVM_DYLIB=ON"