about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2019-05-14 14:22:39 -0500
committerAustin Seipp <aseipp@pobox.com>2019-05-14 14:23:22 -0500
commitde1110d5356059fbbff326e269b0c61bf65ae6a2 (patch)
treeb2a4ede473b00ce4a0ae68305b4952967423bd1d /pkgs/development/compilers/llvm
parent562a4752580d3639c09ef00f6fb9d5edeb11ebde (diff)
downloadnixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar.gz
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar.bz2
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar.lz
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar.xz
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.tar.zst
nixlib-de1110d5356059fbbff326e269b0c61bf65ae6a2.zip
pkgs: remove llvm_37
These expressions are now unused, and can be removed to lighten the load
on build machines.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/3.7/clang/default.nix60
-rw-r--r--pkgs/development/compilers/llvm/3.7/clang/purity.patch17
-rw-r--r--pkgs/development/compilers/llvm/3.7/default.nix59
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/darwin.patch30
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/default.nix48
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/r242056.patch16
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh6
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch17
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++abi.nix61
-rw-r--r--pkgs/development/compilers/llvm/3.7/lldb.nix49
-rw-r--r--pkgs/development/compilers/llvm/3.7/llvm.nix105
11 files changed, 0 insertions, 468 deletions
diff --git a/pkgs/development/compilers/llvm/3.7/clang/default.nix b/pkgs/development/compilers/llvm/3.7/clang/default.nix
deleted file mode 100644
index 4ccd00af6846..000000000000
--- a/pkgs/development/compilers/llvm/3.7/clang/default.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src }:
-
-let
-  gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
-  self = stdenv.mkDerivation {
-    name = "clang-${version}";
-
-    unpackPhase = ''
-      unpackFile ${fetch "cfe" "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"}
-      mv cfe-${version}.src clang
-      sourceRoot=$PWD/clang
-      unpackFile ${clang-tools-extra_src}
-      mv clang-tools-extra-* $sourceRoot/tools/extra
-    '';
-
-    buildInputs = [ cmake libxml2 llvm ];
-
-    cmakeFlags = [
-      "-DCMAKE_CXX_FLAGS=-std=c++11"
-    ] ++
-    # Maybe with compiler-rt this won't be needed?
-    (stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
-    (stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
-
-    patches = [ ./purity.patch ];
-
-    postPatch = ''
-      sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
-      sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
-    '';
-
-    # Clang expects to find LLVMgold in its own prefix
-    # Clang expects to find sanitizer libraries in its own prefix
-    postInstall = ''
-      if [ -e ${llvm}/lib/LLVMgold.so ]; then
-        ln -sv ${llvm}/lib/LLVMgold.so $out/lib
-      fi
-
-      ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
-      ln -sv $out/bin/clang $out/bin/cpp
-    '';
-
-    enableParallelBuilding = true;
-
-    passthru = {
-      lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
-      isClang = true;
-      inherit llvm;
-    } // stdenv.lib.optionalAttrs stdenv.isLinux {
-      inherit gcc;
-    };
-
-    meta = {
-      description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
-      homepage    = http://llvm.org/;
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
-    };
-  };
-in self
diff --git a/pkgs/development/compilers/llvm/3.7/clang/purity.patch b/pkgs/development/compilers/llvm/3.7/clang/purity.patch
deleted file mode 100644
index ee73b26eb5ce..000000000000
--- a/pkgs/development/compilers/llvm/3.7/clang/purity.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/lib/Driver/Tools.cpp	2015-07-31 00:47:41.000000000 +0200
-+++ b/lib/Driver/Tools.cpp	2015-09-11 21:30:50.057895565 +0200
-@@ -8150,15 +8150,6 @@
-     CmdArgs.push_back("-shared");
-   }
- 
--  if (Arch == llvm::Triple::arm || Arch == llvm::Triple::armeb ||
--      Arch == llvm::Triple::thumb || Arch == llvm::Triple::thumbeb ||
--      (!Args.hasArg(options::OPT_static) &&
--       !Args.hasArg(options::OPT_shared))) {
--    CmdArgs.push_back("-dynamic-linker");
--    CmdArgs.push_back(Args.MakeArgString(
--        D.DyldPrefix + getLinuxDynamicLinker(Args, ToolChain)));
--  }
--
-   CmdArgs.push_back("-o");
-   CmdArgs.push_back(Output.getFilename());
diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix
deleted file mode 100644
index 3c557711449f..000000000000
--- a/pkgs/development/compilers/llvm/3.7/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ newScope, stdenv, libstdcxxHook, isl, fetchurl
-, overrideCC, wrapCCWith
-, buildLlvmTools # tools, but from the previous stage, for cross
-, targetLlvmLibraries # libraries, but from the next stage, for cross
-}:
-
-let
-  version = "3.7.1";
-
-  fetch = fetch_v version;
-  fetch_v = ver: name: sha256: fetchurl {
-    url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
-    inherit sha256;
-  };
-
-  compiler-rt_src = fetch "compiler-rt" "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx";
-  clang-tools-extra_src = fetch "clang-tools-extra" "0sxw2l3q5msbrwxv1ck72arggdw6n5ysi929gi69ikniranfv4aa";
-
-  tools = stdenv.lib.makeExtensible (tools: let
-    callPackage = newScope (tools // { inherit stdenv isl version fetch; });
-  in {
-    llvm = callPackage ./llvm.nix {
-      inherit compiler-rt_src;
-      inherit (targetLlvmLibraries) libcxxabi;
-    };
-
-    clang-unwrapped = callPackage ./clang {
-      inherit clang-tools-extra_src;
-    };
-
-    clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
-
-    libstdcxxClang = wrapCCWith {
-      cc = tools.clang-unwrapped;
-      extraPackages = [ libstdcxxHook ];
-    };
-
-    libcxxClang = wrapCCWith {
-      cc = tools.clang-unwrapped;
-      extraPackages = [ targetLlvmLibraries.libcxx targetLlvmLibraries.libcxxabi ];
-    };
-
-    lldb = callPackage ./lldb.nix {};
-  });
-
-  libraries = stdenv.lib.makeExtensible (libraries: let
-    callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv isl version fetch; });
-  in {
-
-    stdenv = overrideCC stdenv buildLlvmTools.clang;
-
-    libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
-
-    libcxx = callPackage ./libc++ {};
-
-    libcxxabi = callPackage ./libc++abi.nix {};
-  });
-
-in { inherit tools libraries; } // libraries // tools
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/darwin.patch b/pkgs/development/compilers/llvm/3.7/libc++/darwin.patch
deleted file mode 100644
index bf83f169cfc3..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++/darwin.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
---- libcxx-3.4.2.src-orig/lib/CMakeLists.txt	2013-11-15 18:18:57.000000000 +0100
-+++ libcxx-3.4.2.src/lib/CMakeLists.txt	2014-09-24 14:04:01.000000000 +0200
-@@ -56,7 +56,7 @@
-       "-compatibility_version 1"
-       "-current_version ${LIBCXX_VERSION}"
-       "-install_name /usr/lib/libc++.1.dylib"
--      "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
-+      "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
-       "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
-       "/usr/lib/libSystem.B.dylib")
-   else()
-@@ -64,14 +64,14 @@
-       list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
-       if (OSX_HAS_ARMV7)
-         set(OSX_RE_EXPORT_LINE
--          "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
-+          "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
-           "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
-       else()
-         set(OSX_RE_EXPORT_LINE
--          "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
-+          "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
-       endif()
-     else()
--      set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
-+      set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
-     endif()
- 
-     list(APPEND link_flags
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/default.nix b/pkgs/development/compilers/llvm/3.7/libc++/default.nix
deleted file mode 100644
index 7b7ac7297ba3..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++/default.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ lib, stdenv, fetch, cmake, libcxxabi, fixDarwinDylibNames, version }:
-
-stdenv.mkDerivation rec {
-  name = "libc++-${version}";
-
-  src = fetch "libcxx" "0i7iyzk024krda5spfpfi8jksh83yp3bxqkal0xp76ffi11bszrm";
-
-  postUnpack = ''
-    unpackFile ${libcxxabi.src}
-  '';
-
-  preConfigure = ''
-    # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
-    cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
-  '';
-
-  patches = [
-    ./darwin.patch
-    ./r242056.patch
-    # glibc 2.26 fix
-    ./xlocale-glibc-2.26.patch
-  ];
-
-  buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
-
-  cmakeFlags = [
-    "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
-    "-DLIBCXX_LIBCPPABI_VERSION=2"
-    "-DLIBCXX_CXX_ABI=libcxxabi"
-  ];
-
-  enableParallelBuilding = true;
-
-  linkCxxAbi = stdenv.isLinux;
-
-  setupHooks = [
-    ../../../../../build-support/setup-hooks/role.bash
-    ./setup-hook.sh
-  ];
-
-  meta = {
-    homepage = http://libcxx.llvm.org/;
-    description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.unix;
-    badPlatforms = [ "x86_64-darwin" ];
-  };
-}
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/r242056.patch b/pkgs/development/compilers/llvm/3.7/libc++/r242056.patch
deleted file mode 100644
index 96245e76653a..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++/r242056.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/include/string	2015/07/13 20:04:56	242056
-+++ b/include/string	2015/07/18 20:40:46	242623
-@@ -1936,7 +1936,12 @@
- template <class _CharT, class _Traits, class _Allocator>
- inline _LIBCPP_INLINE_VISIBILITY
- basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
--    : __r_(__a)
-+#if _LIBCPP_STD_VER <= 14
-+        _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
-+#else
-+        _NOEXCEPT
-+#endif
-+: __r_(__a)
- {
- #if _LIBCPP_DEBUG_LEVEL >= 2
-     __get_db()->__insert_c(this);
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh
deleted file mode 100644
index 6611259165ae..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# See pkgs/build-support/setup-hooks/role.bash
-getHostRole
-
-linkCxxAbi="@linkCxxAbi@"
-export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
-export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch b/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch
deleted file mode 100644
index 5ee8f6b82305..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++/xlocale-glibc-2.26.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/include/__locale b/include/__locale
-index 1989558..1e42905 100644
---- a/include/__locale
-+++ b/include/__locale
-@@ -34,10 +34,10 @@
- # include <support/solaris/xlocale.h>
- #elif defined(_NEWLIB_VERSION)
- # include <support/newlib/xlocale.h>
--#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
-+#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
-     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
- # include <xlocale.h>
--#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
-+#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
- 
- #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
- #pragma GCC system_header
diff --git a/pkgs/development/compilers/llvm/3.7/libc++abi.nix b/pkgs/development/compilers/llvm/3.7/libc++abi.nix
deleted file mode 100644
index 2c79d7b3b1b5..000000000000
--- a/pkgs/development/compilers/llvm/3.7/libc++abi.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ stdenv, cmake, fetch, fetchpatch, libcxx, libunwind, llvm, version }:
-
-let
-  # Newer LLVMs (3.8 onwards) have changed how some basic C++ stuff works, which breaks builds of this older version
-  llvm38-and-above = fetchpatch {
-    url    = "https://trac.macports.org/raw-attachment/ticket/50304/0005-string-Fix-exception-declaration.patch";
-    sha256 = "1lm38n7s0l5dbl7kp4i49pvzxz1mcvlr2vgsnj47agnwhhm63jvr";
-  };
-in stdenv.mkDerivation {
-  name = "libc++abi-${version}";
-
-  src = fetch "libcxxabi" "0ambfcmr2nh88hx000xb7yjm9lsqjjz49w5mlf6dlxzmj3nslzx4";
-
-  nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
-
-  postUnpack = ''
-    unpackFile ${libcxx.src}
-    unpackFile ${llvm.src}
-    export NIX_CFLAGS_COMPILE+=" -I$PWD/include"
-    export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    export TRIPLE=x86_64-apple-darwin
-  '';
-
-  # I can't use patches directly because this is actually a patch for libc++'s source, which we manually extract
-  # into the libc++abi build environment above.
-  prePatch = ''(
-    cd ../libcxx-*
-    patch -p1 < ${llvm38-and-above}
-  )'';
-
-  installPhase = if stdenv.isDarwin
-    then ''
-      for file in lib/*.dylib; do
-        # this should be done in CMake, but having trouble figuring out
-        # the magic combination of necessary CMake variables
-        # if you fancy a try, take a look at
-        # http://www.cmake.org/Wiki/CMake_RPATH_handling
-        install_name_tool -id $out/$file $file
-      done
-      make install
-      install -d 755 $out/include
-      install -m 644 ../include/*.h $out/include
-    ''
-    else ''
-      install -d -m 755 $out/include $out/lib
-      install -m 644 lib/libc++abi.so.1.0 $out/lib
-      install -m 644 ../include/cxxabi.h $out/include
-      ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
-      ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
-    '';
-
-  meta = {
-    homepage = http://libcxxabi.llvm.org/;
-    description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/3.7/lldb.nix b/pkgs/development/compilers/llvm/3.7/lldb.nix
deleted file mode 100644
index 294410f99869..000000000000
--- a/pkgs/development/compilers/llvm/3.7/lldb.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ stdenv
-, fetch
-, cmake
-, zlib
-, ncurses
-, swig
-, which
-, libedit
-, llvm
-, clang-unwrapped
-, python2
-, version
-}:
-
-stdenv.mkDerivation {
-  name = "lldb-${version}";
-
-  src = fetch "lldb" "008fdbyza13ym3v0xpans4z4azw4y16hcbgrrnc4rx2mxwaw62ws";
-
-  patchPhase = ''
-    sed -i 's|/usr/bin/env||' \
-      scripts/Python/finish-swig-Python-LLDB.sh \
-      scripts/Python/build-swig-Python.sh
-  '';
-
-  buildInputs = [ cmake python2 which swig ncurses zlib libedit ];
-
-  preConfigure = ''
-    export CXXFLAGS="-pthread"
-    export LDFLAGS="-ldl"
-  '';
-
-  cmakeFlags = [
-    "-DLLDB_PATH_TO_LLVM_BUILD=${llvm}"
-    "-DLLDB_PATH_TO_CLANG_BUILD=${clang-unwrapped}"
-    "-DPYTHON_VERSION_MAJOR=2"
-    "-DPYTHON_VERSION_MINOR=7"
-    "-DLLDB_DISABLE_LIBEDIT=1" # https://llvm.org/bugs/show_bug.cgi?id=28898
-  ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "A next-generation high-performance debugger";
-    homepage    = http://llvm.org/;
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix
deleted file mode 100644
index a6fd18f94d68..000000000000
--- a/pkgs/development/compilers/llvm/3.7/llvm.nix
+++ /dev/null
@@ -1,105 +0,0 @@
-{ stdenv
-, fetch
-, fetchpatch
-, perl
-, groff
-, cmake
-, python2
-, libffi
-, libbfd
-, libxml2
-, ncurses
-, version
-, zlib
-, compiler-rt_src
-, libcxxabi
-, debugVersion ? false
-, enableSharedLibraries ? !stdenv.isDarwin
-}:
-
-let
-  src = fetch "llvm" "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy";
-in stdenv.mkDerivation rec {
-  name = "llvm-${version}";
-
-  unpackPhase = ''
-    unpackFile ${src}
-    mv llvm-${version}.src llvm
-    sourceRoot=$PWD/llvm
-    unpackFile ${compiler-rt_src}
-    mv compiler-rt-* $sourceRoot/projects/compiler-rt
-  '';
-
-  buildInputs = [ perl groff cmake libxml2 python2 libffi ]
-    ++ stdenv.lib.optional stdenv.isDarwin libcxxabi;
-
-  propagatedBuildInputs = [ ncurses zlib ];
-
-  # The goal here is to disable LLVM bindings (currently go and ocaml) regardless
-  # of whether the impure CMake search sheananigans find the compilers in global
-  # paths. This mostly exists because sandbox builds don't work very well on Darwin
-  # and sometimes you get weird behavior if CMake finds go in your system path.
-  # This would be far prettier if there were a CMake option to just disable bindings
-  # but from what I can tell, there isn't such a thing. The file in question only
-  # contains `if(WIN32)` conditions to check whether to disable bindings, so making
-  # those always succeed has the net effect of disabling all bindings.
-  prePatch = ''
-    substituteInPlace cmake/config-ix.cmake --replace "if(WIN32)" "if(1)"
-  ''
-  + stdenv.lib.optionalString (stdenv ? glibc) ''
-    (
-      cd projects/compiler-rt
-      patch -p1 < ${
-        fetchpatch {
-          name = "sigaltstack.patch"; # for glibc-2.26
-          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
-          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
-        }
-      }
-    )
-  '';
-
-  # hacky fix: created binaries need to be run before installation
-  preBuild = ''
-    mkdir -p $out/
-    ln -sv $PWD/lib $out
-  '';
-
-  patches = stdenv.lib.optionals (!stdenv.isDarwin) [
-    # llvm-config --libfiles returns (non-existing) static libs
-    ../fix-llvm-config.patch
-  ];
-
-  cmakeFlags = with stdenv; [
-    "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
-    "-DLLVM_INSTALL_UTILS=ON"  # Needed by rustc
-    "-DLLVM_BUILD_TESTS=ON"
-    "-DLLVM_ENABLE_FFI=ON"
-    "-DLLVM_ENABLE_RTTI=ON"
-  ] ++ stdenv.lib.optional enableSharedLibraries
-    "-DBUILD_SHARED_LIBS=ON"
-    ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
-    ++ stdenv.lib.optionals ( isDarwin) [
-    "-DLLVM_ENABLE_LIBCXX=ON"
-    "-DCAN_TARGET_i386=false"
-  ];
-
-  NIX_LDFLAGS = "-lpthread"; # no idea what's the problem
-
-  postBuild = ''
-    rm -fR $out
-  '';
-
-  enableParallelBuilding = true;
-
-  passthru.src = src;
-
-  meta = {
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    homepage    = http://llvm.org/;
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin ];
-    platforms   = stdenv.lib.platforms.all;
-  };
-}