From b7cea71bbdbf2b1608fd14eb70e1100ed402bb94 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 25 Jul 2026 12:48:31 +0200 Subject: [PATCH] fix(presenter): type the Vulkan extension pointers as c_char, not i8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `char` is signed on x86_64 but UNSIGNED on aarch64, so the hardcoded `Vec<*const i8>` compiles on every desktop target and then fails to match ash's `&[*const c_char]` when cross-compiling the client for ARM. Found by the aarch64 cross-build spike (punktfunk-planning: embedded-arm64-client.md) — the only portability defect in the client stack; nothing else in the client crates assumes an architecture. Co-Authored-By: Claude Opus 5 (1M context) --- crates/pf-presenter/src/vk/setup.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/pf-presenter/src/vk/setup.rs b/crates/pf-presenter/src/vk/setup.rs index 32adea7c..645c7a99 100644 --- a/crates/pf-presenter/src/vk/setup.rs +++ b/crates/pf-presenter/src/vk/setup.rs @@ -11,7 +11,7 @@ use crate::dmabuf; use anyhow::{anyhow, bail, Context as _, Result}; use ash::vk; use ash::vk::Handle as _; -use std::ffi::CString; +use std::ffi::{c_char, CString}; impl Presenter { /// Bring up instance → surface → device → swapchain over an SDL window. @@ -40,7 +40,10 @@ impl Presenter { .iter() .map(|e| CString::new(e.as_str()).unwrap()) .collect(); - let ext_ptrs: Vec<*const i8> = ext_cstrings.iter().map(|e| e.as_ptr()).collect(); + // `c_char`, not `i8`: plain `char` is SIGNED on x86_64 but UNSIGNED on aarch64, so a + // hardcoded `*const i8` compiles on the desktop targets and fails to match ash's + // `&[*const c_char]` on ARM. + let ext_ptrs: Vec<*const c_char> = ext_cstrings.iter().map(|e| e.as_ptr()).collect(); let instance = unsafe { entry.create_instance( &vk::InstanceCreateInfo::default()