Skip to content

Commit

Permalink
Merge pull request rust-lang#1523 from rust-lang/update_abi_cafe
Browse files Browse the repository at this point in the history
Update abi-cafe
  • Loading branch information
bjorn3 authored Aug 2, 2024
2 parents c48b010 + e52af66 commit 395181c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 45 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/abi-cafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions: {}
jobs:
abi_cafe:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.env.TARGET_TRIPLE }}
cancel-in-progress: true
Expand All @@ -30,9 +30,10 @@ jobs:
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-msvc
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu
# FIXME Currently hangs. Re-enable once this is fixed or abi-cafe adds a timeout.
#- os: windows-latest
# env:
# TARGET_TRIPLE: x86_64-pc-windows-gnu

steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 16 additions & 9 deletions build_system/abi_cafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::{build_sysroot, CodegenBackend, SysrootKind};
static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra",
"abi-cafe",
"4c6dc8c9c687e2b3a760ff2176ce236872b37212",
"588df6d66abbe105",
"f1220cfd13b57f5c0082c26529163865ee25e115",
"fe93a9acd461425d",
"abi-cafe",
);

Expand Down Expand Up @@ -38,17 +38,23 @@ pub(crate) fn run(
eprintln!("Running abi-cafe");

let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];

let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
cmd.arg("--");
cmd.arg("--pairs");
cmd.args(
let pairs =
if cfg!(not(any(target_os = "macos", all(target_os = "windows", target_env = "msvc")))) {
&pairs[..]
} else {
&pairs[..2]
},
);
};

let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
cmd.arg("--");

// stdcall, vectorcall and such don't work yet
cmd.arg("--conventions").arg("c").arg("--conventions").arg("rust");

for pair in pairs {
cmd.arg("--pairs").arg(pair);
}

cmd.arg("--add-rustc-codegen-backend");
match cg_clif_dylib {
CodegenBackend::Local(path) => {
Expand All @@ -58,6 +64,7 @@ pub(crate) fn run(
cmd.arg(format!("cgclif:{name}"));
}
}

cmd.current_dir(ABI_CAFE.source_dir(dirs));

spawn_and_wait(cmd);
Expand Down

This file was deleted.

44 changes: 44 additions & 0 deletions patches/0002-abi-cafe-Disable-broken-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 378d9e451a8af1045b8cb32841198cd5ad5464a3 Mon Sep 17 00:00:00 2001
From: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date: Tue, 9 Jul 2024 11:25:14 +0000
Subject: [PATCH] Disable broken tests

---
src/abis/mod.rs | 6 +++---
src/report.rs | 4 ++++
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/report.rs b/src/report.rs
index acfce38..b3ab842 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -45,6 +45,26 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl
//
// THIS AREA RESERVED FOR VENDORS TO APPLY PATCHES

+ if cfg!(target_arch = "aarch64") && test.test == "F32Array" && test.options.convention == CallingConvention::C {
+ result.check = Busted(Check);
+ }
+
+ if cfg!(target_arch = "aarch64") && test.test == "OptionU128" && test.options.convention == CallingConvention::Rust && test.options.repr == LangRepr::C {
+ result.check = Busted(Check);
+ }
+
+ if cfg!(target_arch = "x86_64") && test.test == "OptionU128" && test.options.convention == CallingConvention::Rust && test.options.repr == LangRepr::Rust {
+ result.check = Busted(Run);
+ }
+
+ if cfg!(windows) && (test.test == "OptionU128" || test.test == "I64Array" || test.test == "simple") {
+ result.run = Skip; // Gives SIGILL on x86_64 windows.
+ }
+
+ if test.test == "f16" || test.test == "f128" {
+ result.run = Skip;
+ }
+
// END OF VENDOR RESERVED AREA
//
//
--
2.34.1

0 comments on commit 395181c

Please sign in to comment.