Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync rustc_codegen_cranelift #117031

Merged
merged 33 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5d85a24
Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into sync_cg_…
bjorn3 Oct 9, 2023
269917b
Merge branch 'sync_from_rust'
bjorn3 Oct 9, 2023
ed2f5ba
Reuse determine_cgu_reuse from cg_ssa in cg_clif
bjorn3 Sep 16, 2023
e006e2c
Remove cgu_reuse_tracker from Session
bjorn3 Sep 19, 2023
3c0d3f2
Fix review comments
bjorn3 Oct 5, 2023
abc9f0d
Update rand test
bjorn3 Oct 14, 2023
f068314
Remove portable-simd custom lock file
bjorn3 Oct 14, 2023
62bf33a
Ensure we don't overwrite an existing Cargo.lock when fetching an ext…
bjorn3 Oct 14, 2023
4a24ecc
Remove no longer necessary rand patch
bjorn3 Oct 14, 2023
5a9b81a
Re-enable a bunch of fixed rustc tests
bjorn3 Oct 14, 2023
ca53d2e
Change producer string to have the rustc producer string as prefix
bjorn3 Oct 14, 2023
ba0f7e3
Install binutils on FreeBSD CI to get an assembler
bjorn3 Oct 15, 2023
8c3eda3
docs: add Rust logo to more compiler crates
notriddle Oct 16, 2023
2f461b7
[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopes
Urgau Aug 23, 2023
5f2d3ac
Sync from rust 0039d739d40a076334e111488946441378d11cd7
bjorn3 Oct 19, 2023
bdc597d
Rustup to rustc 1.75.0-nightly (0039d739d 2023-10-18)
bjorn3 Oct 19, 2023
b972010
Fix CG_CLIF_DISABLE_INCR_CACHE
bjorn3 Oct 19, 2023
49987fa
Fix rustc test suite
bjorn3 Oct 19, 2023
14e66db
Update Cranelift to 0.101.0
bjorn3 Oct 6, 2023
8e264ab
s/Generator/Coroutine/
oli-obk Oct 19, 2023
4519e68
s/generator/coroutine/
oli-obk Oct 19, 2023
f414e26
Sync from rust 249624b5043013d18c00f0401ca431c1a6baa8cd
bjorn3 Oct 21, 2023
2f74b68
Rustup to rustc 1.75.0-nightly (249624b50 2023-10-20)
bjorn3 Oct 21, 2023
04a3850
Run tests for riscv64
bjorn3 Oct 6, 2023
453ce49
Support inline asm on riscv64
bjorn3 Oct 8, 2023
46388c1
Re-enable all inline asm usage for the rustc tests
bjorn3 Oct 21, 2023
55cc776
Introduce asm_supported() helper
bjorn3 Oct 21, 2023
eb30083
Fix epilogue_noreturn for AArch64
bjorn3 Oct 21, 2023
78cd77f
Give better error for unsupported asm!()
bjorn3 Oct 21, 2023
1848d25
Add shim for core::hint::spin_loop() on riscv64
bjorn3 Oct 21, 2023
62f6e84
Merge pull request #1398 from bjorn3/riscv_support
bjorn3 Oct 21, 2023
c07d1e2
Use same --remap-path-prefix as bootstrap for testing the rustc test …
bjorn3 Oct 21, 2023
e07f47b
Merge commit 'c07d1e2f88cb3b1a0604ae8f18b478c1aeb7a7fa' into sync_cg_…
bjorn3 Oct 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/.cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ task:
freebsd_instance:
image: freebsd-13-2-release-amd64
setup_rust_script:
- pkg install -y git bash
- pkg install -y git bash binutils
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain none -y --profile=minimal
target_cache:
Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ jobs:
- os: ubuntu-latest
env:
TARGET_TRIPLE: aarch64-unknown-linux-gnu
# s390x requires QEMU 6.1 or greater, we could build it from source, but ubuntu 22.04 comes with 6.2 by default
- os: ubuntu-latest
env:
TARGET_TRIPLE: s390x-unknown-linux-gnu
- os: ubuntu-latest
env:
TARGET_TRIPLE: riscv64gc-unknown-linux-gnu
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-msvc
Expand Down Expand Up @@ -92,6 +94,12 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user

- name: Install riscv64gc toolchain and qemu
if: matrix.env.TARGET_TRIPLE == 'riscv64gc-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-riscv64-linux-gnu qemu-user

- name: Prepare dependencies
run: ./y.sh prepare

Expand Down
52 changes: 26 additions & 26 deletions compiler/rustc_codegen_cranelift/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "cranelift-bforest"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03b9d1a9e776c27ad55d7792a380785d1fe8c2d7b099eed8dbd8f4af2b598192"
checksum = "8e5e1df0da8488dd03b34afc134ba84b754d61862cc465932a9e5d07952f661e"
dependencies = [
"cranelift-entity",
]

[[package]]
name = "cranelift-codegen"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5528483314c2dd5da438576cd8a9d0b3cedad66fb8a4727f90cd319a81950038"
checksum = "77a17ca4e699a0aaf49a0c88f6311a864f321048aa63f6b787cab20eb5f93f10"
dependencies = [
"bumpalo",
"cranelift-bforest",
Expand All @@ -75,39 +75,39 @@ dependencies = [

[[package]]
name = "cranelift-codegen-meta"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f46a8318163f7682e35b8730ba93c1b586a2da8ce12a0ed545efc1218550f70"
checksum = "022f2793cdade1d37a1f755ac42938a3f832f533eac6cafc8b26b209544c3c06"
dependencies = [
"cranelift-codegen-shared",
]

[[package]]
name = "cranelift-codegen-shared"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37d1239cfd50eecfaed468d46943f8650e32969591868ad50111613704da6c70"
checksum = "a4d72dbb83c2ad788dec4ad0843070973cb48c35a3ca19b1e7437ac40834fd9c"

[[package]]
name = "cranelift-control"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcc530560c8f16cc1d4dd7ea000c56f519c60d1a914977abe849ce555c35a61d"
checksum = "ae07cf26dcc90d546826d747ac63b6c40c916f34b03e92a6ae0422c28d771b8a"
dependencies = [
"arbitrary",
]

[[package]]
name = "cranelift-entity"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f333fa641a9ad2bff0b107767dcb972c18c2bfab7969805a1d7e42449ccb0408"
checksum = "c2fe6b7e49820893691aea497f36257e9d6f52061d8c4758d61d802d5f101a3d"

[[package]]
name = "cranelift-frontend"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abf6563015a80f03f8bc4df307d0a81363f4eb73108df3a34f6e66fb6d5307"
checksum = "44f497576ca3674581581601b6a55ccc1b43447217648c880e5bce70db3cf659"
dependencies = [
"cranelift-codegen",
"log",
Expand All @@ -117,15 +117,15 @@ dependencies = [

[[package]]
name = "cranelift-isle"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eb29d0edc8a5c029ed0f7ca77501f272738e3c410020b4a00f42ffe8ad2a8aa"
checksum = "b96aa02eac00fffee13b0cd37d17874ccdb3d5458983041accd825ef78ce6454"

[[package]]
name = "cranelift-jit"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d16e8c5e212b1e63658aada17553497e7a259acab61f044d1f185527efa609fb"
checksum = "b1d6e0e308c873eefc185745a6b21daec2a10f7554c9fb67e334c2d7d756d979"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -143,9 +143,9 @@ dependencies = [

[[package]]
name = "cranelift-module"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3b5fd273e1a959e920c7a9d790b1646d31acc8782bb549bad5ab85dd2fc9aa7"
checksum = "c1aa8ebb06eced4e478c3f94f1d65d4e7c93493f4640057912b27a3e34b84841"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand All @@ -154,9 +154,9 @@ dependencies = [

[[package]]
name = "cranelift-native"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "006056a7fa920870bad06bf8e1b3033d70cbb7ee625b035efa9d90882a931868"
checksum = "2870170ca44054b202c737626607b87be6e35655084bd94a6ff807a5812ba7df"
dependencies = [
"cranelift-codegen",
"libc",
Expand All @@ -165,9 +165,9 @@ dependencies = [

[[package]]
name = "cranelift-object"
version = "0.100.0"
version = "0.101.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8be1b0e7720f30fec31be0c0b0b23caef2a73fa751190c6a251c1362e8f8c9"
checksum = "20647761742d17dabac8205da958910ede78599550e06418a16711a3ee2fc897"
dependencies = [
"anyhow",
"cranelift-codegen",
Expand Down Expand Up @@ -374,9 +374,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "wasmtime-jit-icache-coherence"
version = "13.0.0"
version = "14.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6ff5f3707a5e3797deeeeac6ac26b2e1dd32dbc06693c0ab52e8ac4d18ec706"
checksum = "a3a5dda53ad6993f9b0a2d65fb49e0348a7232a27a8794064122870d6ee19eb2"
dependencies = [
"cfg-if",
"libc",
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_codegen_cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ crate-type = ["dylib"]

[dependencies]
# These have to be in sync with each other
cranelift-codegen = { version = "0.100", features = ["unwind", "all-arch"] }
cranelift-frontend = { version = "0.100" }
cranelift-module = { version = "0.100" }
cranelift-native = { version = "0.100" }
cranelift-jit = { version = "0.100", optional = true }
cranelift-object = { version = "0.100" }
cranelift-codegen = { version = "0.101", features = ["unwind", "all-arch"] }
cranelift-frontend = { version = "0.101" }
cranelift-module = { version = "0.101" }
cranelift-native = { version = "0.101" }
cranelift-jit = { version = "0.101", optional = true }
cranelift-object = { version = "0.101" }
target-lexicon = "0.12.0"
gimli = { version = "0.28", default-features = false, features = ["write"]}
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
Expand Down Expand Up @@ -259,6 +260,14 @@ fn build_clif_sysroot_for_triple(
// inlining.
rustflags.push("-Zinline-mir".to_owned());
}
if let Some(prefix) = env::var_os("CG_CLIF_STDLIB_REMAP_PATH_PREFIX") {
rustflags.push("--remap-path-prefix".to_owned());
rustflags.push(format!(
"{}={}",
STDLIB_SRC.to_path(dirs).to_str().unwrap(),
prefix.to_str().unwrap()
));
}
compiler.rustflags.extend(rustflags);
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);
maybe_incremental(&mut build_cmd);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/build_system/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ impl GitRepo {
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
let target_lockfile = download_dir.join("Cargo.lock");
if source_lockfile.exists() {
assert!(!target_lockfile.exists());
fs::copy(source_lockfile, target_lockfile).unwrap();
} else {
assert!(target_lockfile.exists());
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_cranelift/build_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
"rust-random",
"rand",
"f3dd0b885c4597b9617ca79987a0dd899ab29fcb",
"3f869e4fcd602b66",
"9a02c819cc1e4ec6959ae25eafbb5cf6acb68234",
"4934f0afb1d1c2ca",
"rand",
);

Expand All @@ -125,7 +125,7 @@ pub(crate) static PORTABLE_SIMD_REPO: GitRepo = GitRepo::github(
"rust-lang",
"portable-simd",
"4825b2a64d765317066948867e8714674419359b",
"8b188cc41f5af835",
"9e67d07c00f5fb0b",
"portable-simd",
);

Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_codegen_cranelift/build_system/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ impl Compiler {
"/usr/s390x-linux-gnu".to_owned(),
];
}
"riscv64gc-unknown-linux-gnu" => {
// We are cross-compiling for riscv64. Use the correct linker and run tests in qemu.
self.rustflags.push("-Clinker=riscv64-linux-gnu-gcc".to_owned());
self.rustdocflags.push("-Clinker=riscv64-linux-gnu-gcc".to_owned());
self.runner = vec![
"qemu-riscv64".to_owned(),
"-L".to_owned(),
"/usr/riscv64-linux-gnu".to_owned(),
];
}
"x86_64-pc-windows-gnu" => {
// We are cross-compiling for Windows. Run tests in wine.
self.runner = vec!["wine".to_owned()];
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading