Packaging llvm 3.4 for nixpkgs

Hi all,

I'm a maintainer for nixpkgs, the official package repository of the
nix[1] package manager, and I've just finished adding the packages that
make up the 3.4 release. Overall I am very impressed with your build
system (especially given the scope of the project), but there were a few
minor issues that I thought you might want to know about in case they
can be fixed for future releases.

In nixpkgs, we use llvm as a dependency of mesa (for gallium), and so we
needed to build llvm and clang separately so as not to require all X
users to build clang. In addition, to save space on systems that have
more than one package linked to llvm we build it with shared libraries
(nix allows us to do this safely even if multiple versions of llvm are
installed, see [1] for details). This combination required a few tweaks:

* Before running make for llvm, I had to set up a symlink from
  $prefix/lib pointing to $buildRoot/lib. This is because llvm-tablegen
  runs during the build, but its rpath points to $prefix/lib
* For lld and clang, I had to unpack the llvm source and point
  *_PATH_TO_LLVM_SOURCE appropriately, despite having a proper llvm
  install available in *_PATH_TO_LLVM_BUILD. Based on the comments in
  the cmake file, this should not be necessary
* I had to patch[2] llvm's source tree when building clang so that
  clang-tablegen would not try to build itself in llvm's sources
* I had to patch[3] clang-tools-extra to include a cmake library that I
  guess is normally included by the llvm build

There were several other small issues as well:

* I had to patch[4] polly, I'm guessing that build was never tested with
  CMAKE_CXX_FLAGS set (we set it to use -std=c++11)
* libc++abi depends on the libc++ source for a header, and libc++
  depends on the libc++abi build. Not a full circular dependency but
  annoying to have to unpack the libc++ sources for the libc++abi build
  and then again for the libc++ build
* libc++abi has a spurious -lstdc++ in its build script, which I patched
  out (to no ill effect) in order to avoid a dependency on libstdc++
* There is no official release for libc++abi
* There are no official installation instructions for libc++abi
* It would be nice to be able to build compiler-rt and clang-tools-extra
  separately from llvm and clang, respectively

Anyway, I'm writing this not to complain but to let you know about the
issues. If there's any way I can help improve things, please let me

Shea Levy