This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On 27/09/16 13:29, Sebastian Huber wrote:
Hello,

Hi Sebastian,


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?

Fair enough. Does newlib aim to have a good support of C11 though? If no one solution would be to teach GCC that C11 test should be skipped for newlib 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.


I don't think there is any other choice at the moment. I did not find any conditional code in aligned_alloc.c and this file is also built unconditionally. So I think it's just a matter of doing the actual work if someone cares enough about this.

Thanks for your answer.

Best regards,

Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]