Turn off outputIsMappableFile when building to osx-arm64 #118

Open
erykoff wants to merge 1 commit from erykoff/no-ld64-mmap-arm64 into master
erykoff commented 2022-02-24 23:20:51 -06:00 (Migrated from github.com)

This fixes #117.

Further investigation shows that with the newest version of cctools-port + sigtool for signing then whenever the outputIsMappableFile=true which triggers wholeBuffer = (uint8_t *)mmap(NULL, _fileSize, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0); then the output binary will not work on M1 macs. This can be triggered when either (a) the file already exists, or (b) the path is explicitly specified (relative or absolute). I'm not sure why the mmap option is necessary, and everything appears to run fine turning it off (and it is off in regular usage when you target a new file without a path specified!).

This fixes #117. Further investigation shows that with the newest version of cctools-port + sigtool for signing then whenever the `outputIsMappableFile=true` which triggers `wholeBuffer = (uint8_t *)mmap(NULL, _fileSize, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0);` then the output binary will not work on M1 macs. This can be triggered when either (a) the file already exists, or (b) the path is explicitly specified (relative or absolute). I'm not sure why the `mmap` option is necessary, and everything appears to run fine turning it off (and it is off in regular usage when you target a new file without a path specified!).
tpoechtrager commented 2023-08-21 12:39:06 -05:00 (Migrated from github.com)
Is this patch still needed with https://github.com/tpoechtrager/cctools-port/tree/986-ld64-711?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin erykoff/no-ld64-mmap-arm64:erykoff/no-ld64-mmap-arm64
git switch erykoff/no-ld64-mmap-arm64

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff erykoff/no-ld64-mmap-arm64
git switch erykoff/no-ld64-mmap-arm64
git rebase master
git switch master
git merge --ff-only erykoff/no-ld64-mmap-arm64
git switch erykoff/no-ld64-mmap-arm64
git rebase master
git switch master
git merge --no-ff erykoff/no-ld64-mmap-arm64
git switch master
git merge --squash erykoff/no-ld64-mmap-arm64
git switch master
git merge --ff-only erykoff/no-ld64-mmap-arm64
git switch master
git merge erykoff/no-ld64-mmap-arm64
git push origin master
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
miles/cctools-port!118
No description provided.