Skip to content

Commit 90e1400

Browse files
committed
Merge ref '73e6c9ebd912' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 73e6c9ebd9123154a196300ef58e30ec8928e74e Filtered ref: e8bb3cae4cd2b04bdc252cdf79102717db2b2d8d Upstream diff: rust-lang/rust@32e7a4b...73e6c9e This merge was created using https://github.com/rust-lang/josh-sync.
2 parents d7c4315 + 138789e commit 90e1400

42 files changed

Lines changed: 539 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/m68k.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,16 @@ jobs:
8282
- name: Build sample project with target defined as JSON spec
8383
run: |
8484
./y.sh prepare --only-libcore --cross
85-
./y.sh build --sysroot --features compiler-builtins-no-f16-f128 --target-triple m68k-unknown-linux-gnu --target ${{ github.workspace }}/target_specs/m68k-unknown-linux-gnu.json
85+
./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu --target ${{ github.workspace }}/target_specs/m68k-unknown-linux-gnu.json
8686
CG_RUSTFLAGS="-Clinker=m68k-unknown-linux-gnu-gcc" ./y.sh cargo build --manifest-path=./tests/hello-world/Cargo.toml --target ${{ github.workspace }}/target_specs/m68k-unknown-linux-gnu.json
8787
./y.sh clean all
8888
8989
- name: Build
9090
run: |
9191
./y.sh prepare --only-libcore --cross
92-
./y.sh build --sysroot --features compiler-builtins-no-f16-f128 --target-triple m68k-unknown-linux-gnu
92+
./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu
9393
./y.sh test --mini-tests --target-triple m68k-unknown-linux-gnu
94-
# FIXME: since https://github.com/rust-lang/rust/pull/140809, we cannot run programs for architectures not
95-
# supported by the object crate, since this adds a dependency on symbols.o for the panic runtime.
96-
# And as such, a wrong order of the object files in the linker command now fails with an undefined reference
97-
# to some symbols like __rustc::rust_panic.
98-
#CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu ./y.sh test --cargo-tests --target-triple m68k-unknown-linux-gnu
94+
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu ./y.sh test --cargo-tests --target-triple m68k-unknown-linux-gnu
9995
./y.sh clean all
10096
10197
- name: Prepare dependencies
@@ -104,23 +100,21 @@ jobs:
104100
git config --global user.name "User"
105101
./y.sh prepare --cross
106102
107-
# FIXME: We cannot run programs for architectures not supported by the object crate. See comment above.
108-
#- name: Run tests
109-
#run: |
110-
#./y.sh test --target-triple m68k-unknown-linux-gnu --release --clean --build-sysroot --sysroot-features compiler-builtins-no-f16-f128 ${{ matrix.commands }}
111-
112-
# FIXME: We cannot run programs for architectures not supported by the object crate. See comment above.
113-
#- name: Run Hello World!
114-
#run: |
115-
#./y.sh build --target-triple m68k-unknown-linux-gnu
116-
117-
#vm_dir=$(pwd)/vm
118-
#cd tests/hello-world
119-
#CG_RUSTFLAGS="-Clinker=m68k-unknown-linux-gnu-gcc" ../../y.sh cargo build --target m68k-unknown-linux-gnu
120-
#sudo cp target/m68k-unknown-linux-gnu/debug/hello_world $vm_dir/home/
121-
#sudo chroot $vm_dir qemu-m68k-static /home/hello_world > hello_world_stdout
122-
#expected_output="40"
123-
#test $(cat hello_world_stdout) == $expected_output || (echo "Output differs. Actual output: $(cat hello_world_stdout)"; exit 1)
103+
- name: Run tests
104+
run: |
105+
./y.sh test --target-triple m68k-unknown-linux-gnu --release --clean --build-sysroot ${{ matrix.commands }}
106+
107+
- name: Run Hello World!
108+
run: |
109+
./y.sh build --target-triple m68k-unknown-linux-gnu
110+
111+
vm_dir=$(pwd)/vm
112+
cd tests/hello-world
113+
CG_RUSTFLAGS="-Clinker=m68k-unknown-linux-gnu-gcc" ../../y.sh cargo build --target m68k-unknown-linux-gnu
114+
sudo cp target/m68k-unknown-linux-gnu/debug/hello_world $vm_dir/home/
115+
sudo chroot $vm_dir qemu-m68k-static /home/hello_world > hello_world_stdout
116+
expected_output="40"
117+
test $(cat hello_world_stdout) == $expected_output || (echo "Output differs. Actual output: $(cat hello_world_stdout)"; exit 1)
124118
125119
# Summary job for the merge queue.
126120
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!

Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "2.7.0"
59+
version = "2.9.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "ae99a89184220d967dd300139f2d2ae7d52c1a69d632b24aacc57c54625254ce"
61+
checksum = "4a0e310ef75f396cd11b2443b353d55376656ca92c13cba36f92b7aff346ac1a"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "0.8.0"
68+
version = "0.8.2"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "24edb7bfe2b7b27c6d09ed23eebfcab0b359c8fe978433f902943e6f127a0f1b"
70+
checksum = "95ed7572b30cd32430294dde6fb70822d58e67c6846a548647e8739776a0125b"
7171
dependencies = [
7272
"libc",
7373
]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default = ["master"]
2424
[dependencies]
2525
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
2626
tempfile = "3.20"
27-
gccjit = "2.7"
27+
gccjit = "2.8"
2828
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs" }
2929

