mirror of
https://codeberg.org/kiss-community/repo
synced 2024-07-04 23:12:28 +00:00
rust: fix build with LLVM 9.0.0
This commit is contained in:
parent
86a56da43f
commit
3e9982ea44
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
patch -p1 < musl-libressl.patch
|
patch -p1 < musl-libressl.patch
|
||||||
|
patch -p1 < rust-fix-llvm-9.patch
|
||||||
|
|
||||||
# 'rust' checksums files in 'vendor/', but we patch a few files.
|
# 'rust' checksums files in 'vendor/', but we patch a few files.
|
||||||
for vendor in libc openssl-sys; do
|
for vendor in libc openssl-sys; do
|
||||||
|
@ -10,6 +11,8 @@ done
|
||||||
cat > config.toml <<EOF
|
cat > config.toml <<EOF
|
||||||
[llvm]
|
[llvm]
|
||||||
link-shared = true
|
link-shared = true
|
||||||
|
thin-lto = false
|
||||||
|
optimize = true
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
build = "x86_64-unknown-linux-musl"
|
build = "x86_64-unknown-linux-musl"
|
||||||
|
@ -39,6 +42,8 @@ llvm-config = "/usr/bin/llvm-config"
|
||||||
crt-static = false
|
crt-static = false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
export RUSTFLAGS="-C link-args=-lffi"
|
||||||
|
|
||||||
python3 ./x.py build -j "$(nproc)"
|
python3 ./x.py build -j "$(nproc)"
|
||||||
DESTDIR="$1" python3 ./x.py install
|
DESTDIR="$1" python3 ./x.py install
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
120e7020d065499cc6b28759ff04153bfdc2ac9b5adeb252331a4eb87cbe38c3 rustc-1.37.0-src.tar.gz
|
120e7020d065499cc6b28759ff04153bfdc2ac9b5adeb252331a4eb87cbe38c3 rustc-1.37.0-src.tar.gz
|
||||||
0341881feff659cf705671d663157113fdc752d9bfb0cdfd5fc75daa65bdf1d5 musl-libressl.patch
|
0341881feff659cf705671d663157113fdc752d9bfb0cdfd5fc75daa65bdf1d5 musl-libressl.patch
|
||||||
|
a86b97ec4431b77488ab0b14306e9876f4f10a39ed626bee405713c1e4ef29c0 rust-fix-llvm-9.patch
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
cmake make
|
cmake make
|
||||||
curl make
|
curl make
|
||||||
|
libffi
|
||||||
libressl
|
libressl
|
||||||
llvm
|
llvm
|
||||||
python make
|
python make
|
||||||
|
|
26
extra/rust/patches/rust-fix-llvm-9.patch
Normal file
26
extra/rust/patches/rust-fix-llvm-9.patch
Normal 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);
|
|
@ -1,2 +1,3 @@
|
||||||
https://static.rust-lang.org/dist/rustc-1.37.0-src.tar.gz
|
https://static.rust-lang.org/dist/rustc-1.37.0-src.tar.gz
|
||||||
patches/musl-libressl.patch
|
patches/musl-libressl.patch
|
||||||
|
patches/rust-fix-llvm-9.patch
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1.37.0 1
|
1.37.0 2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user