From 7d126080695d2f84c440953735c6be087074e7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 16 Jun 2017 16:21:48 +0100 Subject: [PATCH] llvmPackages_3.7: fix libnames output of llvm-config see also 4c4f50ce76aeeaa5fb66b66012f67dd878d1fbc7 --- .../compilers/llvm/3.7/fix-llvm-config.patch | 13 +++++++++++++ pkgs/development/compilers/llvm/3.7/llvm.nix | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/compilers/llvm/3.7/fix-llvm-config.patch diff --git a/pkgs/development/compilers/llvm/3.7/fix-llvm-config.patch b/pkgs/development/compilers/llvm/3.7/fix-llvm-config.patch new file mode 100644 index 000000000000..772c49609275 --- /dev/null +++ b/pkgs/development/compilers/llvm/3.7/fix-llvm-config.patch @@ -0,0 +1,13 @@ +diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py +index eacefdf60bf..40d25f5cef8 100644 +--- a/utils/llvm-build/llvmbuild/main.py ++++ b/utils/llvm-build/llvmbuild/main.py +@@ -412,7 +412,7 @@ subdirectories = %s + if library_name is None: + library_name_as_cstr = '0' + else: +- library_name_as_cstr = '"lib%s.a"' % library_name ++ library_name_as_cstr = '"lib%s.so"' % library_name + f.write(' { "%s", %s, %d, { %s } },\n' % ( + name, library_name_as_cstr, is_installed, + ', '.join('"%s"' % dep diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix index d4e7c73ad0de..1bdefd214f96 100644 --- a/pkgs/development/compilers/llvm/3.7/llvm.nix +++ b/pkgs/development/compilers/llvm/3.7/llvm.nix @@ -53,6 +53,11 @@ in stdenv.mkDerivation rec { 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