|
-fcombine-stack-adjustmemts (gcc-4.9+)
GCC assumes that it can combine stacks from outer "grub_stage2()"
and inner trampoline "doit()" functions (optimisation -fcombine-stack-adjustments).
But doit() function clobbers %esp in inline assebly statement as:
asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
: "=&r" (realstack) : "r" (simstack));
which tricks gcc into computing invalid local variable offsets from current %esp value.
Fix by hinting gcc about %esp change in clobber list.
Thanks to slyfox for his debugging and patch! This properly fixes bug 564890, allowing
for the -O0 hack to be removed.
Package-Manager: portage-2.2.24
|