[Bug 38780] AArch64 platforms: register X18 (TEB) must remain reserved for Wine to run 64-bit ARM Windows applications ( Distro aarch64 toolchains need '-ffixed-x18' default, loader/libc/userland )

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Nov 12 15:17:41 CST 2018


https://bugs.winehq.org/show_bug.cgi?id=38780

--- Comment #15 from Martin Storsjö <martin at martin.st> ---
(In reply to André H. from comment #14)
> (In reply to Zebediah Figura from comment #13)
> > Is this something we could fix entirely on the Wine side? I'm not an ARM
> > enthusiast (yet), but I guess we could do one of two things:
> > 
> > (1) unconditionally save and restore x18 in the function prologue, and also
> > restore it around WINAPI callbacks;
> > (2) save and restore it around all inferior function calls.
> > 
> > Both would require modification to GCC, I think, but maybe would be more
> > feasible than trying to get distributions to compile everything with
> > -ffixed-x18?
> 
> Well, rather in clang then.
> Martin? :)
> Can we add it to the aarch64 ms_abi attribute (maybe only on non-windows
> targets)?

I guess it could be doable to back it up in the prologue and restore it the
epilogue in functions on non-windows that are marked with the ms_abi attribute.
For restoring/setting it up around WINAPI callbacks, where would the compiler
get the value to set into x18? I'm not sure how far in the compiler WINAPI is
visible on non-i386 platforms where stdcall is a no-op. I don't quite follow
what was suggested to be done in point (2) above though.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list