]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh
New upstream version 1.70.0+dfsg1
[rustc.git] / compiler / rustc_codegen_cranelift / scripts / setup_rust_fork.sh
CommitLineData
04454e1e 1#!/usr/bin/env bash
cdc7bbd5
XL
2set -e
3
a2a8927a 4./y.rs build --no-unstable-features
cdc7bbd5
XL
5
6echo "[SETUP] Rust fork"
7git clone https://github.com/rust-lang/rust.git || true
8pushd rust
9git fetch
10git checkout -- .
11git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
12
353b0b11 13git -c user.name=Dummy -c user.email=dummy@example.com am ../patches/*-stdlib-*.patch
2b03887a 14
cdc7bbd5 15git apply - <<EOF
cdc7bbd5
XL
16diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
17index d95b5b7f17f..00b6f0e3635 100644
18--- a/library/alloc/Cargo.toml
19+++ b/library/alloc/Cargo.toml
20@@ -8,7 +8,7 @@ edition = "2018"
21
22 [dependencies]
23 core = { path = "../core" }
17df50a5 24-compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
a2a8927a 25+compiler_builtins = { version = "0.1.66", features = ['rustc-dep-of-std', 'no-asm'] }
cdc7bbd5
XL
26
27 [dev-dependencies]
9ffffee4
FG
28 rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
29 rand_xorshift = "0.3.0"
cdc7bbd5
XL
30EOF
31
32cat > config.toml <<EOF
5e7ed085
FG
33changelog-seen = 2
34
cdc7bbd5
XL
35[llvm]
36ninja = false
37
38[build]
353b0b11 39rustc = "$(pwd)/../dist/bin/rustc-clif"
cdc7bbd5
XL
40cargo = "$(rustup which cargo)"
41full-bootstrap = true
42local-rebuild = true
43
44[rust]
45codegen-backends = ["cranelift"]
46deny-warnings = false
a2a8927a 47verbose-tests = false
cdc7bbd5
XL
48EOF
49popd
064997fb
FG
50
51# FIXME remove once inline asm is fully supported
52export RUSTFLAGS="$RUSTFLAGS --cfg=rustix_use_libc"
2b03887a 53
9ffffee4 54export CFG_VIRTUAL_RUST_SOURCE_BASE_DIR="$(cd download/sysroot/sysroot_src; pwd)"
9c376795 55
2b03887a
FG
56# Allow the testsuite to use llvm tools
57host_triple=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
58export LLVM_BIN_DIR="$(rustc --print sysroot)/lib/rustlib/$host_triple/bin"