From 1075b80649da113b6ba26866803627d727fd1f08 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez <guillaume.gomez@huawei.com> Date: Sat, 28 Oct 2023 20:34:15 +0200 Subject: [PATCH] Pass `--sysroot` option --- config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.sh b/config.sh index 97a7dba886a..7ae2175d41d 100644 --- a/config.sh +++ b/config.sh @@ -54,6 +54,10 @@ if [[ -z "$BUILTIN_BACKEND" ]]; then export RUSTFLAGS="$CG_RUSTFLAGS $linker -Csymbol-mangling-version=v0 -Cdebuginfo=2 $disable_lto_flags -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot $TEST_FLAGS" else export RUSTFLAGS="$CG_RUSTFLAGS $linker -Csymbol-mangling-version=v0 -Cdebuginfo=2 $disable_lto_flags -Zcodegen-backend=gcc $TEST_FLAGS -Cpanic=abort" + + if [[ ! -z "$RUSTC_SYSROOT" ]]; then + export RUSTFLAGS="$RUSTFLAGS --sysroot $RUSTC_SYSROOT" + fi fi # FIXME(antoyo): remove once the atomic shim is gone