@@ -209,11 +209,12 @@ function setup_rustc() {
209209 cd rust
210210 git fetch
211211 git checkout $( rustc -V | cut -d' ' -f3 | tr -d ' (' )
212+ git am ../0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch
212213 export RUSTFLAGS=
213214
214215 rm config.toml || true
215216
216- my_toolchain_dir=$HOME /.rustup/toolchains/codegen_gcc_ui_tests
217+ my_toolchain_dir=$HOME /.rustup/toolchains/codegen_gcc_ui_tests- $rust_toolchain - $TARGET_TRIPLE
217218
218219 cat > config.toml << EOF
219220changelog-seen = 2
@@ -222,12 +223,13 @@ changelog-seen = 2
222223codegen-backends = []
223224deny-warnings = false
224225
226+ # FIXME: it works with the original rustc and cargo.
225227[build]
226- cargo = "$my_toolchain_dir /bin/cargo"
227- # cargo = "$( rustup which cargo) "
228+ # cargo = "$my_toolchain_dir /bin/cargo"
229+ cargo = "$( rustup which cargo) "
228230local-rebuild = true
229- rustc = "$my_toolchain_dir /bin/rustc"
230- # rustc = "$HOME /.rustup/toolchains/$rust_toolchain -$TARGET_TRIPLE /bin/rustc"
231+ # rustc = "$my_toolchain_dir /bin/rustc"
232+ rustc = "$HOME /.rustup/toolchains/$rust_toolchain -$TARGET_TRIPLE /bin/rustc"
231233
232234[target.x86_64-unknown-linux-gnu]
233235llvm-filecheck = "` which FileCheck-10 || which FileCheck-11 || which FileCheck-12 || which FileCheck-13 || which FileCheck-14` "
@@ -359,7 +361,7 @@ function test_rustc() {
359361 git checkout tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
360362 git checkout tests/ui/macros/rfc-2011-nicer-assert-messages/auxiliary/common.rs
361363
362- RUSTC_ARGS=" $TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend=" $( pwd) " /../target/" $CHANNEL " /librustc_codegen_gcc." $dylib_ext " "
364+ RUSTC_ARGS=" $TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend=" $( pwd) " /../target/" $CHANNEL " /librustc_codegen_gcc." $dylib_ext " --sysroot " $( pwd ) " /../build_sysroot/sysroot "
363365
364366
365367 if [ $# -eq 0 ]; then
@@ -392,6 +394,7 @@ function test_rustc() {
392394 fi
393395
394396 echo " [TEST] rustc test suite"
397+ # FIXME: the problem seems like an ABI incompatibility between cg_gcc sysroot and cg_llvm.
395398 COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui --rustc-args " $RUSTC_ARGS "
396399}
397400
0 commit comments