Overwatch 2 verifies that every kernel callback that is run, lives in user32. Introduce a callback in user32 that just forwards to the other modules' callbacks.
I don't know what to call this kind of callback, I just called it "user32 callback" for now because it's going through user32 but that's not really a good name.
It also sadly necessitates a private \_\_wine export from user32, unless someone has a better idea for how to register the callbacks with user32.
--
v2: user32: Remove NtUserDriverCallback* kernel callbacks.
winex11.drv: Convert kernel callbacks to user32 callbacks.
winemac.drv: Convert kernel callbacks to user32 callbacks.
wineandroid.drv: Convert kernel callbacks to user32 callbacks.
winevulkan: Convert kernel callbacks to user32 callbacks.
user.exe16: Convert kernel callbacks to user32 callbacks.
user32: Add user32 callback infrastructure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1180
Currently, unwinding the unix libraries (or full ELF builds) requires having libunwind available.
When starting up a wine environment, an exception of type `RPC_S_SERVER_UNAVAILABLE` gets thrown - and if libunwind isn't available, this breaks the startup. Thus, currently on ARM/ARM64, libunwind is essentially mandatory.
Additionally, at least on ARM, libunwind seems brittle (commits in latest git master breaks the unwinding use cases in Wine, see e.g. https://github.com/libunwind/libunwind/pull/203#issuecomment-984126066.
This MR tries to resolve all of this, by including the preexisting DWARF parser from x86_64 in the aarch64 version too. This bit was mostly quite straightforward.
For ARM, libunwind has currently relied on DWARF debug info in the `.debug_frame` section, since Linux on ARM doesn't use DWARF for runtime unwinding. This MR adds ARM EHABI unwind opcodes where necessary, and adds a local reimplementation of an ARM EHABI/EXIDX/EXTBL unwinder, similar to the DWARF one.
With these changes, unwinding on both ARM and ARM64 seems to work fine, even without libunwind.
See the individual commit messages for more commentary on the decisions taken so far (I've tried to write up all relevant considerations there - it's a fair amount of commentery).
A couple open questions:
- So far, the shared DWARF code was put in a header, `dwarf.h`. Do you want to make this a proper standalone `.c` file too?
- I wrote the ARM EHABI unwind code mostly with `stdint.h` types like `uint32_t`(as it's in the ntdll/unix directory anyway), but I can rewrite it with `DWORD` or similar if that's preferred.
- The ARM EHABI opcodes are enabled for `defined(__arm__) && defined(__ELF__) && defined(__GNUC__) && !defined(__SEH__) && !defined(__ARM_DWARF_EH__)` - there's no define to check for for knowing it's used and enabled, but it has to be implicitly assumed if no other other unwind mechanism is signaled.
- The `dl_iterate_phdr` function, used for finding the EXIDX section for locating ARM EHABI unwind info, is used within `#ifdef linux`. It might be available on other OSes too (like FreeBSD etc). Or should I go ahead and add a configure check for it?
CC @julliard @rbernon @AndreRH
--
v2: ntdll: Use the local dwarf implementation on arm64
ntdll: Add support for aarch64 in the dwarf implementation
ntdll: Move the dwarf reading routines to a shareable header
https://gitlab.winehq.org/wine/wine/-/merge_requests/1134