From 3e9982ea44de8b4e4e940c7f9dea62f317ae79fd Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 20 Sep 2019 20:07:55 +0300 Subject: [PATCH] rust: fix build with LLVM 9.0.0 --- extra/rust/build | 5 +++++ extra/rust/checksums | 1 + extra/rust/depends | 1 + extra/rust/patches/rust-fix-llvm-9.patch | 26 ++++++++++++++++++++++++ extra/rust/sources | 1 + extra/rust/version | 2 +- 6 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 extra/rust/patches/rust-fix-llvm-9.patch diff --git a/extra/rust/build b/extra/rust/build index 5f909bcf..f01d3d39 100755 --- a/extra/rust/build +++ b/extra/rust/build @@ -1,6 +1,7 @@ #!/bin/sh -e patch -p1 < musl-libressl.patch +patch -p1 < rust-fix-llvm-9.patch # 'rust' checksums files in 'vendor/', but we patch a few files. for vendor in libc openssl-sys; do @@ -10,6 +11,8 @@ done cat > config.toml < +Date: Sat, 6 Jul 2019 19:02:48 +0200 +Subject: [PATCH] Pass GUIDPreservedSymbols to + thinLTOResolvePrevailingInIndex() + +--- + 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 0ebef82d3768..cea88f14dcc6 100644 +--- a/src/rustllvm/PassWrapper.cpp ++++ b/src/rustllvm/PassWrapper.cpp +@@ -913,7 +913,10 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, + GlobalValue::LinkageTypes NewLinkage) { + ResolvedODR[ModuleIdentifier][GUID] = NewLinkage; + }; +-#if LLVM_VERSION_GE(8, 0) ++#if LLVM_VERSION_GE(9, 0) ++ thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage, ++ Ret->GUIDPreservedSymbols); ++#elif LLVM_VERSION_GE(8, 0) + thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage); + #else + thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage); diff --git a/extra/rust/sources b/extra/rust/sources index 64261c5c..163985be 100644 --- a/extra/rust/sources +++ b/extra/rust/sources @@ -1,2 +1,3 @@ https://static.rust-lang.org/dist/rustc-1.37.0-src.tar.gz patches/musl-libressl.patch +patches/rust-fix-llvm-9.patch diff --git a/extra/rust/version b/extra/rust/version index 0d2987c6..494c44cf 100644 --- a/extra/rust/version +++ b/extra/rust/version @@ -1 +1 @@ -1.37.0 1 +1.37.0 2