https://bugs.winehq.org/show_bug.cgi?id=37540
Gabriel Ivăncescu gabrielopcode@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gabrielopcode@gmail.com
--- Comment #22 from Gabriel Ivăncescu gabrielopcode@gmail.com --- Here's my take on this. 64-bit code has RIP-relative addressing. What this means is that position-independent code comes for free and is, in fact, the default even on Windows (mcmodel=large is much more bloated).
But that's only for 64-bit code. The thing is that -fPIC is terrible for 32-bit code. Not only do you waste a register (and you only have half compared to 64-bit) but also to get that register you need a call and then to fetch the return address, which is inefficient to say the least. So in fact -fno-PIC should be the default for 32-bit code, just like on Windows.
This DRM seems to be doing this for 32-bit code to begin with. I doubt it would assume -fno-PIC for 64-bit code since it would crash even on Windows most likely then.
Is it not possible to simply set -fno-PIC for 32-bit Wine only, while keeping -fPIC for 64-bit components? IMO, that would be the most correct behavior and is very likely how Windows is compiled itself, internally.