Skip to content

Commit 5ec45d3

Browse files
committed
Merge commit '54cbb6e7531f95e086d5c3dd0d5e73bfbe3545ba' into sync_cg_clif-2024-03-08
1 parent 5ffd498 commit 5ec45d3

19 files changed

+308
-121
lines changed

.github/workflows/main.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ jobs:
4444
env:
4545
TARGET_TRIPLE: x86_64-apple-darwin
4646
# cross-compile from Linux to Windows using mingw
47-
- os: ubuntu-latest
48-
env:
49-
TARGET_TRIPLE: x86_64-pc-windows-gnu
47+
# FIXME The wine version in Ubuntu 22.04 is missing ProcessPrng
48+
#- os: ubuntu-latest
49+
# env:
50+
# TARGET_TRIPLE: x86_64-pc-windows-gnu
5051
- os: ubuntu-latest
5152
env:
5253
TARGET_TRIPLE: aarch64-unknown-linux-gnu
@@ -80,11 +81,11 @@ jobs:
8081
if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
8182
run: rustup set default-host x86_64-pc-windows-gnu
8283

83-
- name: Install MinGW toolchain and wine
84-
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
85-
run: |
86-
sudo apt-get update
87-
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
84+
#- name: Install MinGW toolchain and wine
85+
# if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
86+
# run: |
87+
# sudo apt-get update
88+
# sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
8889

8990
- name: Install AArch64 toolchain and qemu
9091
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'

