https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84773
Bug ID: 84773 Summary: [7/8 Regression] Cross-compilers do not use aligned_alloc or _aligned_malloc for aligned-new Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Native compilers check for: AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) but cross-compilers don't. This means that a cross-compiler for mingw32 will use the internal definition of aligned_alloc added for PR libstdc++/79190 but a native ming32 compiler will use _aligned_malloc instead. That means objects compiled with the cross-compiler are not compatible with objects compiled with the native one. On FreeBSD the same problem prevents bootstrapping a cross-compiler: https://gcc.gnu.org/ml/gcc-help/2017-11/msg00038.html Which can be solved by making the cross-compiler check for the same functions as the native one checks for: https://gcc.gnu.org/ml/gcc-help/2018-02/msg00095.html