Rollup merge of #116263 - ferrocene:pa-more-bare-metal-fixes, r=oli-obk

More fixes for running the test suite on a bare metal target

This PR adds more fixes needed to run the test suite on bare metal targets (in this case, without unwinding and with static relocations). There is no CI job exercising tests without unwinds, but I can confirm this worked in Ferrocene's CI.
This commit is contained in:
Matthias Krüger 2023-09-29 22:27:52 +02:00 committed by GitHub
commit 3ee2c526df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 4 deletions

View File

@ -580,6 +580,8 @@ pub struct TargetCfg {
pub(crate) sanitizers: Vec<Sanitizer>,
#[serde(rename = "supports-xray", default)]
pub(crate) xray: bool,
#[serde(default = "default_reloc_model")]
pub(crate) relocation_model: String,
}
impl TargetCfg {
@ -592,6 +594,10 @@ fn default_os() -> String {
"none".into()
}
fn default_reloc_model() -> String {
"pic".into()
}
#[derive(Eq, PartialEq, Clone, Debug, Default, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Endian {

View File

@ -134,6 +134,11 @@ pub(super) fn handle_needs(
condition: config.target_cfg().dynamic_linking,
ignore_reason: "ignored on targets without dynamic linking",
},
Need {
name: "needs-relocation-model-pic",
condition: config.target_cfg().relocation_model == "pic",
ignore_reason: "ignored on targets without PIC relocation model",
},
];
let (name, comment) = match ln.split_once([':', ' ']) {

View File

@ -5,6 +5,7 @@
// needs-unwind
// revisions:cfail1 cfail2
// compile-flags: -Z query-dep-graph -Cpanic=unwind
// needs-unwind
// build-pass (FIXME(62277): could be check-pass?)
#![feature(panic_unwind)]

View File

@ -1,7 +1,6 @@
// run-pass
// compile-flags: -C relocation-model=pic
// ignore-emscripten no pic
// ignore-wasm
// needs-relocation-model-pic
#![feature(cfg_relocation_model)]

View File

@ -2,6 +2,7 @@
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=1
// needs-unwind
// ignore-android FIXME #17520
// ignore-wasm no panic support
// ignore-openbsd no support for libbacktrace without filename

View File

@ -1,4 +1,4 @@
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:56:5:
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:57:5:
debug!!!
stack backtrace:
0: std::panicking::begin_panic

View File

@ -2,6 +2,7 @@
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=1
// needs-unwind
// ignore-android FIXME #17520
// ignore-wasm no panic support
// ignore-openbsd no support for libbacktrace without filename

View File

@ -1,4 +1,4 @@
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:52:5:
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:53:5:
debug!!!
stack backtrace:
0: std::panicking::begin_panic