https://bugs.winehq.org/show_bug.cgi?id=38780
--- Comment #21 from Martin Storsjö martin@martin.st --- (In reply to Zebediah Figura from comment #20)
(In reply to Martin Storsjö from comment #19)
Currently I'm running with this patch: https://source.winehq.org/patches/data/137759
This pretty much gets the same effect as the suggested compiler handling for prologues/epilogues, but without compiler support - but it doesn't fix callbacks either. This (together with https://source.winehq.org/patches/data/135165) has been a good enough workaround for me so far though.
Sure, I'd just like to see this fixed in a generic way.
Is there any obvious infeasibility about my proposal #2? It's weird, but seems plausible, and maybe wouldn't even be that hard, if we can leverage the same sort of code that -fcall-used-reg uses [disclaimer: I am not a compiler enthusiast yet, either]. Plus it means we can use inline TEB access in Wine code :-)
Ah, with the reference to -fcall-used-reg, I understand what you mean. Hmm, I'll have to think about it and poke around and see what's possible.
It turns out that clang doesn't support this flag at all so far, but I'll see if it is possible to do something to the same effect in LLVM's calling convention handling.