https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78616
--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #3) > trying this (after regnerating gcc/configure and gcc/config.in) > > $ git diff gcc/configure.ac include/libiberty.h > diff --git a/gcc/configure.ac b/gcc/configure.ac > index 703250f..ece1ffa 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -1306,7 +1306,7 @@ AC_CHECK_DECLS([basename(const char*), strstr(const > char*,const char*)], , ,[ > #include "system.h"]) > > gcc_AC_CHECK_DECLS(getenv atol atoll asprintf sbrk abort atof getcwd getwd \ > - madvise stpcpy strnlen strsignal strverscmp \ > + madvise stpcpy strnlen strndup strsignal strverscmp \ > strtol strtoul strtoll strtoull setenv unsetenv \ > errno snprintf vsnprintf vasprintf malloc realloc calloc \ > free getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[ > diff --git a/include/libiberty.h b/include/libiberty.h > index 605ff56..0401dac 100644 > --- a/include/libiberty.h > +++ b/include/libiberty.h > @@ -670,6 +670,10 @@ extern int vsnprintf (char *, size_t, const char *, > va_list) ATTRIBUTE_PRINTF(3, > extern size_t strnlen (const char *, size_t); > #endif > oops pasto on strndup signature; meant char * of course > +#if defined (HAVE_DECL_STRNDUP) && !HAVE_DECL_STRNDUP > +extern size_t strndup (const char *, size_t); > +#endif > + > #if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP > /* Compare version strings. */ > extern int strverscmp (const char *, const char *);