Skip to content

Commit e301ae3

Browse files
committed
Build with panic=unwind
1 parent 316f161 commit e301ae3

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

Diff for: build_system/build_sysroot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fn build_clif_sysroot_for_triple(
206206
}
207207

208208
// Build sysroot
209-
let mut rustflags = vec!["-Zforce-unstable-if-unmarked".to_owned(), "-Cpanic=abort".to_owned()];
209+
let mut rustflags = vec!["-Zforce-unstable-if-unmarked".to_owned()];
210210
match cg_clif_dylib_path {
211211
CodegenBackend::Local(path) => {
212212
rustflags.push(format!("-Zcodegen-backend={}", path.to_str().unwrap()));

Diff for: build_system/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ impl<'a> TestRunner<'a> {
404404
cmd.arg("-Cdebuginfo=2");
405405
cmd.arg("--target");
406406
cmd.arg(&self.target_compiler.triple);
407-
cmd.arg("-Cpanic=abort");
408407
cmd.arg("--check-cfg=cfg(jit)");
409408
cmd.args(args);
410409
cmd
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 43c0b573c426ed7945bc25586c494f86b4d93c86 Mon Sep 17 00:00:00 2001
2+
From: bjorn3 <[email protected]>
3+
Date: Wed, 16 Apr 2025 11:52:26 +0000
4+
Subject: [PATCH] Avoid compiling panic_abort
5+
6+
It requires -Cpanic=abort, but cargo doesn't allow setting that for a single crate
7+
---
8+
library/std/Cargo.toml | 1 -
9+
1 file changed, 1 deletion(-)
10+
11+
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
12+
index 176da60..fd90469 100644
13+
--- a/library/std/Cargo.toml
14+
+++ b/library/std/Cargo.toml
15+
@@ -16,7 +16,6 @@ crate-type = ["dylib", "rlib"]
16+
alloc = { path = "../alloc", public = true }
17+
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
18+
panic_unwind = { path = "../panic_unwind", optional = true }
19+
-panic_abort = { path = "../panic_abort" }
20+
core = { path = "../core", public = true }
21+
compiler_builtins = { version = "=0.1.153" }
22+
unwind = { path = "../unwind" }
23+
--
24+
2.43.0
25+

Diff for: scripts/cargo-clif.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
sysroot = sysroot.parent().unwrap();
1313
}
1414

15-
let mut rustflags = vec!["-Cpanic=abort".to_owned(), "-Zpanic-abort-tests".to_owned()];
15+
let mut rustflags = vec![];
1616
if let Some(name) = option_env!("BUILTIN_BACKEND") {
1717
rustflags.push(format!("-Zcodegen-backend={name}"));
1818
} else {

Diff for: scripts/rustc-clif.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ fn main() {
1717

1818
let passed_args = std::env::args_os().skip(1).collect::<Vec<_>>();
1919
let mut args = vec![];
20-
args.push(OsString::from("-Cpanic=abort"));
21-
args.push(OsString::from("-Zpanic-abort-tests"));
2220
if let Some(name) = option_env!("BUILTIN_BACKEND") {
2321
args.push(OsString::from(format!("-Zcodegen-backend={name}")))
2422
} else {

Diff for: scripts/rustdoc-clif.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ fn main() {
1717

1818
let passed_args = std::env::args_os().skip(1).collect::<Vec<_>>();
1919
let mut args = vec![];
20-
args.push(OsString::from("-Cpanic=abort"));
21-
args.push(OsString::from("-Zpanic-abort-tests"));
2220
if let Some(name) = option_env!("BUILTIN_BACKEND") {
2321
args.push(OsString::from(format!("-Zcodegen-backend={name}")))
2422
} else {

0 commit comments

Comments
 (0)