This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: aligned_alloc (C11) calls posix_memalign (posix) unconditionally: bug?
- From: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>, newlib at sourceware dot org
- Date: Fri, 30 Sep 2016 16:12:43 +0100
- Subject: Re: aligned_alloc (C11) calls posix_memalign (posix) unconditionally: bug?
- Authentication-results: sourceware.org; auth=none
- References: <748edd37-4fc1-acf9-a644-9f5c2523bcbb@foss.arm.com> <57EA663D.7050300@embedded-brains.de>
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