summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/compilers/llvm/clang-tablegen-dir.patch9
-rw-r--r--pkgs/development/compilers/llvm/clang.nix3
2 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/development/compilers/llvm/clang-tablegen-dir.patch b/pkgs/development/compilers/llvm/clang-tablegen-dir.patch
new file mode 100644
index 00000000000..de6a468b239
--- /dev/null
+++ b/pkgs/development/compilers/llvm/clang-tablegen-dir.patch
@@ -0,0 +1,9 @@
+--- a/utils/TableGen/CMakeLists.txt       (revision 190146)
++++ b/utils/TableGen/CMakeLists.txt       (working copy)
+@@ -1,4 +1,5 @@
+ set(LLVM_LINK_COMPONENTS Support)
++set(LLVM_TOOLS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ 
+ add_tablegen(clang-tblgen CLANG
+   ClangASTNodesEmitter.cpp
+
diff --git a/pkgs/development/compilers/llvm/clang.nix b/pkgs/development/compilers/llvm/clang.nix
index df58591973e..8c178c9ce03 100644
--- a/pkgs/development/compilers/llvm/clang.nix
+++ b/pkgs/development/compilers/llvm/clang.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation {
 
   buildInputs = [ perl llvm groff cmake libxml2 python ];
 
-  patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
+  patches = [ ./clang-tablegen-dir.patch ] ++
+            stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
 
   cmakeFlags = [
     "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"