diff --git a/build_sysroot/Cargo.toml b/build_sysroot/Cargo.toml index c5bf0705c19..1039f4613ef 100644 --- a/build_sysroot/Cargo.toml +++ b/build_sysroot/Cargo.toml @@ -8,12 +8,14 @@ core = { path = "./sysroot_src/src/libcore" } compiler_builtins = "0.1" alloc = { path = "./sysroot_src/src/liballoc" } std = { path = "./sysroot_src/src/libstd", features = ["panic_unwind"] } +test = { path = "./sysroot_src/src/libtest" } alloc_system = { path = "./alloc_system" } [patch.crates-io] rustc-std-workspace-core = { path = "./sysroot_src/src/tools/rustc-std-workspace-core" } -rustc-std-workspace-alloc = { path = "./rustc-std-workspace-alloc" } +rustc-std-workspace-alloc = { path = "./sysroot_src/src/tools/rustc-std-workspace-alloc" } +rustc-std-workspace-std = { path = "./sysroot_src/src/tools/rustc-std-workspace-std" } [profile.dev] # FIXME On macOS statics and promoted constants have the wrong alignment. This causes a debug diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh index 37aa7c1908d..26f6607b2aa 100755 --- a/build_sysroot/build_sysroot.sh +++ b/build_sysroot/build_sysroot.sh @@ -29,14 +29,3 @@ fi # Copy files to sysroot mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/ cp -r target/$TARGET_TRIPLE/$sysroot_channel/deps/* sysroot/lib/rustlib/$TARGET_TRIPLE/lib/ - -if [[ "$1" == "--release" ]]; then - channel='release' - RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release --manifest-path ./sysroot_src/src/libtest/Cargo.toml -else - channel='debug' - cargo build --target $TARGET_TRIPLE --manifest-path ./sysroot_src/src/libtest/Cargo.toml -fi - -# Copy files to sysroot -cp -r sysroot_src/src/libtest/target/$TARGET_TRIPLE/$sysroot_channel/deps/* sysroot/lib/rustlib/$TARGET_TRIPLE/lib/ diff --git a/build_sysroot/rustc-std-workspace-alloc/Cargo.toml b/build_sysroot/rustc-std-workspace-alloc/Cargo.toml deleted file mode 100644 index 221365373ff..00000000000 --- a/build_sysroot/rustc-std-workspace-alloc/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "rustc-std-workspace-alloc" -version = "1.0.0" -authors = ["Alex Crichton "] -license = 'MIT/Apache-2.0' -description = """ -Hack for the compiler's own build system -""" -edition = "2018" - -[lib] -path = "lib.rs" - -[dependencies] -alloc = { path = "../sysroot_src/src/liballoc" } diff --git a/build_sysroot/rustc-std-workspace-alloc/lib.rs b/build_sysroot/rustc-std-workspace-alloc/lib.rs deleted file mode 100644 index cf216ec9d29..00000000000 --- a/build_sysroot/rustc-std-workspace-alloc/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(no_core)] -#![no_core] -#![deny(rust_2018_idioms)] - -pub use ::alloc::*; diff --git a/patches/0020-libtest-Don-t-require-panic_unwind.patch b/patches/0020-libtest-Don-t-require-panic_unwind.patch new file mode 100644 index 00000000000..4b46914c34b --- /dev/null +++ b/patches/0020-libtest-Don-t-require-panic_unwind.patch @@ -0,0 +1,41 @@ +From 7b30ddc41c71e89d3e6ab6840b0206877d68f201 Mon Sep 17 00:00:00 2001 +From: bjorn3 +Date: Sun, 25 Aug 2019 16:23:06 +0200 +Subject: [PATCH] [libtest] Don't require panic_unwind + +--- + src/libtest/lib.rs | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs +index 9bb76f9..c5fe1aa 100644 +--- a/src/libtest/lib.rs ++++ b/src/libtest/lib.rs +@@ -24,7 +24,6 @@ + #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc, rustc_private))] + #![feature(nll)] + #![feature(set_stdio)] +-#![feature(panic_unwind)] + #![feature(staged_api)] + #![feature(termination_trait_lib)] + #![feature(test)] +@@ -34,16 +33,6 @@ use getopts; + extern crate libc; + use term; + +-// FIXME(#54291): rustc and/or LLVM don't yet support building with panic-unwind +-// on aarch64-pc-windows-msvc, or thumbv7a-pc-windows-msvc +-// so we don't link libtest against libunwind (for the time being) +-// even though it means that libtest won't be fully functional on +-// these platforms. +-// +-// See also: https://github.com/rust-lang/rust/issues/54190#issuecomment-422904437 +-#[cfg(not(all(windows, any(target_arch = "aarch64", target_arch = "arm"))))] +-extern crate panic_unwind; +- + pub use self::ColorConfig::*; + use self::NamePadding::*; + use self::OutputLocation::*; +-- +2.20.1 +