aligned_alloc (C11) calls posix_memalign (posix) unconditionally: bug?

Sebastian Huber sebastian.huber@embedded-brains.de
Tue Sep 27 12:30:00 GMT 2016


Hello,

On 23/09/16 18:55, Thomas Preudhomme wrote:
> Hi there,
>
> GCC testcase g++.dg/cpp1z/aligned-new6.C fails to build on 
> arm-none-eabi because it pulls aligned_alloc which requires 
> posix_memalign which is not defined for arm-none-eabi targets.
>
> Is this a case where some code is simply missing to make this work on 
> bare-metal targets or is this a bug? I thought posix could only be 
> expected when targetting a system with OS and therefore posix_memalign 
> should not be called for bare-metal targets.

do you want to support the C11 aligned_alloc() for arm-none-eabi targets?

If yes, then you need an implementation. If you don't want one based on 
posix_memalign(), then you have to tell this Newlib somehow.

-- 
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 Newlib mailing list