+2020-12-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * Makefile.in (IPA_LIB): Include libiberty library.
+
 2020-11-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * server.cc (gdbserver_usage): Add missing option to usage text.
 
        $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
                -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
                 $(CXXFLAGS) \
-               -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
+               -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY) -ldl -pthread
 
 # Put the proper machine-specific files first, so M-. on a machine
 # specific routine gets the one for the correct machine.
 
+2020-12-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdbsupport/common-utils.cc: Change 'ctype.h' include to
+       'safe-ctype.h'.
+       (extract_string_maybe_quoted): Use safe-ctype function versions.
+       (is_digit_in_base): Likewise.
+       (digit_to_int): Likewise.
+       (strtoulst): Likewise.
+       (skip_spaces): Likewise.
+       (skip_to_space): Likewise.
+
 2020-12-11  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * common-debug.h (debug_prefixed_printf_cond): New.
 
 #include "common-defs.h"
 #include "common-utils.h"
 #include "host-defs.h"
-#include <ctype.h>
+#include "safe-ctype.h"
 
 void *
 xzalloc (size_t size)
   /* Parse p similarly to gdb_argv buildargv function.  */
   while (*p != '\0')
     {
-      if (isspace (*p) && !squote && !dquote && !bsquote)
+      if (ISSPACE (*p) && !squote && !dquote && !bsquote)
        break;
       else
        {
 static int
 is_digit_in_base (unsigned char digit, int base)
 {
-  if (!isalnum (digit))
+  if (!ISALNUM (digit))
     return 0;
   if (base <= 10)
-    return (isdigit (digit) && digit < base + '0');
+    return (ISDIGIT (digit) && digit < base + '0');
   else
-    return (isdigit (digit) || tolower (digit) < base - 10 + 'a');
+    return (ISDIGIT (digit) || TOLOWER (digit) < base - 10 + 'a');
 }
 
 static int
 digit_to_int (unsigned char c)
 {
-  if (isdigit (c))
+  if (ISDIGIT (c))
     return c - '0';
   else
-    return tolower (c) - 'a' + 10;
+    return TOLOWER (c) - 'a' + 10;
 }
 
 /* As for strtoul, but for ULONGEST results.  */
   int i = 0;
 
   /* Skip leading whitespace.  */
-  while (isspace (num[i]))
+  while (ISSPACE (num[i]))
     i++;
 
   /* Handle prefixes.  */
 {
   if (chp == NULL)
     return NULL;
-  while (*chp && isspace (*chp))
+  while (*chp && ISSPACE (*chp))
     chp++;
   return chp;
 }
 {
   if (chp == NULL)
     return NULL;
-  while (*chp && isspace (*chp))
+  while (*chp && ISSPACE (*chp))
     chp++;
   return chp;
 }
 {
   if (chp == NULL)
     return NULL;
-  while (*chp && !isspace (*chp))
+  while (*chp && !ISSPACE (*chp))
     chp++;
   return chp;
 }