Skip to content

Commit

Permalink
Auto merge of rust-lang#87822 - JohnTitor:rollup-kxojii0, r=JohnTitor
Browse files Browse the repository at this point in the history
Rollup of 7 pull requests

Successful merges:

 - rust-lang#85807 (bootstrap: Disable initial-exec TLS model on powerpc)
 - rust-lang#87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.)
 - rust-lang#87775 (Add hint for unresolved associated trait items if the trait has a single item)
 - rust-lang#87779 (Remove special case for statement `NodeId` assignment)
 - rust-lang#87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`)
 - rust-lang#87809 (Fix typo in the ptr documentation)
 - rust-lang#87816 (Sync rustc_codegen_cranelift)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Aug 6, 2021
2 parents 24380a6 + 0de0b88 commit 5ad7389
Show file tree
Hide file tree
Showing 55 changed files with 1,008 additions and 652 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ jobs:
- name: Install MinGW toolchain and wine
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
rustup target add x86_64-pc-windows-gnu
- name: Install AArch64 toolchain and qemu
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
- name: Prepare dependencies
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ perf.data.old
/rand
/regex
/simple-raytracer
/stdsimd
48 changes: 24 additions & 24 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = 3

[[package]]
name = "anyhow"
version = "1.0.38"
version = "1.0.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"

[[package]]
name = "ar"
Expand Down Expand Up @@ -34,15 +34,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cranelift-bforest"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"cranelift-entity",
]

[[package]]
name = "cranelift-codegen"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"cranelift-bforest",
"cranelift-codegen-meta",
Expand All @@ -58,7 +58,7 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
Expand All @@ -67,17 +67,17 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"

[[package]]
name = "cranelift-entity"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"

