Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
x86 WebP DLL wrongly assumes stack alignment #145
The libwebp-5.dll shipped in the msvc32-4 external_deps seems to be actually incompatible with MSVC. On the x86 Windows platform, only 4-byte stack alignment is guaranteed. But the code in this DLL apparently assumes that the stack will be 16-byte aligned when using SSE instructions on stack argument (causing it to crash).
I tried to find a compile switch or attribute to force 16-byte stack alignment, but no luck.
Where does this code come from anyway? Is it built by us or from a binary release?
It's built by us using https://github.com/DaemonEngine/Daemon/blob/master/external_deps/build.sh
We would like to imagine that C has a stable, interoperable between compilers ABI, but apparently that's not quite the case... mingw gcc assumes the caller aligns the stack to 16 bytes, so it may be unsafe to call from MSVC-compiled code into GCC-compiled code.
It seems like a mingw-specific bug that SSE instructions can be generated in the "i686" architecture. The [GCC manual] suggests that SSE should not be available, and GCC on Linux refuses to compile SSE intrinsics.
To fix this on the Webp DLL end, we could try to build it either with SSE instructions disabled, or with