From 43c30651ee26e0cce26810b581646f15fa117598 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 1 Nov 2015 15:01:51 +0000 Subject: [PATCH] Cherry pick upstream change r242372 (should be in 3.7.1) to fix a build failure with rust beta --- debian/changelog | 7 ++++ debian/patches/rust-patch-242372.diff | 60 +++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 68 insertions(+) create mode 100644 debian/patches/rust-patch-242372.diff diff --git a/debian/changelog b/debian/changelog index b638a554..55d78faf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-3.7 (1:3.7-5) unstable; urgency=medium + + * Cherry pick upstream change r242372 (should be in 3.7.1) to fix + a build failure with rust beta + + -- Sylvestre Ledru Sun, 01 Nov 2015 16:01:08 +0100 + llvm-toolchain-3.7 (1:3.7-4) unstable; urgency=medium * Add a Break/Replaces clang-3.7 (<< 1:3.7-3) from clang-tidy-3.7 diff --git a/debian/patches/rust-patch-242372.diff b/debian/patches/rust-patch-242372.diff new file mode 100644 index 00000000..b170b3ed --- /dev/null +++ b/debian/patches/rust-patch-242372.diff @@ -0,0 +1,60 @@ +Index: include/llvm-c/Core.h +=================================================================== +--- include/llvm-c/Core.h (révision 242371) ++++ include/llvm-c/Core.h (révision 242372) +@@ -2675,7 +2675,8 @@ + LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, + const char *Name); + LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, +- unsigned NumClauses, const char *Name); ++ LLVMValueRef PersFn, unsigned NumClauses, ++ const char *Name); + LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn); + LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); + +Index: bindings/go/llvm/ir.go +=================================================================== +--- bindings/go/llvm/ir.go (révision 242371) ++++ bindings/go/llvm/ir.go (révision 242372) +@@ -1731,7 +1731,7 @@ + func (b Builder) CreateLandingPad(t Type, nclauses int, name string) (l Value) { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) +- l.C = C.LLVMBuildLandingPad(b.C, t.C, C.unsigned(nclauses), cname) ++ l.C = C.LLVMBuildLandingPad(b.C, t.C, nil, C.unsigned(nclauses), cname) + return l + } + +Index: bindings/ocaml/llvm/llvm_ocaml.c +=================================================================== +--- bindings/ocaml/llvm/llvm_ocaml.c (révision 242371) ++++ bindings/ocaml/llvm/llvm_ocaml.c (révision 242372) +@@ -1745,7 +1745,7 @@ + CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn, + value NumClauses, value Name, + value B) { +- return LLVMBuildLandingPad(Builder_val(B), Ty, Int_val(NumClauses), ++ return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses), + String_val(Name)); + } + +Index: lib/IR/Core.cpp +=================================================================== +--- lib/IR/Core.cpp (révision 242371) ++++ lib/IR/Core.cpp (révision 242372) +@@ -2257,7 +2257,14 @@ + } + + LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, +- unsigned NumClauses, const char *Name) { ++ LLVMValueRef PersFn, unsigned NumClauses, ++ const char *Name) { ++ // The personality used to live on the landingpad instruction, but now it ++ // lives on the parent function. For compatibility, take the provided ++ // personality and put it on the parent function. ++ if (PersFn) ++ unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( ++ cast(unwrap(PersFn))); + return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); + } + diff --git a/debian/patches/series b/debian/patches/series index 61e9de69..8538980e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -44,3 +44,4 @@ bug783205.patch fix-cmake-config-prefix.diff kfreebsd-build-fix.patch ubuntu-precise-compiler-rt.diff +rust-patch-242372.diff