]> git.lizzy.rs Git - rust.git/blob - scripts/setup_rust_fork.sh
Codegen 128bit atomic loads and stores for compiler builtins as trap
[rust.git] / scripts / setup_rust_fork.sh
1 #!/bin/bash
2 set -e
3
4 ./y.rs build --no-unstable-features
5 source scripts/config.sh
6
7 echo "[SETUP] Rust fork"
8 git clone https://github.com/rust-lang/rust.git || true
9 pushd rust
10 git fetch
11 git checkout -- .
12 git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
13
14 git apply - <<EOF
15 diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
16 index d95b5b7f17f..00b6f0e3635 100644
17 --- a/library/alloc/Cargo.toml
18 +++ b/library/alloc/Cargo.toml
19 @@ -8,7 +8,7 @@ edition = "2018"
20
21  [dependencies]
22  core = { path = "../core" }
23 -compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
24 +compiler_builtins = { version = "0.1.66", features = ['rustc-dep-of-std', 'no-asm'] }
25
26  [dev-dependencies]
27  rand = "0.7"
28  rand_xorshift = "0.2"
29 diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
30 index 887d27fd6dca4..2c2239f2b83d1 100644
31 --- a/src/tools/compiletest/src/header.rs
32 +++ b/src/tools/compiletest/src/header.rs
33 @@ -806,8 +806,8 @@ pub fn make_test_description<R: Read>(
34      cfg: Option<&str>,
35  ) -> test::TestDesc {
36      let mut ignore = false;
37      #[cfg(not(bootstrap))]
38 -    let ignore_message: Option<String> = None;
39 +    let ignore_message: Option<&str> = None;
40      let mut should_fail = false;
41
42      let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
43
44 diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
45 index 8431aa7b818..a3ff7e68ce5 100644
46 --- a/src/tools/compiletest/src/runtest.rs
47 +++ b/src/tools/compiletest/src/runtest.rs
48 @@ -3489,11 +3489,7 @@ fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> S
49              .join("library");
50          normalize_path(&src_dir, "$(echo '$SRC_DIR')");
51
52 -        if let Some(virtual_rust_source_base_dir) =
53 -            option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from)
54 -        {
55 -            normalize_path(&virtual_rust_source_base_dir.join("library"), "$(echo '$SRC_DIR')");
56 -        }
57 +        normalize_path(&Path::new("$(cd ../build_sysroot/sysroot_src/library; pwd)"), "$(echo '$SRC_DIR')");
58
59          // Paths into the build directory
60          let test_build_dir = &self.config.build_base;
61 EOF
62
63 cat > config.toml <<EOF
64 changelog-seen = 2
65
66 [llvm]
67 ninja = false
68
69 [build]
70 rustc = "$(pwd)/../build/bin/cg_clif"
71 cargo = "$(rustup which cargo)"
72 full-bootstrap = true
73 local-rebuild = true
74
75 [rust]
76 codegen-backends = ["cranelift"]
77 deny-warnings = false
78 verbose-tests = false
79 EOF
80 popd