From 074e17abe2ef726c63ba45e4b386d423b220c770 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 26 Apr 2024 08:33:29 +0200 Subject: [PATCH 1/2] CI: Also test on x86_64-based `macos-12` The `macos-latest` runner is ARM-based now. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a397f5fd..ec90853d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-12, windows-latest, macos-latest] runs-on: ${{ matrix.os }} timeout-minutes: 30 From a2633589e25c47fd8be3db617346309e65af030d Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 26 Apr 2024 08:35:25 +0200 Subject: [PATCH 2/2] Make the `entry_point` macro only available on `x86_64` Inline assembly causes build errors on other architectures. We can still run the config tests on other architectures, so we don't want to set the `target_arch` for the entire crate. --- api/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/src/lib.rs b/api/src/lib.rs index e1fb0fb3..586ae1d0 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -106,6 +106,7 @@ mod version_info { /// `#[link_section = ".bootloader-config"]`, which instructs the Rust compiler to store it /// in a special section of the resulting ELF executable. From there, the bootloader will /// automatically read it when loading the kernel. +#[cfg(target_arch = "x86_64")] #[macro_export] macro_rules! entry_point { ($path:path) => { @@ -139,6 +140,7 @@ macro_rules! entry_point { } #[doc(hidden)] +#[cfg(target_arch = "x86_64")] pub fn __force_use(slice: &&[u8; BootloaderConfig::SERIALIZED_LEN]) { let force_use = slice as *const _ as usize; unsafe { core::arch::asm!("add {0}, 0", in(reg) force_use, options(nomem, nostack)) };