This patch fixes pass variables of double type via stack. E.g. when calling
functions like printf(3). Actual only for AMD64.
st_thread_create() do the stack aligned, but after entering the thread
SP is 8-bytes aligned, but should 16-bytes at least.
Segmentation fault occurs inside function preamble on MOVAPS call.
This patch made for state-threads 1.4, but also applies to 1.8
without fuzz.
Futher testing shows perfect running on Linux/AMD64 and version of 1.8 also.
patch for 1.4 & 1.8
Thank you for your patch. Indeed, the AMD64 ABI requires (%rsp - 8) to be 16-byte aligned. Unfortunately your patch breaks other platforms, notably x86_64 on Darwin. I searched for a way to detect when your patch is needed and when it's not, but failed to find one. If you know of one please update this bug with it.
Unfortunately i know nothing about Darwin. I would like to limit the patch using ifdef like:
#if defined(__amd64__) && (defined(FreeBSD) || defined(linux))
Updated patch file will follow.
st-1.4-amd64-stack-align-freebsd-linux.patch limits the fix for the only platforms known to be affected and where the fix is tested.