2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-02 14:02:27 +00:00

rust: fix build with LLVM 9.0.0

This commit is contained in:
Dylan Araps 2019-09-20 20:07:55 +03:00
parent 86a56da43f
commit 3e9982ea44
6 changed files with 35 additions and 1 deletions

View File

@ -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 <<EOF
[llvm]
link-shared = true
thin-lto = false
optimize = true
[build]
build = "x86_64-unknown-linux-musl"
@ -39,6 +42,8 @@ llvm-config = "/usr/bin/llvm-config"
crt-static = false
EOF
export RUSTFLAGS="-C link-args=-lffi"
python3 ./x.py build -j "$(nproc)"
DESTDIR="$1" python3 ./x.py install

View File

@ -1,2 +1,3 @@
120e7020d065499cc6b28759ff04153bfdc2ac9b5adeb252331a4eb87cbe38c3 rustc-1.37.0-src.tar.gz
0341881feff659cf705671d663157113fdc752d9bfb0cdfd5fc75daa65bdf1d5 musl-libressl.patch
a86b97ec4431b77488ab0b14306e9876f4f10a39ed626bee405713c1e4ef29c0 rust-fix-llvm-9.patch

View File

@ -1,5 +1,6 @@
cmake make
curl make
libffi
libressl
llvm
python make

View File

@ -0,0 +1,26 @@
From 04304fcd16e40c936dc5ba71c9ac3c445597f8bb Mon Sep 17 00:00:00 2001
From: Nikita Popov <nikita.ppv@gmail.com>
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);

View File

@ -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

View File

@ -1 +1 @@
1.37.0 1
1.37.0 2