Re: x86-64: Maintain 16-byte stack alignment
From: Herbert Xu
Date: Tue Jan 10 2017 - 22:17:35 EST
On Tue, Jan 10, 2017 at 11:00:31AM -0800, Andy Lutomirski wrote:
>
> Here's what I think is really going on. This is partially from
> memory, so I could be off base. The kernel is up against
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383, which means that,
> on some GCC versions (like the bad one and maybe even current ones),
> things compiled without -mno-sse can't have the stack alignment set
> properly. IMO we should fix this in the affected code, not the entry
No that's not it. My compiler (gcc 4.7.2) doesn't support it period:
$ gcc -S -O2 -mno-sse -mpreferred-stack-boundary=3 a.c
a.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12
$
So you either have to ban all compilers older than whatever version
that started supporting 8-byte stack alignment, or fix the kernel.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt