From be731c6d9ebcf6d3951a51f57e1c30665403b982 Mon Sep 17 00:00:00 2001
From: Nehal J Wani <nehaljw.kkd1@gmail.com>
Date: Tue, 12 Jun 2018 05:26:24 +0000
Subject: [PATCH 1/4] Hardcode HAVE_ALIGNED_ALLOC=1 in libstdc++-v3/configure

---
 libstdc++-v3/configure | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 21abaeb07..b8cf28205 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -26405,6 +26405,11 @@ _ACEOF
 fi
 done
 
+# The check above works only if aligned_alloc is present as a symbol in libc.so
+# Since we provide a header only implementation, override the value here
+cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1
+_ACEOF
 
   # For iconv support.
 
@@ -38403,6 +38408,9 @@ _ACEOF
 fi
 done
 
+cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1
+_ACEOF
     ;;
 
   *-fuchsia*)
@@ -42318,6 +42326,10 @@ fi
 done
 
 
+cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1
+_ACEOF
+
     ;;
   *-mingw32*)
 
@@ -45924,6 +45936,10 @@ _ACEOF
 fi
 done
 
+cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_aligned_alloc" | $as_tr_cpp` 1
+_ACEOF
+
     ;;
   *-qnx6.1* | *-qnx6.2*)
     SECTION_FLAGS='-ffunction-sections -fdata-sections'
