https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109293
--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > (In reply to Xi Ruoyao from comment #2) > > I'll make a patch to check if memmem is declared in configure.ac. memmem is > > not a POSIX function, so it may be undeclared on systems other than MinGW as > > well. > > memmem is included in libiberty so it is more just about the prototype not > being declared. libiberty configure.ac checked it with AC_CHECK_FUNCS, so if the system libc does not provide memmem, libiberty will build its copy. And we just need to declare the prototype to use it, as libiberty doc says: https://gcc.gnu.org/onlinedocs/libiberty/Supplemental-Functions.html