2 ms·
> It's not well known that Linux/x86 stack frames must always be 16 byte aligned. Always wasn't always always; that sad story is the source of your OCaml probl
by kps 10y ago
> It's not well known that Linux/x86 stack frames must always be 16 byte aligned.
Always wasn't always always; that sad story is the source of your OCaml problems, among many others. Linux on x86 originally used 4-byte alignment, and 4-byte alignment is what you see if you RTFM¹. Later, gcc decided that they were in control, and unilaterally switched to 16-byte alignment. Backwards compatibility? Screw you. Other tools? Screw you.²
¹ https://refspecs.linuxfoundation.org/ https://refspecs.linuxfoundation.org/
² https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496
- gpderetta 10y agoThe worst part is that today 16 bytes alignment is no longer necessary as x86 can do unaligned vector load with little to no penalty while keeping the stack aligned all the time still has a cost.