https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92376
Bug ID: 92376 Summary: [9/10 Regression] bootstrap fails with --disable-hosted-libstdcxx Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: build Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- I'm not sure when this regression started, I'll check later. /home/jwakely/src/gcc/libstdc++-v3/libsupc++/new_opa.cc:48:9: error: ‘aligned_alloc’ has not been declared in ‘::’ 48 | using ::aligned_alloc; | ^~~~~~~~~~~~~ /home/jwakely/src/gcc/libstdc++-v3/libsupc++/new_opa.cc: In function ‘void* operator new(std::size_t, std::align_val_t)’: /home/jwakely/src/gcc/libstdc++-v3/libsupc++/new_opa.cc:124:26: error: ‘aligned_alloc’ is not a member of ‘__gnu_cxx’ 124 | while ((p = __gnu_cxx::aligned_alloc (align, sz)) == nullptr) | ^~~~~~~~~~~~~ The problem is that <cstdlib> and <stdlib.h> do not include the libc <stdlib.h> for freestanding builds, and so there is no declaration of aligned_alloc. Arguably, we shouldn't try to use aligned_alloc for a freestanding build anyway, and should use the internal aligned_alloc function that is based on manually aligning into a malloc'd buffer.