]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh
Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27
[rust.git] / compiler / rustc_codegen_cranelift / scripts / setup_rust_fork.sh
1 #!/bin/bash
2 set -e
3
4 ./build.sh
5 source build/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/Cargo.toml b/Cargo.toml
16 index 5bd1147cad5..10d68a2ff14 100644
17 --- a/Cargo.toml
18 +++ b/Cargo.toml
19 @@ -111,5 +111,7 @@ rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
20  rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
21  rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
22
23 +compiler_builtins = { path = "../build_sysroot/compiler-builtins" }
24 +
25  [patch."https://github.com/rust-lang/rust-clippy"]
26  clippy_lints = { path = "src/tools/clippy/clippy_lints" }
27 diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
28 index d95b5b7f17f..00b6f0e3635 100644
29 --- a/library/alloc/Cargo.toml
30 +++ b/library/alloc/Cargo.toml
31 @@ -8,7 +8,7 @@ edition = "2018"
32
33  [dependencies]
34  core = { path = "../core" }
35 -compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
36 +compiler_builtins = { version = "0.1.43", features = ['rustc-dep-of-std', 'no-asm'] }
37
38  [dev-dependencies]
39  rand = "0.7"
40  rand_xorshift = "0.2"
41 EOF
42
43 cat > config.toml <<EOF
44 [llvm]
45 ninja = false
46
47 [build]
48 rustc = "$(pwd)/../build/bin/cg_clif"
49 cargo = "$(rustup which cargo)"
50 full-bootstrap = true
51 local-rebuild = true
52
53 [rust]
54 codegen-backends = ["cranelift"]
55 deny-warnings = false
56 EOF
57 popd