[Pixman] [PATCH 2/2] configure.ac: For SSE2 and SSSE3 require GCC 4.4 and then use -mstackrealign

Søren Sandmann sandmann at cs.au.dk
Thu Oct 10 13:18:28 PDT 2013


Søren Sandmann <sandmann at cs.au.dk> writes:

> From: Søren Sandmann Pedersen <ssp at redhat.com>
>
> Code compiled by GCC with -msse2 and -mssse3 assumes a 16 byte aligned
> stack, but on x86-32 such alignment is not guaranteed.
>
> Instead of using the __force_align_arg_pointer__ attribute on all
> entry points that could potentially call into code compiled with
> -msse2 or -mssse3, just compile pixman-sse2.c and pixman-ssse3.c with
> -mstackrealign.
>
> This fixes the glyph-test crash introduced by the previous commit and
> also
>
>      https://bugs.freedesktop.org/show_bug.cgi?id=68300

This turned out to unnecessarily disable SSE2 on clang because, while it
claims to be __GNUC__, its __GNUC_MINOR__ is only 2, and -mstackrealign
was added in GCC 4.4.

So here is a new series that simply adds -mstackrealign if the target_cpu
is x86-32 and the compiler appears to support the option. The new patches
should be applied after Siarhei's -Wdeclaration-after-statement patch
since they conflict with it in a trivial way.

Also available here:

    http://cgit.freedesktop.org/~sandmann/pixman/log/?h=stackrealign2

Testing with non-gcc compilers and non-linux operating systems
appreciated.


Søren


More information about the Pixman mailing list