tpoechtrager / cctools-port

Apple cctools port for Linux and *BSD
731 stars 168 forks source link

Turn off outputIsMappableFile when building to osx-arm64 #118

Open erykoff opened 2 years ago

erykoff commented 2 years ago

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 1 year ago

Is this patch still needed with https://github.com/tpoechtrager/cctools-port/tree/986-ld64-711?