This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: Jason Merrill <jason at redhat dot com>, Jonathan Wakely <jwakely at redhat dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Sep 2016 11:25:08 +0200 (CEST)
- Subject: Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2kJRV14hZX1rGz5V_UCpSB7MdVQPh4OM=vYOsw6ZDUNkA@mail.gmail.com> <alpine.DEB.2.20.1609080901360.3233@laptop-mg.saclay.inria.fr> <20160908110641.GB23306@redhat.com> <CADzB+2mMHsrPdL5u2NWb_wqwvNcTo-nOKLaJ-Nft6+Myo=++Ug@mail.gmail.com> <CAKdteOawdPQ80SitNOUDgAPtpHLmNdA8j_GwbRR__48B58gUEw@mail.gmail.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Sat, 10 Sep 2016, Christophe Lyon wrote:
On aarch64*-elf and arm-eabi (using newlib), I'm seeing:
/gccsrc/libstdc++-v3/libsupc++/new_opa.cc:66: undefined reference to
`aligned_alloc'
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=f86afe5a3ac62a92e821c764a011e1625abdd326
"C11 aligned_alloc() implementation
aligned_alloc() is implemented in terms of posix_memalign() which is
only declared in <stdlib.h> but not defined in Newlib in general. At
least Linux and RTEMS implement this function."
If we don't want to provide a fallback implementation in libsupc++, we can
say that aligned new is unsupported on those platforms, but if we are
building a shared libstdc++.so that doesn't like undefined symbols, we
need a different failure mode than an undefined aligned_alloc. Either not
providing operator new(...aligned_val_t...) in libstdc++ or providing one
that just aborts I guess?
--
Marc Glisse