Skip to content

Commit 9510791

Browse files
committed
Compile sysroot in release mode by default
Fixes rust-lang#938
1 parent eb5ce4e commit 9510791

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

build_sysroot/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ rustc-std-workspace-std = { path = "./sysroot_src/src/tools/rustc-std-workspace-
2121

2222
[profile.release]
2323
debug = true
24+
incremental = true

build_sysroot/build_sysroot.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rm -r sysroot/ 2>/dev/null || true
1818
export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked"
1919
if [[ "$1" == "--release" ]]; then
2020
sysroot_channel='release'
21-
RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release
21+
RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=2" cargo build --target $TARGET_TRIPLE --release
2222
else
2323
sysroot_channel='debug'
2424
cargo build --target $TARGET_TRIPLE

test.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $RUSTC example/arbitrary_self_types_pointers_and_wrappers.rs --crate-name arbitr
3838
$RUN_WRAPPER ./target/out/arbitrary_self_types_pointers_and_wrappers
3939

4040
echo "[BUILD] sysroot"
41-
time ./build_sysroot/build_sysroot.sh
41+
time ./build_sysroot/build_sysroot.sh --release
4242

4343
echo "[AOT] alloc_example"
4444
$RUSTC example/alloc_example.rs --crate-type bin --target $TARGET_TRIPLE
@@ -71,10 +71,6 @@ $RUN_WRAPPER ./target/out/track-caller-attribute
7171
echo "[BUILD] mod_bench"
7272
$RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
7373

74-
# FIXME linker gives multiple definitions error on Linux
75-
#echo "[BUILD] sysroot in release mode"
76-
#./build_sysroot/build_sysroot.sh --release
77-
7874
pushd simple-raytracer
7975
if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then
8076
echo "[BENCH COMPILE] ebobby/simple-raytracer"

0 commit comments

Comments
 (0)