sparc64-fix-stack-alignment
andn %sp,63,%sp
This ensures (as intended) that the stack pointer has its low 6 bits
cleared and is perfectly aligned on 64 bytes. Alas, this does not take
Sparc64's stack pointer bias into account: The real register value is 2047
(0x7ff) lower than the effective stack pointer address. As the stack an
Sparc64 is always 8-byte aligned, the stack pointer register modulo 8 has
to be 1.
A crude fix to this is to not mask the lowest bit of the stack pointer
(which will keep it 0 on Sparc32 and 1 on Sparc64), which I have verified
to fix a Bus Error in rustc on Sparc64/Linux.
.
See: http://lists.llvm.org/pipermail/llvm-dev/2017-October/118620.html
Reported-By: Michael Karcher <debian@mkarcher.dialup.fu-berlin.de>
Author: James Clarke <jrtc27@jrtc27.com>
Gbp-Pq: Name sparc64-fix-stack-alignment.diff