.gitignore

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
/target
2-
/build_system/target
3-
**/*.rs.bk
4-
*.rlib
5-
*.o
6-
perf.data
7-
perf.data.old
8-
*.events
9-
*.string*
1+
# Build artifacts during normal use
102
/y.bin
113
/y.bin.dSYM
124
/y.exe
135
/y.pdb
6+
/download
147
/build
158
/dist
9+
/target
10+
/build_system/target
11+
12+
# Downloaded by certain scripts
1613
/rust
17-
/download
1814
/git-fixed-subtree.sh
15+
16+
# Various things that can be created during development
17+
*.rlib
18+
*.o
19+
perf.data
20+
perf.data.old
21+
*.mm_profdata

Cargo.lock

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

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.104", default-features = false, features = ["std", "unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.104" }
13-
cranelift-module = { version = "0.104" }
14-
cranelift-native = { version = "0.104" }
15-
cranelift-jit = { version = "0.104", optional = true }
16-
cranelift-object = { version = "0.104" }
11+
cranelift-codegen = { version = "0.105.2", default-features = false, features = ["std", "unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.105.2" }
13+
cranelift-module = { version = "0.105.2" }
14+
cranelift-native = { version = "0.105.2" }
15+
cranelift-jit = { version = "0.105.2", optional = true }
16+
cranelift-object = { version = "0.105.2" }
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"] }

Readme.md

-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ You need to do this steps to successfully compile and use the cranelift backend
123123

124124
You can also set `rust-analyzer.rustc.source` to your rust workspace to get rust-analyzer to understand your changes.
125125

126-
## Configuration
127-
128-
See the documentation on the `BackendConfig` struct in [config.rs](src/config.rs) for all
129-
configuration options.
130-
131126
## Not yet supported
132127

133128
* SIMD ([tracked here](https://github.com/rust-lang/rustc_codegen_cranelift/issues/171), `std::simd` fully works, `std::arch` is partially supported)

build_system/prepare.rs

+21-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::ffi::OsStr;
22
use std::fs;
3+
use std::hash::{Hash, Hasher};
34
use std::path::{Path, PathBuf};
45
use std::process::Command;
56

@@ -71,7 +72,11 @@ fn hash_file(file: &std::path::Path) -> u64 {
7172
let contents = std::fs::read(file).unwrap();
7273
#[allow(deprecated)]
7374
let mut hasher = std::hash::SipHasher::new();
74-
std::hash::Hash::hash(&contents, &mut hasher);
75+
// The following is equivalent to
76+
// std::hash::Hash::hash(&contents, &mut hasher);
77+
// but gives the same result independent of host byte order.
78+
hasher.write_usize(contents.len().to_le());
79+
Hash::hash_slice(&contents, &mut hasher);
7580
std::hash::Hasher::finish(&hasher)
7681
}
7782

@@ -80,16 +85,26 @@ fn hash_dir(dir: &std::path::Path) -> u64 {
8085
for entry in std::fs::read_dir(dir).unwrap() {
8186
let entry = entry.unwrap();
8287
if entry.file_type().unwrap().is_dir() {
83-
sub_hashes
84-
.insert(entry.file_name().to_str().unwrap().to_owned(), hash_dir(&entry.path()));
88+
sub_hashes.insert(
89+
entry.file_name().to_str().unwrap().to_owned(),
90+
hash_dir(&entry.path()).to_le(),
91+
);
8592
} else {
86-
sub_hashes
87-
.insert(entry.file_name().to_str().unwrap().to_owned(), hash_file(&entry.path()));
93+
sub_hashes.insert(
94+
entry.file_name().to_str().unwrap().to_owned(),
95+
hash_file(&entry.path()).to_le(),
96+
);
8897
}
8998
}
9099
#[allow(deprecated)]
91100
let mut hasher = std::hash::SipHasher::new();
92-
std::hash::Hash::hash(&sub_hashes, &mut hasher);
101+
// The following is equivalent to
102+
// std::hash::Hash::hash(&sub_hashes, &mut hasher);
103+
// but gives the same result independent of host byte order.
104+
hasher.write_usize(sub_hashes.len().to_le());
105+
for elt in sub_hashes {
106+
elt.hash(&mut hasher);
107+
}
93108
std::hash::Hasher::finish(&hasher)
94109
}
95110

build_system/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ pub(crate) static REGEX: CargoProject = CargoProject::new(&REGEX_REPO.source_dir
133133
pub(crate) static PORTABLE_SIMD_REPO: GitRepo = GitRepo::github(
134134
"rust-lang",
135135
"portable-simd",
136-
"97007cc2e70df8c97326ce896a79e2f0ce4dd98b",
137-
"e54a16035cedf205",
136+
"5794c837bc605c4cd9dbb884285976dfdb293cce",
137+
"a64d8fdd0ed0d9c4",
138138
"portable-simd",
139139
);
140140

patches/0022-coretests-Disable-not-compiling-tests.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ index 42a26ae..5ac1042 100644
3939
+#![cfg(test)]
4040
#![feature(alloc_layout_extra)]
4141
#![feature(array_chunks)]
42-
#![feature(array_methods)]
42+
#![feature(array_windows)]
4343
--
4444
2.21.0 (Apple Git-122)

patches/0023-coretests-Ignore-failing-tests.patch

-26
This file was deleted.

patches/stdlib-lock.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ dependencies = [
150150

151151
[[package]]
152152
name = "hermit-abi"
153-
version = "0.3.3"
153+
version = "0.3.9"
154154
source = "registry+https://github.com/rust-lang/crates.io-index"
155-
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
155+
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
156156
dependencies = [
157157
"compiler_builtins",
158158
"rustc-std-workspace-alloc",
@@ -161,9 +161,9 @@ dependencies = [
161161

162162
[[package]]
163163
name = "libc"
164-
version = "0.2.150"
164+
version = "0.2.153"
165165
source = "registry+https://github.com/rust-lang/crates.io-index"
166-
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
166+
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
167167
dependencies = [
168168
"rustc-std-workspace-core",
169169
]
@@ -398,6 +398,7 @@ version = "0.0.0"
398398
dependencies = [
399399
"core",
400400
"getopts",
401+
"libc",
401402
"panic_abort",
402403
"panic_unwind",
403404
"std",

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-01-26"
2+
channel = "nightly-2024-03-08"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

rustfmt.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ignore = [
2-
"y.rs",
32
"example/gen_block_iterate.rs", # uses edition 2024
43
]
54

0 commit comments

Comments
 (0)