This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Aligned new option handling fixes (PR c++/77651)
- From: Jason Merrill <jason at redhat dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 22 Sep 2016 09:01:58 -0400
- Subject: Re: [C++ PATCH] Aligned new option handling fixes (PR c++/77651)
- Authentication-results: sourceware.org; auth=none
- References: <20160921144607.GA7282@tucnak.redhat.com> <CADzB+2mfw2kaBnCKUcRzWPiLfDWL3SYamAgzSn=DXa5_6CDDpA@mail.gmail.com> <CAKdteOY2By7jL5n4zMFSNwzCYhO4nXY2ejbCajK2Grwk2pDfqg@mail.gmail.com>
On Thu, Sep 22, 2016 at 4:58 AM, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> This new test (aligned-new6.C) fails on arm/aarch64 bare-metal targets
> (using newlib):
> arm-none-eabi/./libstdc++-v3/src/.libs/libstdc++.a(new_opa.o): In
> function `operator new(unsigned int, std::align_val_t)':
> /gccsrc/libstdc++-v3/libsupc++/new_opa.cc:76: undefined reference to
> `aligned_alloc'
Hmm, does this fix that?
commit d94c614feec525860ae3640727a740fb5a0fe9b0
Author: Jason Merrill <jason@redhat.com>
Date: Thu Sep 22 09:01:16 2016 -0400
* configure.ac: Define HAVE_MEMALIGN for newlib.
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 6332c4d..973d6d1 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -28822,6 +28822,8 @@ else
$as_echo "#define HAVE_ICONV 1" >>confdefs.h
+ $as_echo "#define HAVE_MEMALIGN 1" >>confdefs.h
+
else
# Base decisions on target environment.
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 5657ecb..baf605c 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -324,6 +324,7 @@ else
AC_DEFINE(HAVE_TANHF)
AC_DEFINE(HAVE_ICONV)
+ AC_DEFINE(HAVE_MEMALIGN)
else
GLIBCXX_CROSSCONFIG
fi