From c418f3830b05113927908b6b4e8218ed8bbbf4c4 Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 13 Jun 2019 18:21:53 +0200 Subject: [PATCH] rust: add patch to limit internalization without this patch, some packages fail to build on i686 [ci skip] --- .../rust/patches/limit-internalization.patch | 27 +++++++++++++++++++ srcpkgs/rust/template | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/rust/patches/limit-internalization.patch diff --git a/srcpkgs/rust/patches/limit-internalization.patch b/srcpkgs/rust/patches/limit-internalization.patch new file mode 100644 index 00000000000..c876df02cc8 --- /dev/null +++ b/srcpkgs/rust/patches/limit-internalization.patch @@ -0,0 +1,27 @@ +From b4131e297e18fde119f6f461b3e622218166b009 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 26 Apr 2019 08:58:14 -0700 +Subject: [PATCH] Limit internalization in LLVM 8 ThinLTO + +--- + src/rustllvm/PassWrapper.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp +index 319c66a21f17..0ebef82d3768 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, + return PrevailingType::Unknown; + }; + #if LLVM_VERSION_GE(8, 0) ++ // We don't have a complete picture in our use of ThinLTO, just our immediate ++ // crate, so we need `ImportEnabled = false` to limit internalization. ++ // Otherwise, we sometimes lose `static` values -- see #60184. + computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols, +- deadIsPrevailing, /* ImportEnabled = */ true); ++ deadIsPrevailing, /* ImportEnabled = */ false); + #else + computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing); + #endif + diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index af7da209e5c..44933d5cfce 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -1,7 +1,7 @@ # Template file for 'rust' pkgname=rust version=1.35.0 -revision=1 +revision=2 _rust_dist_version=1.35.0 _cargo_dist_version=0.36.0 # Always make sure custom distfiles used for bootstrap are