[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Clang stack alignment on i386-gnu



Sergey Bugaev, le sam. 04 nov. 2023 20:25:13 +0300, a ecrit:
> This piece of code in Clang appears to be the culprit,
> but note that I'm entirely unfamiliar with the LLVM code base:
> 
>   // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD, NaCl, and for all
>   // 64-bit targets.  On Solaris (32-bit), stack alignment is 4 bytes
>   // following the i386 psABI, while on Illumos it is always 16 bytes.
>   if (StackAlignOverride)
>     stackAlignment = *StackAlignOverride;
>   else if (isTargetDarwin() || isTargetLinux() || isTargetKFreeBSD() ||
>            isTargetNaCl() || Is64Bit)
>     stackAlignment = Align(16);

That's a very probable culprit indeed. You can add an isTargetHurd
definition to llvm/lib/Target/X86/X86Subtarget.h, that calls isOSHurd(),
and add it to the if.

Samuel


Reply to: