https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61693
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Just declare it yourself? If libasan always contains the aligned_alloc symbol, then the testcase will link even when system glibc does not contain it...