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