Skip to content

Commit 16f4126

Browse files
committed
Pass --sysroot in config.sh to prevent passing it
1 parent 3fb3043 commit 16f4126

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

build_sysroot/build_sysroot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
# Build libs
2222
mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
23-
export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked --sysroot sysroot"
23+
export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked"
2424
if [[ "$1" == "--release" ]]; then
2525
channel='release'
2626
RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release

config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ else
1818
cargo build
1919
fi
2020

21-
export RUSTFLAGS='-Zalways-encode-mir -Cpanic=abort -Cdebuginfo=2 -Zcodegen-backend='$(pwd)'/target/'$channel'/librustc_codegen_cranelift.'$dylib_ext
21+
export RUSTFLAGS='-Zalways-encode-mir -Cpanic=abort -Cdebuginfo=2 -Zcodegen-backend='$(pwd)'/target/'$channel'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
2222
RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
2323
export RUST_LOG=warn # display metadata load errors

test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ echo "[BUILD] sysroot"
2525
time ./build_sysroot/build_sysroot.sh
2626

2727
echo "[BUILD+RUN] alloc_example"
28-
$RUSTC --sysroot ./build_sysroot/sysroot example/alloc_example.rs --crate-type bin
28+
$RUSTC example/alloc_example.rs --crate-type bin
2929
./target/out/alloc_example
3030

3131
echo "[BUILD+RUN] std_example"
32-
$RUSTC --sysroot ./build_sysroot/sysroot example/std_example.rs --crate-type bin
32+
$RUSTC example/std_example.rs --crate-type bin
3333
./target/out/std_example
3434

3535
echo "[BUILD] mod_bench"
36-
$RUSTC --sysroot ./build_sysroot/sysroot example/mod_bench.rs --crate-type bin
36+
$RUSTC example/mod_bench.rs --crate-type bin
3737

3838
# FIXME linker gives multiple definitions error on Linux
3939
#echo "[BUILD] sysroot in release mode"
4040
#./build_sysroot/build_sysroot.sh --release
4141

42-
COMPILE_MOD_BENCH_INLINE="$RUSTC --sysroot ./build_sysroot/sysroot example/mod_bench.rs --crate-type bin -Zmir-opt-level=3 -O --crate-name mod_bench_inline"
42+
COMPILE_MOD_BENCH_INLINE="$RUSTC example/mod_bench.rs --crate-type bin -Zmir-opt-level=3 -O --crate-name mod_bench_inline"
4343
COMPILE_MOD_BENCH_LLVM_0="rustc example/mod_bench.rs --crate-type bin -Copt-level=0 -o target/out/mod_bench_llvm_0 -Cpanic=abort"
4444
COMPILE_MOD_BENCH_LLVM_1="rustc example/mod_bench.rs --crate-type bin -Copt-level=1 -o target/out/mod_bench_llvm_1 -Cpanic=abort"
4545
COMPILE_MOD_BENCH_LLVM_2="rustc example/mod_bench.rs --crate-type bin -Copt-level=2 -o target/out/mod_bench_llvm_2 -Cpanic=abort"

0 commit comments

Comments
 (0)