From dcec4804838fdd584b36a57690dfb73095f14355 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 18 May 2023 09:23:44 -0700 Subject: [PATCH] libstdc++-v3: Add aligned_alloc to list of funcs in newlib targets Newlib supports the aligned_alloc function (as well as memalign), define HAVE_ALIGNED_ALLOC so that libstdc++ will prefer the C standard function over the obsolete and non-standard memalign function. Signed-off-by: Keith Packard --- libstdc++-v3/configure | 2 ++ libstdc++-v3/configure.ac | 1 + 2 files changed, 3 insertions(+) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 3de1499725ea3..4da2571de8ad4 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -29422,6 +29422,8 @@ else $as_echo "#define HAVE_MEMALIGN 1" >>confdefs.h + $as_echo "#define HAVE_ALIGNED_ALLOC 1" >>confdefs.h + elif test "x$with_headers" != "xno"; then # Base decisions on target environment. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 05cdfcddbc43b..3d05e24229420 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -357,6 +357,7 @@ else AC_DEFINE(HAVE_ICONV) AC_DEFINE(HAVE_MEMALIGN) + AC_DEFINE(HAVE_ALIGNED_ALLOC) elif test "x$with_headers" != "xno"; then GLIBCXX_CROSSCONFIG fi