3030
# Local copy.

build_system/src/abi_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn run() -> Result<(), String> {
3131
Some("clones/abi-cafe".as_ref()),
3232
true,
3333
)
34-
.map_err(|err| (format!("Git clone failed with message: {err:?}!")))?;
34+
.map_err(|err| format!("Git clone failed with message: {err:?}!"))?;
3535
// Configure abi-cafe to use the exact same rustc version we use - this is crucial.
3636
// Otherwise, the concept of ABI compatibility becomes meanignless.
3737
std::fs::copy("rust-toolchain", "clones/abi-cafe/rust-toolchain")

build_system/src/fmt.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ffi::OsStr;
22
use std::path::Path;
33

4-
use crate::utils::run_command_with_output;
4+
use crate::utils::{run_command_with_output, walk_dir};
55

66
fn show_usage() {
77
println!(
@@ -32,5 +32,31 @@ pub fn run() -> Result<(), String> {
3232
if check { &[&"cargo", &"fmt", &"--check"] } else { &[&"cargo", &"fmt"] };
3333

3434
run_command_with_output(cmd, Some(Path::new(".")))?;
35-
run_command_with_output(cmd, Some(Path::new("build_system")))
35+
run_command_with_output(cmd, Some(Path::new("build_system")))?;
36+
37+
run_rustfmt_recursively("tests/run", check)
38+
}
39+
40+
fn run_rustfmt_recursively<P>(dir: P, check: bool) -> Result<(), String>
41+
where
42+
P: AsRef<Path>,
43+
{
44+
walk_dir(
45+
dir,
46+
&mut |dir| run_rustfmt_recursively(dir, check),
47+
&mut |file_path| {
48+
if file_path.extension().filter(|ext| ext == &OsStr::new("rs")).is_some() {
49+
let rustfmt_cmd: &[&dyn AsRef<OsStr>] = if check {
50+
&[&"rustfmt", &"--check", &file_path]
51+
} else {
52+
&[&"rustfmt", &file_path]
53+
};
54+
55+
run_command_with_output(rustfmt_cmd, Some(Path::new(".")))
56+
} else {
57+
Ok(())
58+
}
59+
},
60+
true,
61+
)
3662
}

build_system/src/fuzz.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ pub fn run() -> Result<(), String> {
4343
"--start" => {
4444
start =
4545
str::parse(&args.next().ok_or_else(|| "Fuzz start not provided!".to_string())?)
46-
.map_err(|err| (format!("Fuzz start not a number {err:?}!")))?;
46+
.map_err(|err| format!("Fuzz start not a number {err:?}!"))?;
4747
}
4848
"--count" => {
4949
count =
5050
str::parse(&args.next().ok_or_else(|| "Fuzz count not provided!".to_string())?)
51-
.map_err(|err| (format!("Fuzz count not a number {err:?}!")))?;
51+
.map_err(|err| format!("Fuzz count not a number {err:?}!"))?;
5252
}
5353
"-j" | "--jobs" => {
5454
threads = str::parse(
5555
&args.next().ok_or_else(|| "Fuzz thread count not provided!".to_string())?,
5656
)
57-
.map_err(|err| (format!("Fuzz thread count not a number {err:?}!")))?;
57+
.map_err(|err| format!("Fuzz thread count not a number {err:?}!"))?;
5858
}
5959
_ => return Err(format!("Unknown option {arg}")),
6060
}
@@ -66,7 +66,7 @@ pub fn run() -> Result<(), String> {
6666
Some("clones/rustlantis".as_ref()),
6767
true,
6868
)
69-
.map_err(|err| (format!("Git clone failed with message: {err:?}!")))?;
69+
.map_err(|err| format!("Git clone failed with message: {err:?}!"))?;
7070

7171
// Ensure that we are on the newest rustlantis commit.
7272
let cmd: &[&dyn AsRef<OsStr>] = &[&"git", &"pull", &"origin"];

build_system/src/test.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
531531
r#"change-id = 115898
532532
533533
[rust]
534-
codegen-backends = []
534+
codegen-backends = ["gcc"]
535535
deny-warnings = false
536536
verbose-tests = true
537537
@@ -1083,27 +1083,36 @@ where
10831083

10841084
fn test_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
10851085
test_rustc_inner(env, args, |_| Ok(false), false, "run-make")?;
1086+
test_rustc_inner(env, args, |_| Ok(false), false, "run-make-cargo")?;
10861087
test_rustc_inner(env, args, |_| Ok(false), false, "ui")
10871088
}
10881089

10891090
fn test_failing_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
1090-
let result1 = test_rustc_inner(
1091+
let run_make_result = test_rustc_inner(
10911092
env,
10921093
args,
10931094
retain_files_callback("tests/failing-run-make-tests.txt", "run-make"),
10941095
false,
10951096
"run-make",
10961097
);
10971098

1098-
let result2 = test_rustc_inner(
1099+
let run_make_cargo_result = test_rustc_inner(
1100+
env,
1101+
args,
1102+
retain_files_callback("tests/failing-run-make-tests.txt", "run-make-cargo"),
1103+
false,
1104+
"run-make",
1105+
);
1106+
1107+
let ui_result = test_rustc_inner(
10991108
env,
11001109
args,
11011110
retain_files_callback("tests/failing-ui-tests.txt", "ui"),
11021111
false,
11031112
"ui",
11041113
);
11051114

1106-
result1.and(result2)
1115+
run_make_result.and(run_make_cargo_result).and(ui_result)
11071116
}
11081117

11091118
fn test_successful_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
@@ -1120,6 +1129,13 @@ fn test_successful_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
11201129
remove_files_callback("tests/failing-run-make-tests.txt", "run-make"),
11211130
false,
11221131
"run-make",
1132+
)?;
1133+
test_rustc_inner(
1134+
env,
1135+
args,
1136+
remove_files_callback("tests/failing-run-make-tests.txt", "run-make-cargo"),
1137+
false,
1138+
"run-make-cargo",
11231139
)
11241140
}
11251141

