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 for Apple Silicon #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

equitably
Copy link

This is the same change as was previously accepted in pull request #15, and subsequently lost when "output_file.c" was replaced with "output_file.cpp."

simg2img does not work on Apple Silicon-based Macs, failing with an error "Cannot write output file." This is because simg2img makes a call to mmap64 with an offset of 4096 (the page size on x86-based systems). mmap64 requires that the offset be a multiple of the page size, and the page size on Apple Silicon is 16384; therefore, the mmap64 call fails.

This change calculates the appropriate offset using the actual page size of the system rather than a hardcoded 4096.

vlaci added a commit to vlaci/nixpkgs that referenced this pull request Oct 1, 2024
Based on upstream PR:
anestisb/android-simg2img#38

This fixes broken tests of Unblob as well
vlaci added a commit to vlaci/nixpkgs that referenced this pull request Oct 1, 2024
Based on upstream PR:
anestisb/android-simg2img#38

This fixes broken tests of Unblob as well
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