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 macOS 12 #259

Merged
merged 1 commit into from
Nov 6, 2021
Merged

Fix build on macOS 12 #259

merged 1 commit into from
Nov 6, 2021

Conversation

athre0z
Copy link
Member

@athre0z athre0z commented Oct 29, 2021

This PR disables struct packing for ZydisShortString on Apple aarch64 platforms. For an unknown reason, compilation is now failing with ld complaining about pointer alignment starting with macOS 12 on aarch64. On macOS 11 + aarch64, things compile perfectly fine without the change.

While we have many other packed structs, the linker seems to particularly take offense with this one, as it is the only packed struct containing a pointer. I think it might be related to some form of pointer authentication.

The binary bloat from this appears to be about 40KiB.

@athre0z athre0z added C-enhancement Category: Enhancement of existing features P-medium Priority: Medium A-build Area: Build system labels Oct 29, 2021
@athre0z athre0z requested a review from flobernd October 29, 2021 14:29
Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

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

Maybe as an improvement, we could prepend the length to the actual strings (this should be easily possible as we generate the strings anyways) and remove the 'length' field from the struct. In this case a struct would not even be necessary, but probably still desired as a hint.

@msuiche
Copy link

msuiche commented Aug 21, 2022

Are you guys planning to release a new crate too? https://crates.io/crates/zydis/versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: Build system C-enhancement Category: Enhancement of existing features P-medium Priority: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants