Skip to content

Commit 218575a

Browse files
committed
Working, but requires a patched rustc
1 parent 9483008 commit 218575a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

build_sysroot/build_sysroot.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
3030
cp -r target/$TARGET_TRIPLE/$sysroot_channel/deps/* sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
3131

3232
# Since we can't override the sysroot for the UI tests anymore, we create a new toolchain and manually overwrite the sysroot directory.
33-
my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests
34-
rm -rf $my_toolchain_dir
3533
rust_toolchain=$(cat ../rust-toolchain | grep channel | sed 's/channel = "\(.*\)"/\1/')
34+
my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests-$rust_toolchain-$TARGET_TRIPLE
35+
rm -rf $my_toolchain_dir
3636
cp -r $HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE $my_toolchain_dir
3737
rm -rf $my_toolchain_dir/lib/rustlib/$TARGET_TRIPLE/
3838
cp -r ../build_sysroot/sysroot/* $my_toolchain_dir

test.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -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
219220
changelog-seen = 2
@@ -222,12 +223,13 @@ changelog-seen = 2
222223
codegen-backends = []
223224
deny-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)"
228230
local-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]
233235
llvm-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

Comments
 (0)