RFR: 8223089: Stack alignment for x86-32
Florian Weimer
fweimer at redhat.com
Fri May 3 08:02:48 UTC 2019
* Andrew Haley:
> On 5/2/19 12:32 PM, Florian Weimer wrote:
>> If you want to compile Hotspot with SSE2, you will have to realign the
>> stack when JNI code calls back into Hotspot. Otherwose, you lose
>> support for legacy JNI libraries which do not preserve stack alignment
>> (as required after that silent ABI bump).
>
> I'm surprised that's a problem, really.
I expect it will be, for some people.
>> Supporting such legacy code is the reason why the system libraries in
>> our distribution do not require stack realignment on i386, so compiling
>> Hotspot without SSE2 would also avoid the problem there, even if Hotspot
>> code calls such function such as malloc in response to requests from JNI
>> code.
>
> What about other distros, though?
Most other distributions do not build system libraries with SSE2 (via
-march=x86-64), and they generally do not build Hotspot with SSE2
support either. The reason is that they still want backwards
compatibility with really old CPUs that do not support 64-bit mode and
thus do not necessarily support SSE2.
Any distribution that wishes to use -march=x86-64 or something newer
will eventually end up with what Fedora (and downstream) is doing. I
don't think there are many other options if you want SSE2 and backwards
compatibility. And if a distribution does not care about compatibility,
I don't think it will matter how they build Hotspot.
> Aren't we just playing with fire?
We've been doing that since the silent i386 ABI bump for SSE2 and stack
alignment. This is nothing new at all. Newer GCC versions generate
more SSE2 code and therefore more SSE2 stack spills, so the issue
becomes more and more visible.
Thanks,
Florian
More information about the hotspot-dev
mailing list