[PATCH] libstdc++-v3: Have aligned_alloc() on Newlib

Sebastian Huber sebastian.huber@embedded-brains.de
Wed Aug 8 13:38:00 GMT 2018


On 08/08/18 13:18, Jonathan Wakely wrote:
> On 08/08/18 10:52 +0200, Sebastian Huber wrote:
>> While building for Newlib, some configure checks must be hard coded.
>> The aligned_alloc() is supported since 2015 in Newlib.
>>
>> libstdc++-v3
>>
>>     PR target/85904
>>     * configure.ac): Define HAVE_ALIGNED_ALLOC if building for
>
> There's a stray closing parenthesis here.
>
>>     Newlib.
>>     * configure: Regnerate.
>
> Typo "Regnerate".
>
> But the patch itself is fine - OK for trunk.

Oh, sorry, for all the typos.

>
> I'm ambivalent about this being backported to gcc-7 and gcc-8 branches
> (gcc-6 is unaffected as it doesn't use aligned_alloc).
>
> It's strictly speaking an ABI change, because HAVE_ALIGNED_ALLOC
> affects the memory layout for allocations from operator new(size_t,
> align_val_t) (in new_opa.cc) which needs to agree with the
> corresponding operator delete (in del_opa.cc). Using static linking it
> might be possible to create a binary that has operator new using
> aligned_alloc, but operator delete expecting to do ((void**)ptr)[-1],
> which would be bad.
>
> Those operators are C++17, so "experimental", but maybe we shouldn't
> make the change on release branches.
>

I was able to build a GCC 7.3.0 compiler, but now the build fails on the 
GCC 7 branch.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Libstdc++ mailing list