summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/set_soname.patch12
2 files changed, 25 insertions, 3 deletions
diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix
index 4b5bbdc52584..59e2bdc5509a 100644
--- a/pkgs/development/compilers/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, groff, cmake, python }:
+{ stdenv, fetchurl, perl, groff, cmake, python, libffi }:
 
 let version = "3.2"; in
 
@@ -10,11 +10,21 @@ stdenv.mkDerivation {
     sha256 = "0hv30v5l4fkgyijs56sr1pbrlzgd674pg143x7az2h37sb290l0j";
   };
 
-  buildInputs = [ perl groff cmake python ];
+  patches = [ ./set_soname.patch ]; # http://llvm.org/bugs/show_bug.cgi?id=12334
+  patchFlags = "-p0";
 
-  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
+  preConfigure = "patchShebangs .";
+
+  propagatedBuildInputs = [ libffi ];
+  buildInputs = [ perl groff cmake python ]; # ToDo: polly, libc++; enable cxx11?
+
+  # created binaries need to be run before installation... I coudn't find a better way
+  preBuild = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/lib'';
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DBUILD_SHARED_LIBS=ON" ];
 
   enableParallelBuilding = true;
+  #doCheck = true; # tests are broken, don't know why
 
   meta = {
     homepage = http://llvm.org/;
diff --git a/pkgs/development/compilers/llvm/set_soname.patch b/pkgs/development/compilers/llvm/set_soname.patch
new file mode 100644
index 000000000000..69ba74dddad8
--- /dev/null
+++ b/pkgs/development/compilers/llvm/set_soname.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/show_bug.cgi?id=409267
+http://llvm.org/bugs/show_bug.cgi?id=12334
+--- tools/llvm-shlib/Makefile.orig	2012-03-26 18:14:13.071797115 +0200
++++ tools/llvm-shlib/Makefile	2012-03-26 17:31:12.491196254 +0200
+@@ -67,6 +67,7 @@
+     # Include everything from the .a's into the shared library.
+     LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
+                        -Wl,--no-whole-archive
++    LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
+ endif
+ 
+ ifeq ($(HOST_OS),Linux)