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

Fix build on aarch64 #3

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

mfrischknecht
Copy link
Contributor

@mfrischknecht mfrischknecht commented Dec 21, 2023

ash::vk::ApplicationInfo 1 actually uses *const c_char as a type for its string fields, and the underlying type of libc::c_char varies on different architectures.

Because of this, the application currently builds fine on x64 (where c_char is i8) but fails on aarch64 (where c_char is u8 instead).

Footnotes

  1. https://docs.rs/ash/latest/ash/vk/struct.ApplicationInfo.html

`ash::vk::ApplicationInfo` [1] actually uses `*const c_char` as a type
for its string fields, and the underlying type of `libc::c_char` varies on
different architectures.

Because of this, the application currently builds fine on x64 (where
`c_char` is `i8`) but fails on aarch64 (where `c_char` is `u8` instead).

[1]: https://docs.rs/ash/latest/ash/vk/struct.ApplicationInfo.html
mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this pull request Dec 22, 2023
`vulkan-helper` constructs a C string using an explicit `*const i8`
pointer, which isn't correct for all architectures. While this builds
fine for x64, on aarch64 `c_char` is defined as `u8`, causing
compilation errors.

This change introduces a patch for this issue I have submitted
as an upstream PR [1] until said PR is hopefully accepted.

[1]: imLinguin/vulkan-helper-rs#3
Copy link
Owner

@imLinguin imLinguin left a comment

Choose a reason for hiding this comment

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

thanks for catching that!

@imLinguin imLinguin merged commit 04b290c into imLinguin:main Dec 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants