rust: Move latest to testing

This commit is contained in:
Dylan Araps 2020-04-30 21:26:28 +03:00
parent f57c5d025d
commit 062935e79b
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
7 changed files with 209 additions and 0 deletions

67
testing/rust/build Executable file
View File

@ -0,0 +1,67 @@
#!/bin/sh -e
for patch in *.patch; do
patch -p1 < "$patch"
done
# This package mimics the download process of rust's 'x.py'
# bootstrap library to allow for the removal of the internet
# connection requirement per build.
{
mkdir -p "${cache_dir:=build/cache/2020-03-12}"
for tarball in *.tar.xz\?no-extract; do
mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}"
done
}
# 'rust' checksums files in 'vendor/', but we patch a few.
for vendor in libc openssl-sys; do
sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json"
done
cat > config.toml <<EOF
[llvm]
link-shared = true
[build]
build = "x86_64-unknown-linux-musl"
host = [ "x86_64-unknown-linux-musl" ]
target = [ "x86_64-unknown-linux-musl" ]
docs = false
compiler-docs = false
extended = true
submodules = false
python = "python3"
locked-deps = true
vendor = true
sanitizers = false
profiler = false
full-bootstrap = false
[install]
prefix = "/usr"
[rust]
channel = "stable"
rpath = false
codegen-units = 1
debuginfo-level = 0
debug = false
backtrace = false
jemalloc = false
debug-assertions = false
codegen-tests = false
[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"
crt-static = false
EOF
export DESTDIR="$1"
python3 ./x.py build -j "$(nproc)"
python3 ./x.py install
rm -rf "$1/usr/lib/rustlib/src/"

6
testing/rust/checksums Normal file
View File

@ -0,0 +1,6 @@
d0899933840369f07394b211cb0b53a5cd4634907633f0bee541133c8b75e309 rustc-1.43.0-src.tar.xz
f429e81c3266bdcc038b6c2c2e5f51c64f75a85b46749e2cf5b93556f17b63a1 rust-std-1.42.0-x86_64-unknown-linux-musl.tar.xz?no-extract
79029296fbd91c19c2ad080a52c62963eb127227c59005645b86b5aa9aa310b8 rustc-1.42.0-x86_64-unknown-linux-musl.tar.xz?no-extract
705e648c727c50b3815a7be4a18a5886cb9f68e69df990710e938678080264a0 cargo-0.43.0-x86_64-unknown-linux-musl.tar.xz?no-extract
abb2acdfc50880da504225dd068f5ea381997cac9ebd23f371290aa8f29d438f musl.patch
722f672f3a96ad1916d47a88b922579456b3af2cdc37096ce98a093f3589a4fb llvm10.patch

7
testing/rust/depends Normal file
View File

@ -0,0 +1,7 @@
cmake make
curl make
libressl
llvm
python make
xz
zlib

View File

@ -0,0 +1,40 @@
Note from Wyvertux: This patch applies to 1.43.0 AND if LLVM is LLVM 10.
Applied to master branch by Nikita Popov.
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 90d24d20737db..9e8614e3b6d34 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() {
}
extern "C" void LLVMTimeTraceProfilerInitialize() {
-#if LLVM_VERSION_GE(9, 0)
+#if LLVM_VERSION_GE(10, 0)
+ timeTraceProfilerInitialize(
+ /* TimeTraceGranularity */ 0,
+ /* ProcName */ "rustc");
+#elif LLVM_VERSION_GE(9, 0)
timeTraceProfilerInitialize();
#endif
}
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 25cfee3373dc4..799adb418822d 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
LLVMValueRef Dst, unsigned DstAlign,
LLVMValueRef Val,
LLVMValueRef Size, bool IsVolatile) {
+#if LLVM_VERSION_GE(10, 0)
+ return wrap(unwrap(B)->CreateMemSet(
+ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
+#else
return wrap(unwrap(B)->CreateMemSet(
unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
+#endif
}
extern "C" LLVMValueRef

View File

@ -0,0 +1,82 @@
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index eced035..f988315 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -132,7 +132,7 @@ fn copy_third_party_objects(
// with a glibc-targeting toolchain, given we have the appropriate startup
// files. As those shipped with glibc won't work, copy the ones provided by
// musl so we have them on linux-gnu hosts.
- if target.contains("musl") {
+ if target.contains("noop") {
let srcdir = builder.musl_root(target).unwrap().join("lib");
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
copy_and_stamp(&srcdir, obj);
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 8ff7056..53c0194 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -205,7 +205,7 @@ pub fn check(build: &mut Build) {
}
// Make sure musl-root is valid
- if target.contains("musl") {
+ if target.contains("noop") {
// If this is a native target (host is also musl) and no musl-root is given,
// fall back to the system toolchain in /usr before giving up
if build.musl_root(*target).is_none() && build.config.build == *target {
diff --git a/src/librustc_target/spec/linux_musl_base.rs b/src/librustc_target/spec/linux_musl_base.rs
index e294e63..17fecb3 100644
--- a/src/librustc_target/spec/linux_musl_base.rs
+++ b/src/librustc_target/spec/linux_musl_base.rs
@@ -26,7 +26,7 @@ pub fn opts() -> TargetOptions {
base.post_link_objects_crt.push("crtn.o".to_string());
// These targets statically link libc by default
- base.crt_static_default = true;
+ base.crt_static_default = false;
// These targets allow the user to choose between static and dynamic linking.
base.crt_static_respected = true;
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index a24808b..25300a5 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -10,7 +10,7 @@ fn main() {
// Build the unwinding from libunwind C/C++ source code.
llvm_libunwind::compile();
} else if target.contains("linux") {
- if target.contains("musl") {
+ if target.contains("noop") {
// linking for musl is handled in lib.rs
llvm_libunwind::compile();
} else if !target.contains("android") {
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index 18d41be..6fddd6d 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -18,7 +18,7 @@ cfg_if::cfg_if! {
}
}
-#[cfg(target_env = "musl")]
+#[cfg(target_env = "noop")]
#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
extern "C" {}
diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs
index 238da24..71d4f31 100644
--- a/vendor/libc/src/unix/mod.rs
+++ b/vendor/libc/src/unix/mod.rs
@@ -298,7 +298,7 @@ cfg_if! {
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(target_env = "noop")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static",
cfg(target_feature = "crt-static")))]

6
testing/rust/sources Normal file
View File

@ -0,0 +1,6 @@
https://static.rust-lang.org/dist/rustc-1.43.0-src.tar.xz
https://static.rust-lang.org/dist/2020-03-12/rust-std-1.42.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2020-03-12/rustc-1.42.0-x86_64-unknown-linux-musl.tar.xz?no-extract
https://static.rust-lang.org/dist/2020-03-12/cargo-0.43.0-x86_64-unknown-linux-musl.tar.xz?no-extract
patches/musl.patch
patches/llvm10.patch

1
testing/rust/version Normal file
View File

@ -0,0 +1 @@
1.43.0 1