Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial work to build for Windows ARM64 #4990

Merged
merged 5 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@ jobs:
- run: cargo check --target wasm32-unknown-emscripten -p wasi-common
- run: cargo check --target armv7-unknown-linux-gnueabihf -p wasi-common

# Check whether `wasmtime` cross-compiles to aarch64-pc-windows-msvc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a note here, with a link to the open issue, noting that Wasmtime is known to have issues on this platform (trap handling) and this is why it doesn't have a build with artifacts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I've opened a new issue to track the trap handling on Windows ARM64, and added the link.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

# We don't build nor test it because it lacks trap handling.
# Tracking issue: https://github.com/bytecodealliance/wasmtime/issues/4992
checks_winarm64:
name: Check Windows ARM64
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: ./.github/actions/install-rust
- run: rustup target add aarch64-pc-windows-msvc
- run: cargo check -p wasmtime --target aarch64-pc-windows-msvc

fuzz_targets:
name: Fuzz Targets
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions crates/jit/src/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cfg_if::cfg_if! {
} else if #[cfg(all(windows, target_arch = "x86"))] {
mod winx32;
pub use self::winx32::*;
} else if #[cfg(all(windows, target_arch = "aarch64"))] {
mod winx64;
pub use self::winx64::*;
} else if #[cfg(unix)] {
mod systemv;
pub use self::systemv::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/jit/src/unwind/winx64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl UnwindRegistration {
if RtlAddFunctionTable(
unwind_info as *mut _,
(unwind_len / unit_len) as u32,
base_address as u64,
base_address as _,
) == 0
{
bail!("failed to register function table");
Expand Down
3 changes: 3 additions & 0 deletions crates/runtime/src/traphandlers/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ unsafe extern "system" fn exception_handler(exception_info: *mut EXCEPTION_POINT
} else if #[cfg(target_arch = "x86")] {
let ip = (*(*exception_info).ContextRecord).Eip as *const u8;
let fp = (*(*exception_info).ContextRecord).Ebp as usize;
} else if #[cfg(target_arch = "aarch64")] {
let ip = (*(*exception_info).ContextRecord).Pc as *const u8;
let fp = (*(*exception_info).ContextRecord).Anonymous.Anonymous.Fp as usize;
} else {
compile_error!("unsupported platform");
}
Expand Down