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