diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-09-29 22:27:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-29 22:27:52 +0200 |
| commit | 3ee2c526df8458d6152ff67fd8d344fe6fdf2391 (patch) | |
| tree | 9d0750ea6c77220453d9016dd1a7632834b64d58 /src | |
| parent | 4db2b741c88a51a0b28179cd6e71589a22d73a7a (diff) | |
| parent | 3853774df8d8217fb9788be3c0636b9a06da740f (diff) | |
| download | rust-3ee2c526df8458d6152ff67fd8d344fe6fdf2391.tar.gz rust-3ee2c526df8458d6152ff67fd8d344fe6fdf2391.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/compiletest/src/common.rs | 6 | ||||
| -rw-r--r-- | src/tools/compiletest/src/header/needs.rs | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index ba273489eb8..0e1bf0c6c2d 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -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 { diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index 1113721fff6..2b7a4387ceb 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -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([':', ' ']) { |
