Skip to content

loader: Make the preloader a correct macOS 10.7 binary, and use a zerofill section to reserve the low 8GB of memory.

Brendan Shanks requested to merge bshanks/wine:mac_preloader into master

Add a '__program_vars' section to the preloader, to make it a correct macOS 10.7 binary. This fixes Wine crashing on macOS Sonoma, and GStreamer crashing when initialized by Wine (on macOS Monterey and later).

However this causes dyld to initialize libSystem before the preloader runs, resulting in system allocations throughout the ranges that need to be reserved.

To prevent this, use a zerofill section to reserve the entire low 8GB of address space for use by Wine.

This also has the benefit of reserving as much address space as possible for Wow64. Additionally, this MR is a step towards not using the preloader entirely on 64-bit macOS (it relies on very unsupported APIs and methods).

Merge request reports

Loading