Skip to content

Commit e472b55

Browse files
committed
Merge commit 'c07d1e2f88cb3b1a0604ae8f18b478c1aeb7a7fa' into sync_cg_clif-2023-10-21
1 parent 4519e68 commit e472b55

20 files changed

+163
-493
lines changed

Diff for: .cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ task:
33
freebsd_instance:
44
image: freebsd-13-2-release-amd64
55
setup_rust_script:
6-
- pkg install -y git bash
6+
- pkg install -y git bash binutils
77
- curl https://sh.rustup.rs -sSf --output rustup.sh
88
- sh rustup.sh --default-toolchain none -y --profile=minimal
99
target_cache:

Diff for: .github/workflows/main.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ jobs:
5050
- os: ubuntu-latest
5151
env:
5252
TARGET_TRIPLE: aarch64-unknown-linux-gnu
53-
# s390x requires QEMU 6.1 or greater, we could build it from source, but ubuntu 22.04 comes with 6.2 by default
5453
- os: ubuntu-latest
5554
env:
5655
TARGET_TRIPLE: s390x-unknown-linux-gnu
56+
- os: ubuntu-latest
57+
env:
58+
TARGET_TRIPLE: riscv64gc-unknown-linux-gnu
5759
- os: windows-latest
5860
env:
5961
TARGET_TRIPLE: x86_64-pc-windows-msvc
@@ -92,6 +94,12 @@ jobs:
9294
sudo apt-get update
9395
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
9496
97+
- name: Install riscv64gc toolchain and qemu
98+
if: matrix.env.TARGET_TRIPLE == 'riscv64gc-unknown-linux-gnu'
99+
run: |
100+
sudo apt-get update
101+
sudo apt-get install -y gcc-riscv64-linux-gnu qemu-user
102+
95103
- name: Prepare dependencies
96104
run: ./y.sh prepare
97105

Diff for: Cargo.lock

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.100", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.100" }
13-
cranelift-module = { version = "0.100" }
14-
cranelift-native = { version = "0.100" }
15-
cranelift-jit = { version = "0.100", optional = true }
16-
cranelift-object = { version = "0.100" }
11+
cranelift-codegen = { version = "0.101", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.101" }
13+
cranelift-module = { version = "0.101" }
14+
cranelift-native = { version = "0.101" }
15+
cranelift-jit = { version = "0.101", optional = true }
16+
cranelift-object = { version = "0.101" }
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.28", default-features = false, features = ["write"]}
1919
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

Diff for: build_system/build_sysroot.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::env;
12
use std::fs;
23
use std::path::{Path, PathBuf};
34
use std::process::Command;
@@ -259,6 +260,14 @@ fn build_clif_sysroot_for_triple(
259260
// inlining.
260261
rustflags.push("-Zinline-mir".to_owned());
261262
}
263+
if let Some(prefix) = env::var_os("CG_CLIF_STDLIB_REMAP_PATH_PREFIX") {
264+
rustflags.push("--remap-path-prefix".to_owned());
265+
rustflags.push(format!(
266+
"{}={}",
267+
STDLIB_SRC.to_path(dirs).to_str().unwrap(),
268+
prefix.to_str().unwrap()
269+
));
270+
}
262271
compiler.rustflags.extend(rustflags);
263272
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);
264273
maybe_incremental(&mut build_cmd);

Diff for: build_system/prepare.rs

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ impl GitRepo {
143143
RelPath::PATCHES.to_path(dirs).join(format!("{}-lock.toml", self.patch_name));
144144
let target_lockfile = download_dir.join("Cargo.lock");
145145
if source_lockfile.exists() {
146+
assert!(!target_lockfile.exists());
146147
fs::copy(source_lockfile, target_lockfile).unwrap();
147148
} else {
148149
assert!(target_lockfile.exists());

Diff for: build_system/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
104104
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
105105
"rust-random",
106106
"rand",
107-
"f3dd0b885c4597b9617ca79987a0dd899ab29fcb",
108-
"3f869e4fcd602b66",
107+
"9a02c819cc1e4ec6959ae25eafbb5cf6acb68234",
108+
"4934f0afb1d1c2ca",
109109
"rand",
110110
);
111111

@@ -125,7 +125,7 @@ pub(crate) static PORTABLE_SIMD_REPO: GitRepo = GitRepo::github(
125125
"rust-lang",
126126
"portable-simd",
127127
"4825b2a64d765317066948867e8714674419359b",
128-
"8b188cc41f5af835",
128+
"9e67d07c00f5fb0b",
129129
"portable-simd",
130130
);
131131

Diff for: build_system/utils.rs

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ impl Compiler {
4242
"/usr/s390x-linux-gnu".to_owned(),
4343
];
4444
}
45+
"riscv64gc-unknown-linux-gnu" => {
46+
// We are cross-compiling for riscv64. Use the correct linker and run tests in qemu.
47+
self.rustflags.push("-Clinker=riscv64-linux-gnu-gcc".to_owned());
48+
self.rustdocflags.push("-Clinker=riscv64-linux-gnu-gcc".to_owned());
49+
self.runner = vec![
50+
"qemu-riscv64".to_owned(),
51+
"-L".to_owned(),
52+
"/usr/riscv64-linux-gnu".to_owned(),
53+
];
54+
}
4555
"x86_64-pc-windows-gnu" => {
4656
// We are cross-compiling for Windows. Run tests in wine.
4757
self.runner = vec!["wine".to_owned()];

Diff for: patches/0002-rand-Disable-failing-test.patch

-24
This file was deleted.

Diff for: patches/0003-rand-Disable-rand-tests-on-mingw.patch

-47
This file was deleted.

0 commit comments

Comments
 (0)