[[package]]
name = "cranelift-frontend"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -88,7 +88,7 @@ dependencies = [
[[package]]
name = "cranelift-jit"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -105,7 +105,7 @@ dependencies = [
[[package]]
name = "cranelift-module"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -116,7 +116,7 @@ dependencies = [
[[package]]
name = "cranelift-native"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"cranelift-codegen",
"libc",
Expand All @@ -126,7 +126,7 @@ dependencies = [
[[package]]
name = "cranelift-object"
version = "0.75.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git?branch=main#c71ad9490e7f3e19bbcae7e28bbe50f8a0b4a5d8"
source = "git+https://github.com/bytecodealliance/wasmtime.git#5deda279775dca5e37449c829cda1f6276d6542b"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -147,34 +147,34 @@ dependencies = [

[[package]]
name = "gimli"
version = "0.24.0"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189"
checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
dependencies = [
"indexmap",
]

[[package]]
name = "hashbrown"
version = "0.9.1"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"

[[package]]
name = "indexmap"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
]

[[package]]
name = "libc"
version = "0.2.97"
version = "0.2.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"

[[package]]
name = "libloading"
Expand Down Expand Up @@ -212,9 +212,9 @@ checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"

[[package]]
name = "object"
version = "0.25.3"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7"
checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386"
dependencies = [
"crc32fast",
"indexmap",
Expand Down Expand Up @@ -277,9 +277,9 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"

[[package]]
name = "target-lexicon"
version = "0.12.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834"
checksum = "b0652da4c4121005e9ed22b79f6c5f2d9e2752906b53a33e9490489ba421a6fb"

[[package]]
name = "winapi"
Expand Down
19 changes: 10 additions & 9 deletions compiler/rustc_codegen_cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", features = ["unwind", "all-arch"] }
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", optional = true }
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", features = ["unwind", "all-arch"] }
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git" }
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git" }
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git" }
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", optional = true }
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git" }
target-lexicon = "0.12.0"
gimli = { version = "0.24.0", default-features = false, features = ["write"]}
object = { version = "0.25.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
gimli = { version = "0.25.0", default-features = false, features = ["write"]}
object = { version = "0.26.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "do_not_remove_cg_clif_ranlib" }
indexmap = "1.0.2"
Expand All @@ -36,7 +36,8 @@ smallvec = "1.6.1"
#gimli = { path = "../" }

[features]
default = ["jit", "inline_asm"]
# Enable features not ready to be enabled when compiling as part of rustc
unstable-features = ["jit", "inline_asm"]
jit = ["cranelift-jit", "libloading"]
inline_asm = []

Expand Down
17 changes: 4 additions & 13 deletions compiler/rustc_codegen_cranelift/build_sysroot/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"

[[package]]
name = "cc"
version = "1.0.68"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"

[[package]]
name = "cfg-if"
Expand Down Expand Up @@ -132,9 +132,9 @@ dependencies = [

[[package]]
name = "libc"
version = "0.2.97"
version = "0.2.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -270,14 +270,6 @@ dependencies = [
"test",
]

[[package]]
name = "term"
version = "0.0.0"
dependencies = [
"core",
"std",
]

[[package]]
name = "test"
version = "0.0.0"
Expand All @@ -290,7 +282,6 @@ dependencies = [
"panic_unwind",
"proc_macro",
"std",
"term",
]

[[package]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::process::Command;

pub(crate) fn build_backend(channel: &str, host_triple: &str) -> PathBuf {
let mut cmd = Command::new("cargo");
cmd.arg("build").arg("--target").arg(host_triple);
cmd.arg("build").arg("--target").arg(host_triple).arg("--features").arg("unstable-features");

match channel {
"debug" => {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ pub(crate) fn build_sysroot(
{
let file = file.unwrap().path();
let file_name_str = file.file_name().unwrap().to_str().unwrap();
if file_name_str.contains("rustc_")
if (file_name_str.contains("rustc_")
&& !file_name_str.contains("rustc_std_workspace_")
&& !file_name_str.contains("rustc_demangle"))
|| file_name_str.contains("chalk")
|| file_name_str.contains("tracing")
|| file_name_str.contains("regex")
Expand Down
13 changes: 8 additions & 5 deletions compiler/rustc_codegen_cranelift/build_system/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ pub(crate) fn prepare() {
"341f207c1071f7290e3f228c710817c280c8dca1",
);

clone_repo(
"stdsimd",
"https://github.com/rust-lang/stdsimd",
"be96995d8ddec03fac9a0caf4d4c51c7fbc33507",
);
apply_patches("stdsimd", Path::new("stdsimd"));

clone_repo(
"simple-raytracer",
"https://github.com/ebobby/simple-raytracer",
Expand Down Expand Up @@ -60,11 +67,7 @@ fn prepare_sysroot() {
copy_dir_recursively(&sysroot_src_orig.join("library"), &sysroot_src.join("library"));

let rustc_version = get_rustc_version();
fs::write(
Path::new("build_sysroot").join("rustc_version"),
&rustc_version,
)
.unwrap();
fs::write(Path::new("build_sysroot").join("rustc_version"), &rustc_version).unwrap();

eprintln!("[GIT] init");
let mut git_init_cmd = Command::new("git");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/clean_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e

rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
rm -rf target/ build/ perf.data{,.old}
rm -rf rand/ regex/ simple-raytracer/
rm -rf rand/ regex/ simple-raytracer/ stdsimd/
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ $cg_clif_dir/build/cargo jit
or

```bash
$ $cg_clif_dir/build/bin/cg_clif -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
$ $cg_clif_dir/build/bin/cg_clif -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
```

There is also an experimental lazy jit mode. In this mode functions are only compiled once they are
Expand All @@ -52,7 +52,7 @@ These are a few functions that allow you to easily run rust code from the shell

```bash
function jit_naked() {
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Cllvm-args=mode=jit -Cprefer-dynamic
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic
}

function jit() {
Expand Down
Loading

0 comments on commit 5ad7389

Please sign in to comment.