1 |
commit: 34783cfa9869949d36d723bcdf0039f3308abee8 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 26 01:13:29 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 26 02:58:35 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34783cfa |
7 |
|
8 |
dev-lang/rust: fix segfaults with system llvm:7 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/675752 |
11 |
Package-Manager: Portage-2.3.57, Repoman-2.3.12 |
12 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
13 |
|
14 |
.../rust/files/1.32.0-system-llvm-7-SIGSEGV.patch | 33 ++++++++++++++++++++++ |
15 |
dev-lang/rust/rust-1.32.0.ebuild | 1 + |
16 |
2 files changed, 34 insertions(+) |
17 |
|
18 |
diff --git a/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch b/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..afc2cabde4b |
21 |
--- /dev/null |
22 |
+++ b/dev-lang/rust/files/1.32.0-system-llvm-7-SIGSEGV.patch |
23 |
@@ -0,0 +1,33 @@ |
24 |
+From 1c95f5a34c14f08d65cdd198827e3a2fcb63cf39 Mon Sep 17 00:00:00 2001 |
25 |
+From: Tom Tromey <tom@××××××.com> |
26 |
+Date: Tue, 22 Jan 2019 11:13:53 -0700 |
27 |
+Subject: [PATCH] Fix issue 57762 |
28 |
+ |
29 |
+Issue 57762 points out a compiler crash when the compiler was built |
30 |
+using a stock LLVM 7. LLVM 7 was released without a necessary fix for |
31 |
+a bug in the DWARF discriminant code. |
32 |
+ |
33 |
+This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. |
34 |
+ |
35 |
+Closes #57762 |
36 |
+--- |
37 |
+ src/librustc_codegen_llvm/debuginfo/metadata.rs | 6 +++++- |
38 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
39 |
+ |
40 |
+diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs |
41 |
+index 6deedd0b5ea3..a354eef6887a 100644 |
42 |
+--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs |
43 |
++++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs |
44 |
+@@ -1164,7 +1164,11 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool { |
45 |
+ // On MSVC we have to use the fallback mode, because LLVM doesn't |
46 |
+ // lower variant parts to PDB. |
47 |
+ return cx.sess().target.target.options.is_like_msvc |
48 |
+- || llvm_util::get_major_version() < 7; |
49 |
++ || llvm_util::get_major_version() < 7 |
50 |
++ // LLVM version 7 did not release with an important bug fix; |
51 |
++ // but the required patch is in the equivalent Rust LLVM. |
52 |
++ // See https://github.com/rust-lang/rust/issues/57762. |
53 |
++ || (llvm_util::get_major_version() == 7 && unsafe { !llvm::LLVMRustIsRustLLVM() }); |
54 |
+ } |
55 |
+ |
56 |
+ // Describes the members of an enum value: An enum is described as a union of |
57 |
|
58 |
diff --git a/dev-lang/rust/rust-1.32.0.ebuild b/dev-lang/rust/rust-1.32.0.ebuild |
59 |
index d7262e896e2..bc2a6106b8a 100644 |
60 |
--- a/dev-lang/rust/rust-1.32.0.ebuild |
61 |
+++ b/dev-lang/rust/rust-1.32.0.ebuild |
62 |
@@ -64,6 +64,7 @@ S="${WORKDIR}/${MY_P}-src" |
63 |
PATCHES=( |
64 |
"${FILESDIR}"/1.30.1-clippy-sysroot.patch |
65 |
"${FILESDIR}"/1.32.0-fix-configure-of-bundled-llvm.patch |
66 |
+ "${FILESDIR}"/1.32.0-system-llvm-7-SIGSEGV.patch |
67 |
) |
68 |
|
69 |
toml_usex() { |