The current libiberty misconfigures itself for native DJGPP builds, because it tries to avoid compiling and linking test programs, for cross-compilation's sake. But the necessary bits that tell the configure script what functions are available in the DJGPP library are in the wrong place: the one that is run during the native build as well, and there's no reason to avoid linking in that case. The result is that the native DJGPP build of GDB is unnecessarily broken, because GDB needs several functions from libiberty that are unavailable in the DJGPP library, but are not auto-detected.
The suggested patch below fixes that by moving the explicit list of known functions to a place that only gets run when cross-compiling. While at that, I also added to that part the functions needed by GDB which need to be provided by libiberty. The native build will now auto-detect all the required functions. 2009-04-14 Eli Zaretskii <e...@gnu.org> * configure.ac (setobjs, msdosdjgpp): Move a-priori setting of existing and required library functions to with_target_subdir section, so that the native build does detect them at configure time. --- configure.a~0 2009-04-08 22:42:57.000000000 +0300 +++ configure.ac 2009-04-14 15:14:46.000000000 +0300 @@ -469,6 +469,28 @@ setobjs=yes ;; + *-*-msdosdjgpp) + AC_LIBOBJ([vasprintf]) + AC_LIBOBJ([vsnprintf]) + AC_LIBOBJ([snprintf]) + AC_LIBOBJ([asprintf]) + + for f in atexit basename bcmp bcopy bsearch bzero calloc clock ffs \ + getcwd getpagesize getrusage gettimeofday \ + index insque memchr memcmp memcpy memmove memset psignal \ + putenv random rename rindex sbrk setenv stpcpy strcasecmp \ + strchr strdup strerror strncasecmp strrchr strstr strtod \ + strtol strtoul sysconf times tmpnam vfprintf vprintf \ + vsprintf waitpid + do + n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + AC_DEFINE_UNQUOTED($n) + done + + + setobjs=yes + ;; + esac # We may wish to install the target headers somewhere. @@ -548,23 +570,6 @@ setobjs=yes ;; - *-*-msdosdjgpp) - for f in atexit basename bcmp bcopy bsearch bzero calloc clock ffs \ - getcwd getpagesize getrusage gettimeofday \ - index insque memchr memcmp memcpy memmove memset psignal \ - putenv random rename rindex sbrk setenv stpcpy strcasecmp \ - strchr strdup strerror strncasecmp strrchr strstr strtod \ - strtol strtoul sysconf times tmpnam vfprintf vprintf \ - vsprintf waitpid - do - n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - AC_DEFINE_UNQUOTED($n) - done - - - setobjs=yes - ;; - esac fi