From c7281d14f7f247e3638b60c02f2a853d1005852f Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sat, 4 Jun 2016 13:24:11 +0100 Subject: [PATCH] clang-3.5: fix build Make Obj public in llvm's IntrusiveRefCntPtr This fixes NixOs/nixpkgs#15974 It's not a nice fix, as it's really clang's problem. The proper fix should modify clang's usage of IntrusiveRefCntPtr. --- pkgs/development/compilers/llvm/3.5/clang.nix | 1 - .../compilers/llvm/3.5/fix-15974.patch | 15 +++++++++++++++ pkgs/development/compilers/llvm/3.5/llvm.nix | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/llvm/3.5/fix-15974.patch diff --git a/pkgs/development/compilers/llvm/3.5/clang.nix b/pkgs/development/compilers/llvm/3.5/clang.nix index d3ce8a4f9ff0..42ca4ba70e4d 100644 --- a/pkgs/development/compilers/llvm/3.5/clang.nix +++ b/pkgs/development/compilers/llvm/3.5/clang.nix @@ -50,6 +50,5 @@ in stdenv.mkDerivation { homepage = http://llvm.org/; license = stdenv.lib.licenses.bsd3; platforms = stdenv.lib.platforms.all; - broken = true; }; } diff --git a/pkgs/development/compilers/llvm/3.5/fix-15974.patch b/pkgs/development/compilers/llvm/3.5/fix-15974.patch new file mode 100644 index 000000000000..446004cd9988 --- /dev/null +++ b/pkgs/development/compilers/llvm/3.5/fix-15974.patch @@ -0,0 +1,15 @@ +diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h +index f9df378..9d860ec 100644 +--- a/include/llvm/ADT/IntrusiveRefCntPtr.h ++++ b/include/llvm/ADT/IntrusiveRefCntPtr.h +@@ -134,9 +134,9 @@ public: + //===----------------------------------------------------------------------===// + template + class IntrusiveRefCntPtr { ++ public: + T* Obj; + +- public: + typedef T element_type; + + explicit IntrusiveRefCntPtr() : Obj(nullptr) {} diff --git a/pkgs/development/compilers/llvm/3.5/llvm.nix b/pkgs/development/compilers/llvm/3.5/llvm.nix index 64df30dc23f9..4f54f1438a7c 100644 --- a/pkgs/development/compilers/llvm/3.5/llvm.nix +++ b/pkgs/development/compilers/llvm/3.5/llvm.nix @@ -53,6 +53,8 @@ in stdenv.mkDerivation rec { "-DCAN_TARGET_i386=false" ]; + patches = [ ./fix-15974.patch ]; + postBuild = '' rm -fR $out @@ -75,3 +77,4 @@ in stdenv.mkDerivation rec { platforms = stdenv.lib.platforms.all; }; } +