This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [C++ PATCH] Aligned new option handling fixes (PR c++/77651)


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

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