[LLVMdev] How to force stack alignment for particular target triple in JIT?

Duncan Sands baldrick at free.fr
Sun Feb 20 23:50:58 PST 2011


Hi Yuri,

> I get SEGV in gcc-compiled procedure in Solaris10-i386. This procedure
> is called from llvm JIT code.
> Exact instruction that crashes is this: movdqa %xmm0, 0x10(%esp)
> %esp is 8-aligned, and by definition of movdqa it expects 16-aligned stack.
> This leads me to believe that llvm uses wrong ABI when calling external
> procedures and doesn't align stack properly.
>
> llvm module executing in JIT has this target triple: i386-pc-solaris2.10
>
> Isn't target triple supposed to set correct ABI including stack
> alignment? How to set the correct alignment for this triple?

it is, however as far as I can see nowhere in LLVM makes any important
decisions based on the triple containing "solaris".  I suggest you try
to work out how the stack alignment is set for other operating systems
and send in a patch fixing the solaris case.

Ciao, Duncan.



More information about the llvm-dev mailing list