lkml.org 
[lkml]   [2015]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Non-booting current Linus' tree
From
Date
On 07/03/2015 02:40 PM, Linus Torvalds wrote:
> On Fri, Jul 3, 2015 at 8:23 AM, Jan Kara <jack@suse.cz> wrote:
>>
>> Because the address isn't 32-byte aligned (which I assume is the
>> requirement from looking into the code). So clearly my gcc messed up and
>> miscompiled the thing by ignoring the alignment attribute.
>
> Well, it's probably a mistake to begin with to expect gcc to get stack
> alignment right. Especially since we tell gcc to not align the stack
> as much as it usually wants to with -mpreferred-stack-boundary=2.
>

Are you sure?

The 64-bit part of arch/x86/Makefile contains:

# Use -mpreferred-stack-boundary=3 if supported.
KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)

but make V=1 isn't showing -mpreferred-stack-boundary=3. This may be
because:

error: -mpreferred-stack-boundary=3 is not between 4 and 12
extern int bar(const char *);
^

I found:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383

and, indeed, -mno-sse -mpreferred-stack-boundary=3 is accepted. This
make me think that the makefile is broken -- cc-option isn't working
because it doesn't check -mpreferred-stack-boundary in conjunction with
-mno-sse.

Given that -mpreferred-stack-boundary=3 doesn't appear to being set, I
think this is really our bug: our asm code makes no effort to align the
stack to a 16-byte boundary as required by the ABI, and we're not
overriding the ABI correctly.

I'll send a patch for the Makefile issue.

--Andy


\
 
 \ /
  Last update: 2015-07-05 22:21    [W:0.073 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site