summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-11-10 21:22:30 +0100
committerVladimír Čunát <vcunat@gmail.com>2017-11-10 21:34:48 +0100
commit7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee (patch)
tree712d4b72985c13d8bff85a1485b41aa05a333170
parent430a6ff7a5d2a496e50882acb2b7f4ad4fc1e3d8 (diff)
parentb261c73dced6ad52262d48d1a8f4c427012a4a0b (diff)
downloadnixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar.gz
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar.bz2
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar.lz
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar.xz
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.tar.zst
nixlib-7636ee7bcdb23cc97bf7957c0366c3cac90fc6ee.zip
Merge #31501: llvm-{3.4,3.5}: glibc 2.26 fixes
-rw-r--r--pkgs/development/compilers/llvm/3.4/llvm.nix17
-rw-r--r--pkgs/development/compilers/llvm/3.5/llvm.nix17
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix
index 743f243791b6..6e7ef22392b1 100644
--- a/pkgs/development/compilers/llvm/3.4/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.4/llvm.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetch
+, fetchpatch
 , perl
 , groff
 , cmake
@@ -39,6 +40,22 @@ in stdenv.mkDerivation rec {
     ../fix-llvm-config.patch
   ];
 
+  postPatch = stdenv.lib.optionalString (stdenv ? glibc) ''
+    (
+     cd projects/compiler-rt
+      patch -p1 -F3 < ${
+        fetchpatch {
+          name = "sigaltstack.patch"; # for glibc-2.26
+          url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
+          sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
+        }
+      }
+
+      sed -i "s,#include <pthread.h>,&\n#include <signal.h>,g" \
+        lib/asan/asan_linux.cc
+    )
+  '';
+
   # hacky fix: created binaries need to be run before installation
   preBuild = ''
     mkdir -p $out/
diff --git a/pkgs/development/compilers/llvm/3.5/llvm.nix b/pkgs/development/compilers/llvm/3.5/llvm.nix
index 94f39183345f..26144e38619f 100644
--- a/pkgs/development/compilers/llvm/3.5/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.5/llvm.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetch
+, fetchpatch
 , perl
 , groff
 , cmake
@@ -39,6 +40,22 @@ in stdenv.mkDerivation rec {
       --replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' ""
   '';
 
+  postPatch = 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";
+        }
+      }
+
+      sed -i "s,#include <pthread.h>,&\n#include <signal.h>,g" \
+        lib/asan/asan_linux.cc
+    )
+  '';
+
   # hacky fix: created binaries need to be run before installation
   preBuild = ''
     mkdir -p $out/