2022-04-22 14:11:38 -05:00
|
|
|
#!/usr/bin/env bash
|
2021-03-29 03:45:09 -05:00
|
|
|
set -e
|
|
|
|
|
2023-12-31 05:34:26 -06:00
|
|
|
# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as
|
2023-11-11 07:19:49 -06:00
|
|
|
# the LLVM backend isn't compiled in here.
|
|
|
|
export CG_CLIF_FORCE_GNU_AS=1
|
|
|
|
|
2023-10-21 14:01:08 -05:00
|
|
|
# Compiletest expects all standard library paths to start with /rustc/FAKE_PREFIX.
|
|
|
|
# CG_CLIF_STDLIB_REMAP_PATH_PREFIX will cause cg_clif's build system to pass
|
|
|
|
# --remap-path-prefix to handle this.
|
2023-11-11 07:19:49 -06:00
|
|
|
CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build
|
2021-03-29 03:45:09 -05:00
|
|
|
|
|
|
|
echo "[SETUP] Rust fork"
|
2023-12-31 05:34:26 -06:00
|
|
|
git clone --quiet https://github.com/rust-lang/rust.git --filter=tree:0 || true
|
2021-03-29 03:45:09 -05:00
|
|
|
pushd rust
|
|
|
|
git fetch
|
2023-12-31 05:34:26 -06:00
|
|
|
git checkout --no-progress -- .
|
|
|
|
git checkout --no-progress "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
|
|
|
|
|
|
|
|
git submodule update --quiet --init src/tools/cargo library/backtrace library/stdarch
|
2021-03-29 03:45:09 -05:00
|
|
|
|
2023-07-22 08:32:34 -05:00
|
|
|
git -c user.name=Dummy -c user.email=dummy@example.com -c commit.gpgSign=false \
|
|
|
|
am ../patches/*-stdlib-*.patch
|
2022-10-23 09:22:55 -05:00
|
|
|
|
2021-03-29 03:45:09 -05:00
|
|
|
cat > config.toml <<EOF
|
2023-12-31 06:22:38 -06:00
|
|
|
change-id = 999999
|
2022-03-20 10:55:21 -05:00
|
|
|
|
2024-09-15 12:40:12 -05:00
|
|
|
[llvm]
|
|
|
|
download-ci-llvm = true
|
|
|
|
|
2021-03-29 03:45:09 -05:00
|
|
|
[build]
|
2023-03-15 09:41:48 -05:00
|
|
|
rustc = "$(pwd)/../dist/bin/rustc-clif"
|
2021-03-29 03:45:09 -05:00
|
|
|
cargo = "$(rustup which cargo)"
|
|
|
|
full-bootstrap = true
|
|
|
|
local-rebuild = true
|
|
|
|
|
|
|
|
[rust]
|
|
|
|
codegen-backends = ["cranelift"]
|
|
|
|
deny-warnings = false
|
2021-12-20 11:56:35 -06:00
|
|
|
verbose-tests = false
|
2021-03-29 03:45:09 -05:00
|
|
|
EOF
|
|
|
|
popd
|
2022-07-25 09:07:57 -05:00
|
|
|
|
2022-10-23 09:22:55 -05:00
|
|
|
# Allow the testsuite to use llvm tools
|
|
|
|
host_triple=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
|
|
|
|
export LLVM_BIN_DIR="$(rustc --print sysroot)/lib/rustlib/$host_triple/bin"
|