]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh
Auto merge of #103431 - Dylan-DPC:rollup-oozfo89, r=Dylan-DPC
[rust.git] / compiler / rustc_codegen_cranelift / scripts / setup_rust_fork.sh
1 #!/usr/bin/env bash
2 set -e
3
4 ./y.rs build --no-unstable-features
5
6 echo "[SETUP] Rust fork"
7 git clone https://github.com/rust-lang/rust.git || true
8 pushd rust
9 git fetch
10 git checkout -- .
11 git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
12
13 git apply - <<EOF
14 diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
15 index d95b5b7f17f..00b6f0e3635 100644
16 --- a/library/alloc/Cargo.toml
17 +++ b/library/alloc/Cargo.toml
18 @@ -8,7 +8,7 @@ edition = "2018"
19
20  [dependencies]
21  core = { path = "../core" }
22 -compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
23 +compiler_builtins = { version = "0.1.66", features = ['rustc-dep-of-std', 'no-asm'] }
24
25  [dev-dependencies]
26  rand = "0.7"
27  rand_xorshift = "0.2"
28 diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
29 index 8431aa7b818..a3ff7e68ce5 100644
30 --- a/src/tools/compiletest/src/runtest.rs
31 +++ b/src/tools/compiletest/src/runtest.rs
32 @@ -3489,12 +3489,7 @@ fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> S
33          let compiler_src_dir = base_dir.join("compiler");
34          normalize_path(&compiler_src_dir, "$(echo '$COMPILER_DIR')");
35
36 -        if let Some(virtual_rust_source_base_dir) =
37 -            option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from)
38 -        {
39 -            normalize_path(&virtual_rust_source_base_dir.join("library"), "$(echo '$SRC_DIR')");
40 -            normalize_path(&virtual_rust_source_base_dir.join("compiler"), "$(echo '$COMPILER_DIR')");
41 -        }
42 +        normalize_path(&Path::new("$(cd ../build_sysroot/sysroot_src/library; pwd)"), "$(echo '$SRC_DIR')");
43
44          // Paths into the build directory
45          let test_build_dir = &self.config.build_base;
46 EOF
47
48 cat > config.toml <<EOF
49 changelog-seen = 2
50
51 [llvm]
52 ninja = false
53
54 [build]
55 rustc = "$(pwd)/../build/rustc-clif"
56 cargo = "$(rustup which cargo)"
57 full-bootstrap = true
58 local-rebuild = true
59
60 [rust]
61 codegen-backends = ["cranelift"]
62 deny-warnings = false
63 verbose-tests = false
64 EOF
65 popd
66
67 # FIXME remove once inline asm is fully supported
68 export RUSTFLAGS="$RUSTFLAGS --cfg=rustix_use_libc"