On 7 Feb, Pedro Giffuni wrote:
> Hi Damjan;
>
> Looking at the log I was wondering what exactly clang 1.8 was and
> I took the liberty of fixing the mismatch ;).
>
> FWIW, AOO should now work fine with clang 3.9.1. Clang 4 reveals
> allocation issues.
Clang 4 on x86_64 uses a MOVAPS SSE instruction to zero out the object
returned by "new sometype()" if the object is sufficiently large. This
requires that the object be aligned to a 16 byte boundary, but our
allocation code doesn't understand anything larger than 8 byte
alignment. Furthermore, --enable-debug causes one of the allocation
wrapper functions to add an 8 byte offset, which breaks things even if
the allocator uses the proper alignment. I've got a conditional patch
in the FreeBSD port to fix these problems, but I don't want to commit it
to our source tree because it would pessimize things for the not x86_64
and not clang 4 cases.
It would be nice to be able to autoconfigure this and we have
sal/typesconfig/typesconfig.c that should theoretically detect the need
for this, but there are two problems:
* Modern compilers seem to optimize out some and/or all of the
alignment checks
* I wasn't able to get clang 4 to use MOVAPS when compiling C code.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]