[Bug libstdc++/78110] freestanding libstdc++ fails to compile

bernd.edlinger at hotmail dot de gcc-bugzilla@gcc.gnu.org
Wed Oct 26 09:32:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78110

--- Comment #2 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
without --with-newlib the build fails miserably...

this works for me:

--- libstdc++-v3/libsupc++/new_opa.cc.orig      2016-09-16 20:09:14.000000000
+0200
+++ libstdc++-v3/libsupc++/new_opa.cc   2016-10-26 09:40:41.722542566 +0200
@@ -48,7 +48,11 @@
   return nullptr;
 }
 #elif _GLIBCXX_HAVE_MEMALIGN
+#if _GLIBCXX_HOSTED
 #include <malloc.h>
+#else
+extern "C" void *memalign(std::size_t boundary, std::size_t size);
+#endif
 #define aligned_alloc memalign
 #else
 // The C library doesn't provide any aligned allocation functions, declare


More information about the Gcc-bugs mailing list