libgccjit.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
04ce66d8c918de9273bd7101638ad8724edf5e21
1+
4e995bd73c4490edfe5080ec6014d63aa9abed5f

messages.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ codegen_gcc_unwinding_inline_asm =
44
codegen_gcc_copy_bitcode = failed to copy bitcode to object file: {$err}
55
66
codegen_gcc_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$gcc_err})
7+
8+
codegen_gcc_explicit_tail_calls_unsupported = explicit tail calls with the 'become' keyword are not implemented in the GCC backend
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
From b8f3eed3053c9333b5dfbeaeb2a6a65a4b3156df Mon Sep 17 00:00:00 2001
2-
From: Antoni Boucher <bouanto@zoho.com>
3-
Date: Tue, 29 Aug 2023 13:06:34 -0400
1+
From 190e26c9274b3c93a9ee3516b395590e6bd9213b Mon Sep 17 00:00:00 2001
2+
From: None <none@example.com>
3+
Date: Sun, 3 Aug 2025 19:54:56 -0400
44
Subject: [PATCH] Patch 0001-Add-stdarch-Cargo.toml-for-testing.patch
55

66
---
7-
library/stdarch/Cargo.toml | 23 +++++++++++++++++++++++
8-
1 file changed, 23 insertions(+)
7+
library/stdarch/Cargo.toml | 20 ++++++++++++++++++++
8+
1 file changed, 20 insertions(+)
99
create mode 100644 library/stdarch/Cargo.toml
1010

1111
diff --git a/library/stdarch/Cargo.toml b/library/stdarch/Cargo.toml
1212
new file mode 100644
13-
index 0000000..4c63700
13+
index 0000000..bd6725c
1414
--- /dev/null
1515
+++ b/library/stdarch/Cargo.toml
16-
@@ -0,0 +1,21 @@
16+
@@ -0,0 +1,20 @@
1717
+[workspace]
1818
+resolver = "1"
1919
+members = [
20-
+ "crates/core_arch",
21-
+ "crates/std_detect",
22-
+ "crates/stdarch-gen-arm",
20+
+ "crates/*",
2321
+ #"examples/"
2422
+]
2523
+exclude = [
26-
+ "crates/wasm-assert-instr-tests"
24+
+ "crates/wasm-assert-instr-tests",
25+
+ "rust_programs",
2726
+]
2827
+
2928
+[profile.release]
@@ -36,5 +35,5 @@ index 0000000..4c63700
3635
+opt-level = 3
3736
+incremental = true
3837
--
39-
2.42.0
38+
2.50.1
4039

0 commit comments

Comments
 (0)