From 9510791fce1e5f6c5e78c0524dd1c5d253e5ba1d Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 13 Jun 2020 19:19:38 +0200 Subject: [PATCH] Compile sysroot in release mode by default Fixes #938 --- build_sysroot/Cargo.toml | 1 + build_sysroot/build_sysroot.sh | 2 +- test.sh | 6 +----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/build_sysroot/Cargo.toml b/build_sysroot/Cargo.toml index ef39a0d87f6..a4f766cf89c 100644 --- a/build_sysroot/Cargo.toml +++ b/build_sysroot/Cargo.toml @@ -21,3 +21,4 @@ rustc-std-workspace-std = { path = "./sysroot_src/src/tools/rustc-std-workspace- [profile.release] debug = true +incremental = true diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh index 65ccf605ea9..e08fc51999d 100755 --- a/build_sysroot/build_sysroot.sh +++ b/build_sysroot/build_sysroot.sh @@ -18,7 +18,7 @@ rm -r sysroot/ 2>/dev/null || true export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked" if [[ "$1" == "--release" ]]; then sysroot_channel='release' - RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release + RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=2" cargo build --target $TARGET_TRIPLE --release else sysroot_channel='debug' cargo build --target $TARGET_TRIPLE diff --git a/test.sh b/test.sh index 190fd7b291a..cea435d8963 100755 --- a/test.sh +++ b/test.sh @@ -38,7 +38,7 @@ $RUSTC example/arbitrary_self_types_pointers_and_wrappers.rs --crate-name arbitr $RUN_WRAPPER ./target/out/arbitrary_self_types_pointers_and_wrappers echo "[BUILD] sysroot" -time ./build_sysroot/build_sysroot.sh +time ./build_sysroot/build_sysroot.sh --release echo "[AOT] alloc_example" $RUSTC example/alloc_example.rs --crate-type bin --target $TARGET_TRIPLE @@ -71,10 +71,6 @@ $RUN_WRAPPER ./target/out/track-caller-attribute echo "[BUILD] mod_bench" $RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE -# FIXME linker gives multiple definitions error on Linux -#echo "[BUILD] sysroot in release mode" -#./build_sysroot/build_sysroot.sh --release - pushd simple-raytracer if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then echo "[BENCH COMPILE] ebobby/simple-raytracer"