Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-17 15:08 [RFA/commit 1/2] update gnulib to 2012-11-05 Joel Brobecker
@ 2012-12-17 15:08 ` Joel Brobecker
  2012-12-18  6:07   ` Joel Brobecker
  2012-12-17 18:26 ` [RFA/commit 1/2] update gnulib to 2012-11-05 Tom Tromey
  1 sibling, 1 reply; 21+ messages in thread
From: Joel Brobecker @ 2012-12-17 15:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

This module is needed in order to build GDBserver on ppc-lynx178,
because the system does not define EILSEQ.

This is the last piece of the puzzle needed to build GDBserver
on ppc-lynx178.  The resulting GDBserver was then tested against
AdaCore's testsuite.

gdb/ChangeLog:

        * update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add errno.
        * import/Makefile.am: Update.
        * import/Makefile.in: Update.
        * import/errno.in.h: Update.
        * import/m4/errno_h.m4: Update.
        * import/m4/gnulib-cache.m4: Update.
        * import/m4/gnulib-comp.m4: Update.
        * aclocal.m4, configure: Regenerate.

Tested on x86_64-linux, as well as ppc-lynx178. Any objections?

Thanks,
-- 
Joel

---
 gdb/gnulib/aclocal.m4                |    1 +
 gdb/gnulib/configure                 |  839 +++++++++++++++++++++++++---------
 gdb/gnulib/import/Makefile.am        |   36 +-
 gdb/gnulib/import/Makefile.in        |   62 ++-
 gdb/gnulib/import/errno.in.h         |  279 +++++++++++
 gdb/gnulib/import/m4/errno_h.m4      |  137 ++++++
 gdb/gnulib/import/m4/gnulib-cache.m4 |    3 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |    4 +
 gdb/gnulib/update-gnulib.sh          |    3 +-
 9 files changed, 1121 insertions(+), 243 deletions(-)
 create mode 100644 gdb/gnulib/import/errno.in.h
 create mode 100644 gdb/gnulib/import/m4/errno_h.m4

diff --git a/gdb/gnulib/aclocal.m4 b/gdb/gnulib/aclocal.m4
index ead4506..5783505 100644
--- a/gdb/gnulib/aclocal.m4
+++ b/gdb/gnulib/aclocal.m4
@@ -1016,6 +1016,7 @@ m4_include([import/m4/00gnulib.m4])
 m4_include([import/m4/alloca.m4])
 m4_include([import/m4/codeset.m4])
 m4_include([import/m4/configmake.m4])
+m4_include([import/m4/errno_h.m4])
 m4_include([import/m4/extensions.m4])
 m4_include([import/m4/fcntl-o.m4])
 m4_include([import/m4/fnmatch.m4])
diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
index 765b1aa..a55107d 100644
--- a/gdb/gnulib/configure
+++ b/gdb/gnulib/configure
@@ -876,10 +876,6 @@ HAVE_SYS_INTTYPES_H
 HAVE_STDINT_H
 NEXT_AS_FIRST_DIRECTIVE_STDINT_H
 NEXT_STDINT_H
-PRAGMA_COLUMNS
-PRAGMA_SYSTEM_HEADER
-INCLUDE_NEXT_AS_FIRST_DIRECTIVE
-INCLUDE_NEXT
 HAVE_SYS_TYPES_H
 HAVE_INTTYPES_H
 HAVE_WCHAR_H
@@ -888,6 +884,21 @@ HAVE_LONG_LONG_INT
 GL_GENERATE_FNMATCH_H_FALSE
 GL_GENERATE_FNMATCH_H_TRUE
 FNMATCH_H
+EOVERFLOW_VALUE
+EOVERFLOW_HIDDEN
+ENOLINK_VALUE
+ENOLINK_HIDDEN
+EMULTIHOP_VALUE
+EMULTIHOP_HIDDEN
+GL_GENERATE_ERRNO_H_FALSE
+GL_GENERATE_ERRNO_H_TRUE
+ERRNO_H
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
+NEXT_ERRNO_H
+PRAGMA_COLUMNS
+PRAGMA_SYSTEM_HEADER
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE
+INCLUDE_NEXT
 pkglibexecdir
 lispdir
 GL_GENERATE_ALLOCA_H_FALSE
@@ -2038,45 +2049,6 @@ $as_echo "$ac_res" >&6; }
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_decl LINENO SYMBOL VAR
-# ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
-ac_fn_c_check_decl ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-#ifndef $2
-  (void) $2;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_decl
-
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
 # Tries to find the compile-time value of EXPR in a program that includes
@@ -2255,6 +2227,45 @@ rm -f conftest.val
 
 } # ac_fn_c_compute_int
 
+# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ------------------------------------
+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
+$as_echo_n "checking whether $2 is declared... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $2
+  (void) $2;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
 # -------------------------------------------
 # Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -4288,6 +4299,7 @@ fi
   # Code from module alloca:
   # Code from module alloca-opt:
   # Code from module configmake:
+  # Code from module errno:
   # Code from module extensions:
 
   # Code from module fnmatch:
@@ -5013,116 +5025,602 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+
+
+
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether 'alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether 'alloca.c' needs Cray hooks... " >&6; }
+if test "${ac_cv_os_cray+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then :
+  ac_cv_os_cray=yes
+else
+  ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+   if test "x$as_val" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+    break
+fi
+
+  done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_c_stack_direction=0
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_stack_direction=1
+else
+  ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
+$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
+if test "${gl_cv_have_include_next+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -rf conftestd1a conftestd1b conftestd2
+     mkdir conftestd1a conftestd1b conftestd2
+                                                  cat <<EOF > conftestd1a/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+     cat <<EOF > conftestd1b/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include <stdio.h>
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+     cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+     gl_save_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_have_include_next=yes
+else
+  CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_have_include_next=buggy
+else
+  gl_cv_have_include_next=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     CPPFLAGS="$gl_save_CPPFLAGS"
+     rm -rf conftestd1a conftestd1b conftestd2
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
+$as_echo "$gl_cv_have_include_next" >&6; }
+  PRAGMA_SYSTEM_HEADER=
+  if test $gl_cv_have_include_next = yes; then
+    INCLUDE_NEXT=include_next
+    INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+    if test -n "$GCC"; then
+      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+    fi
+  else
+    if test $gl_cv_have_include_next = buggy; then
+      INCLUDE_NEXT=include
+      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+    else
+      INCLUDE_NEXT=include
+      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
+    fi
+  fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
+$as_echo_n "checking whether system header files limit the line length... " >&6; }
+if test "${gl_cv_pragma_columns+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef __TANDEM
+choke me
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "choke me" >/dev/null 2>&1; then :
+  gl_cv_pragma_columns=yes
+else
+  gl_cv_pragma_columns=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
+$as_echo "$gl_cv_pragma_columns" >&6; }
+  if test $gl_cv_pragma_columns = yes; then
+    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+  else
+    PRAGMA_COLUMNS=
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
+$as_echo_n "checking for complete errno.h... " >&6; }
+if test "${gl_cv_header_errno_h_complete+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "booboo" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_complete=no
+else
+  gl_cv_header_errno_h_complete=yes
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
+$as_echo "$gl_cv_header_errno_h_complete" >&6; }
+  if test $gl_cv_header_errno_h_complete = yes; then
+    ERRNO_H=''
+  else
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_errno_h='<'errno.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
+$as_echo_n "checking absolute name of <errno.h>... " >&6; }
+if test "${gl_cv_next_errno_h+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <errno.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'errno.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
+$as_echo "$gl_cv_next_errno_h" >&6; }
+     fi
+     NEXT_ERRNO_H=$gl_cv_next_errno_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'errno.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_errno_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
+
+
+
+
+    ERRNO_H='errno.h'
+  fi
+
+   if test -n "$ERRNO_H"; then
+  GL_GENERATE_ERRNO_H_TRUE=
+  GL_GENERATE_ERRNO_H_FALSE='#'
+else
+  GL_GENERATE_ERRNO_H_TRUE='#'
+  GL_GENERATE_ERRNO_H_FALSE=
+fi
+
+
+  if test -n "$ERRNO_H"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
+$as_echo_n "checking for EMULTIHOP value... " >&6; }
+if test "${gl_cv_header_errno_h_EMULTIHOP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_EMULTIHOP=yes
+else
+  gl_cv_header_errno_h_EMULTIHOP=no
+fi
+rm -f conftest*
 
-if test $ac_cv_func_alloca_works = yes; then
+      if test $gl_cv_header_errno_h_EMULTIHOP = no; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
 
-else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_EMULTIHOP=hidden
+fi
+rm -f conftest*
 
+        if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
+                              if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP"        "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
 
+fi
 
+        fi
+      fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
+$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
+    case $gl_cv_header_errno_h_EMULTIHOP in
+      yes | no)
+        EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
+        ;;
+      *)
+        EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
+        ;;
+    esac
 
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
+  fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether 'alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether 'alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+  if test -n "$ERRNO_H"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
+$as_echo_n "checking for ENOLINK value... " >&6; }
+if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
+
+#include <errno.h>
+#ifdef ENOLINK
+yes
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_ENOLINK=yes
 else
-  ac_cv_os_cray=no
+  gl_cv_header_errno_h_ENOLINK=no
 fi
 rm -f conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+      if test $gl_cv_header_errno_h_ENOLINK = no; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ENOLINK
+yes
+#endif
 
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_ENOLINK=hidden
+fi
+rm -f conftest*
+
+        if test $gl_cv_header_errno_h_ENOLINK = hidden; then
+                              if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK"        "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
 
-    break
 fi
 
-  done
+        fi
+      fi
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
+$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
+    case $gl_cv_header_errno_h_ENOLINK in
+      yes | no)
+        ENOLINK_HIDDEN=0; ENOLINK_VALUE=
+        ;;
+      *)
+        ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
+        ;;
+    esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+
+  fi
+
+
+  if test -n "$ERRNO_H"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
+$as_echo_n "checking for EOVERFLOW value... " >&6; }
+if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction (int *addr, int depth)
-{
-  int dir, dummy = 0;
-  if (! addr)
-    addr = &dummy;
-  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
-  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
-  return dir + dummy;
-}
 
-int
-main (int argc, char **argv)
-{
-  return find_stack_direction (0, argc + !argv + 20) < 0;
-}
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_EOVERFLOW=yes
 else
-  ac_cv_c_stack_direction=-1
+  gl_cv_header_errno_h_EOVERFLOW=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest*
+
+      if test $gl_cv_header_errno_h_EOVERFLOW = no; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_header_errno_h_EOVERFLOW=hidden
 fi
+rm -f conftest*
+
+        if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
+                              if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW"        "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
 
+        fi
+      fi
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
+$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
+    case $gl_cv_header_errno_h_EOVERFLOW in
+      yes | no)
+        EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
+        ;;
+      *)
+        EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
+        ;;
+    esac
+
+
+  fi
+
 
 
 
@@ -5371,120 +5869,6 @@ $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
-$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
-if test "${gl_cv_have_include_next+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -rf conftestd1a conftestd1b conftestd2
-     mkdir conftestd1a conftestd1b conftestd2
-                                                  cat <<EOF > conftestd1a/conftest.h
-#define DEFINED_IN_CONFTESTD1
-#include_next <conftest.h>
-#ifdef DEFINED_IN_CONFTESTD2
-int foo;
-#else
-#error "include_next doesn't work"
-#endif
-EOF
-     cat <<EOF > conftestd1b/conftest.h
-#define DEFINED_IN_CONFTESTD1
-#include <stdio.h>
-#include_next <conftest.h>
-#ifdef DEFINED_IN_CONFTESTD2
-int foo;
-#else
-#error "include_next doesn't work"
-#endif
-EOF
-     cat <<EOF > conftestd2/conftest.h
-#ifndef DEFINED_IN_CONFTESTD1
-#error "include_next test doesn't work"
-#endif
-#define DEFINED_IN_CONFTESTD2
-EOF
-     gl_save_CPPFLAGS="$CPPFLAGS"
-     CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <conftest.h>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_have_include_next=yes
-else
-  CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <conftest.h>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_have_include_next=buggy
-else
-  gl_cv_have_include_next=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     CPPFLAGS="$gl_save_CPPFLAGS"
-     rm -rf conftestd1a conftestd1b conftestd2
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
-$as_echo "$gl_cv_have_include_next" >&6; }
-  PRAGMA_SYSTEM_HEADER=
-  if test $gl_cv_have_include_next = yes; then
-    INCLUDE_NEXT=include_next
-    INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
-    if test -n "$GCC"; then
-      PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
-    fi
-  else
-    if test $gl_cv_have_include_next = buggy; then
-      INCLUDE_NEXT=include
-      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
-    else
-      INCLUDE_NEXT=include
-      INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
-    fi
-  fi
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
-$as_echo_n "checking whether system header files limit the line length... " >&6; }
-if test "${gl_cv_pragma_columns+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#ifdef __TANDEM
-choke me
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "choke me" >/dev/null 2>&1; then :
-  gl_cv_pragma_columns=yes
-else
-  gl_cv_pragma_columns=no
-fi
-rm -f conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
-$as_echo "$gl_cv_pragma_columns" >&6; }
-  if test $gl_cv_pragma_columns = yes; then
-    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
-  else
-    PRAGMA_COLUMNS=
-  fi
-
-
-
-
 
 
 
@@ -8354,6 +8738,7 @@ fi
 
 
 
+
   FNMATCH_H=
   gl_fnmatch_required_lowercase=`
     echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
@@ -12101,6 +12486,10 @@ if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FAL
   as_fn_error "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
+  as_fn_error "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
   as_fn_error "conditional \"GL_GENERATE_FNMATCH_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/gdb/gnulib/import/Makefile.am b/gdb/gnulib/import/Makefile.am
index 12c1c93..aba506d 100644
--- a/gdb/gnulib/import/Makefile.am
+++ b/gdb/gnulib/import/Makefile.am
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu inttypes memmem update-copyright
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files errno fnmatch-gnu inttypes memmem update-copyright
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -127,6 +127,40 @@ CLEANFILES += configmake.h configmake.h-t
 
 ## end   gnulib module configmake
 
+## begin gnulib module errno
+
+BUILT_SOURCES += $(ERRNO_H)
+
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+if GL_GENERATE_ERRNO_H
+errno.h: errno.in.h $(top_builddir)/config.status
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+	      -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+	      -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+	      -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+	      -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+	      -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+	      -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+	      -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+	      < $(srcdir)/errno.in.h; \
+	} > $@-t && \
+	mv $@-t $@
+else
+errno.h: $(top_builddir)/config.status
+	rm -f $@
+endif
+MOSTLYCLEANFILES += errno.h errno.h-t
+
+EXTRA_DIST += errno.in.h
+
+## end   gnulib module errno
+
 ## begin gnulib module fnmatch
 
 BUILT_SOURCES += $(FNMATCH_H)
diff --git a/gdb/gnulib/import/Makefile.in b/gdb/gnulib/import/Makefile.in
index 514380b..c1579b5 100644
--- a/gdb/gnulib/import/Makefile.in
+++ b/gdb/gnulib/import/Makefile.in
@@ -36,7 +36,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu inttypes memmem update-copyright
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files errno fnmatch-gnu inttypes memmem update-copyright
 
 
 
@@ -67,6 +67,7 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
 	$(top_srcdir)/import/m4/alloca.m4 \
 	$(top_srcdir)/import/m4/codeset.m4 \
 	$(top_srcdir)/import/m4/configmake.m4 \
+	$(top_srcdir)/import/m4/errno_h.m4 \
 	$(top_srcdir)/import/m4/extensions.m4 \
 	$(top_srcdir)/import/m4/fcntl-o.m4 \
 	$(top_srcdir)/import/m4/fnmatch.m4 \
@@ -192,6 +193,13 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FNMATCH_H = @FNMATCH_H@
 GLIBC21 = @GLIBC21@
@@ -389,12 +397,14 @@ LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
 NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
@@ -527,11 +537,11 @@ SUBDIRS =
 noinst_HEADERS = 
 noinst_LIBRARIES = libgnu.a
 noinst_LTLIBRARIES = 
-EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h fnmatch.c \
-	fnmatch.in.h fnmatch_loop.c inttypes.in.h config.charset \
-	ref-add.sin ref-del.sin mbrtowc.c mbsinit.c mbsrtowcs-impl.h \
-	mbsrtowcs-state.c mbsrtowcs.c memchr.c memchr.valgrind \
-	memmem.c str-two-way.h \
+EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h errno.in.h \
+	fnmatch.c fnmatch.in.h fnmatch_loop.c inttypes.in.h \
+	config.charset ref-add.sin ref-del.sin mbrtowc.c mbsinit.c \
+	mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c memchr.c \
+	memchr.valgrind memmem.c str-two-way.h \
 	$(top_srcdir)/import/extra/snippet/arg-nonnull.h \
 	$(top_srcdir)/import/extra/snippet/c++defs.h \
 	$(top_srcdir)/import/extra/snippet/warn-on-use.h stdbool.in.h \
@@ -548,16 +558,16 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h fnmatch.c \
 # statements but through direct file reference. Therefore this snippet must be
 # present in all Makefile.am that need it. This is ensured by the applicability
 # 'all' defined above.
-BUILT_SOURCES = $(ALLOCA_H) configmake.h $(FNMATCH_H) inttypes.h \
-	arg-nonnull.h c++defs.h warn-on-use.h $(STDBOOL_H) $(STDDEF_H) \
-	$(STDINT_H) string.h wchar.h wctype.h
+BUILT_SOURCES = $(ALLOCA_H) configmake.h $(ERRNO_H) $(FNMATCH_H) \
+	inttypes.h arg-nonnull.h c++defs.h warn-on-use.h $(STDBOOL_H) \
+	$(STDDEF_H) $(STDINT_H) string.h wchar.h wctype.h
 SUFFIXES = .sed .sin
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t fnmatch.h \
-	fnmatch.h-t inttypes.h inttypes.h-t arg-nonnull.h \
-	arg-nonnull.h-t c++defs.h c++defs.h-t warn-on-use.h \
-	warn-on-use.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t \
-	stdint.h stdint.h-t string.h string.h-t wchar.h wchar.h-t \
-	wctype.h wctype.h-t
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t errno.h \
+	errno.h-t fnmatch.h fnmatch.h-t inttypes.h inttypes.h-t \
+	arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \
+	warn-on-use.h warn-on-use.h-t stdbool.h stdbool.h-t stddef.h \
+	stddef.h-t stdint.h stdint.h-t string.h string.h-t wchar.h \
+	wchar.h-t wctype.h wctype.h-t
 MOSTLYCLEANDIRS = 
 CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
 	ref-del.sed
@@ -1029,6 +1039,28 @@ configmake.h: Makefile
 	} | sed '/""/d' > $@-t && \
 	mv -f $@-t $@
 
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_TRUE@	$(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ERRNO_H_TRUE@	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ERRNO_H_TRUE@	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@	      < $(srcdir)/errno.in.h; \
+@GL_GENERATE_ERRNO_H_TRUE@	} > $@-t && \
+@GL_GENERATE_ERRNO_H_TRUE@	mv $@-t $@
+@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_FALSE@	rm -f $@
+
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
 @GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
diff --git a/gdb/gnulib/import/errno.in.h b/gdb/gnulib/import/errno.in.h
new file mode 100644
index 0000000..f9612c3
--- /dev/null
+++ b/gdb/gnulib/import/errno.in.h
@@ -0,0 +1,279 @@
+/* A POSIX-like <errno.h>.
+
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+#define _@GUARD_PREFIX@_ERRNO_H
+
+
+/* On native Windows platforms, many macros are not defined.  */
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* These are the same values as defined by MSVC 10, for interoperability.  */
+
+#  ifndef ENOMSG
+#   define ENOMSG    122
+#   define GNULIB_defined_ENOMSG 1
+#  endif
+
+#  ifndef EIDRM
+#   define EIDRM     111
+#   define GNULIB_defined_EIDRM 1
+#  endif
+
+#  ifndef ENOLINK
+#   define ENOLINK   121
+#   define GNULIB_defined_ENOLINK 1
+#  endif
+
+#  ifndef EPROTO
+#   define EPROTO    134
+#   define GNULIB_defined_EPROTO 1
+#  endif
+
+#  ifndef EBADMSG
+#   define EBADMSG   104
+#   define GNULIB_defined_EBADMSG 1
+#  endif
+
+#  ifndef EOVERFLOW
+#   define EOVERFLOW 132
+#   define GNULIB_defined_EOVERFLOW 1
+#  endif
+
+#  ifndef ENOTSUP
+#   define ENOTSUP   129
+#   define GNULIB_defined_ENOTSUP 1
+#  endif
+
+#  ifndef ENETRESET
+#   define ENETRESET 117
+#   define GNULIB_defined_ENETRESET 1
+#  endif
+
+#  ifndef ECONNABORTED
+#   define ECONNABORTED 106
+#   define GNULIB_defined_ECONNABORTED 1
+#  endif
+
+#  ifndef ECANCELED
+#   define ECANCELED 105
+#   define GNULIB_defined_ECANCELED 1
+#  endif
+
+#  ifndef EOWNERDEAD
+#   define EOWNERDEAD 133
+#   define GNULIB_defined_EOWNERDEAD 1
+#  endif
+
+#  ifndef ENOTRECOVERABLE
+#   define ENOTRECOVERABLE 127
+#   define GNULIB_defined_ENOTRECOVERABLE 1
+#  endif
+
+#  ifndef EINPROGRESS
+#   define EINPROGRESS     112
+#   define EALREADY        103
+#   define ENOTSOCK        128
+#   define EDESTADDRREQ    109
+#   define EMSGSIZE        115
+#   define EPROTOTYPE      136
+#   define ENOPROTOOPT     123
+#   define EPROTONOSUPPORT 135
+#   define EOPNOTSUPP      130
+#   define EAFNOSUPPORT    102
+#   define EADDRINUSE      100
+#   define EADDRNOTAVAIL   101
+#   define ENETDOWN        116
+#   define ENETUNREACH     118
+#   define ECONNRESET      108
+#   define ENOBUFS         119
+#   define EISCONN         113
+#   define ENOTCONN        126
+#   define ETIMEDOUT       138
+#   define ECONNREFUSED    107
+#   define ELOOP           114
+#   define EHOSTUNREACH    110
+#   define EWOULDBLOCK     140
+#   define GNULIB_defined_ESOCK 1
+#  endif
+
+#  ifndef ETXTBSY
+#   define ETXTBSY         139
+#   define ENODATA         120  /* not required by POSIX */
+#   define ENOSR           124  /* not required by POSIX */
+#   define ENOSTR          125  /* not required by POSIX */
+#   define ETIME           137  /* not required by POSIX */
+#   define EOTHER          131  /* not required by POSIX */
+#   define GNULIB_defined_ESTREAMS 1
+#  endif
+
+/* These are intentionally the same values as the WSA* error numbers, defined
+   in <winsock2.h>.  */
+#  define ESOCKTNOSUPPORT 10044  /* not required by POSIX */
+#  define EPFNOSUPPORT    10046  /* not required by POSIX */
+#  define ESHUTDOWN       10058  /* not required by POSIX */
+#  define ETOOMANYREFS    10059  /* not required by POSIX */
+#  define EHOSTDOWN       10064  /* not required by POSIX */
+#  define EPROCLIM        10067  /* not required by POSIX */
+#  define EUSERS          10068  /* not required by POSIX */
+#  define EDQUOT          10069
+#  define ESTALE          10070
+#  define EREMOTE         10071  /* not required by POSIX */
+#  define GNULIB_defined_EWINSOCK 1
+
+# endif
+
+
+/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
+   EMULTIHOP, ENOLINK, EOVERFLOW are not defined.  */
+# if @EMULTIHOP_HIDDEN@
+#  define EMULTIHOP @EMULTIHOP_VALUE@
+#  define GNULIB_defined_EMULTIHOP 1
+# endif
+# if @ENOLINK_HIDDEN@
+#  define ENOLINK   @ENOLINK_VALUE@
+#  define GNULIB_defined_ENOLINK 1
+# endif
+# if @EOVERFLOW_HIDDEN@
+#  define EOVERFLOW @EOVERFLOW_VALUE@
+#  define GNULIB_defined_EOVERFLOW 1
+# endif
+
+
+/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
+   EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
+   Likewise, on NonStop Kernel, EDQUOT is not defined.
+   Define them here.  Values >= 2000 seem safe to use: Solaris ESTALE = 151,
+   HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
+
+   Note: When one of these systems defines some of these macros some day,
+   binaries will have to be recompiled so that they recognizes the new
+   errno values from the system.  */
+
+# ifndef ENOMSG
+#  define ENOMSG    2000
+#  define GNULIB_defined_ENOMSG 1
+# endif
+
+# ifndef EIDRM
+#  define EIDRM     2001
+#  define GNULIB_defined_EIDRM 1
+# endif
+
+# ifndef ENOLINK
+#  define ENOLINK   2002
+#  define GNULIB_defined_ENOLINK 1
+# endif
+
+# ifndef EPROTO
+#  define EPROTO    2003
+#  define GNULIB_defined_EPROTO 1
+# endif
+
+# ifndef EMULTIHOP
+#  define EMULTIHOP 2004
+#  define GNULIB_defined_EMULTIHOP 1
+# endif
+
+# ifndef EBADMSG
+#  define EBADMSG   2005
+#  define GNULIB_defined_EBADMSG 1
+# endif
+
+# ifndef EOVERFLOW
+#  define EOVERFLOW 2006
+#  define GNULIB_defined_EOVERFLOW 1
+# endif
+
+# ifndef ENOTSUP
+#  define ENOTSUP   2007
+#  define GNULIB_defined_ENOTSUP 1
+# endif
+
+# ifndef ENETRESET
+#  define ENETRESET 2011
+#  define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+#  define ECONNABORTED 2012
+#  define GNULIB_defined_ECONNABORTED 1
+# endif
+
+# ifndef ESTALE
+#  define ESTALE    2009
+#  define GNULIB_defined_ESTALE 1
+# endif
+
+# ifndef EDQUOT
+#  define EDQUOT 2010
+#  define GNULIB_defined_EDQUOT 1
+# endif
+
+# ifndef ECANCELED
+#  define ECANCELED 2008
+#  define GNULIB_defined_ECANCELED 1
+# endif
+
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+   defined.  */
+
+# ifndef EOWNERDEAD
+#  if defined __sun
+    /* Use the same values as defined for Solaris >= 8, for
+       interoperability.  */
+#   define EOWNERDEAD      58
+#   define ENOTRECOVERABLE 59
+#  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+    /* We have a conflict here: pthreads-win32 defines these values
+       differently than MSVC 10.  It's hairy to decide which one to use.  */
+#   if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+     /* Use the same values as defined by pthreads-win32, for
+        interoperability.  */
+#    define EOWNERDEAD      43
+#    define ENOTRECOVERABLE 44
+#   else
+     /* Use the same values as defined by MSVC 10, for
+        interoperability.  */
+#    define EOWNERDEAD      133
+#    define ENOTRECOVERABLE 127
+#   endif
+#  else
+#   define EOWNERDEAD      2013
+#   define ENOTRECOVERABLE 2014
+#  endif
+#  define GNULIB_defined_EOWNERDEAD 1
+#  define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
+
+# ifndef EILSEQ
+#  define EILSEQ 2015
+#  define GNULIB_defined_EILSEQ 1
+# endif
+
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
diff --git a/gdb/gnulib/import/m4/errno_h.m4 b/gdb/gnulib/import/m4/errno_h.m4
new file mode 100644
index 0000000..4e33ba8
--- /dev/null
+++ b/gdb/gnulib/import/m4/errno_h.m4
@@ -0,0 +1,137 @@
+# errno_h.m4 serial 12
+dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
+    AC_EGREP_CPP([booboo],[
+#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
+      ],
+      [gl_cv_header_errno_h_complete=no],
+      [gl_cv_header_errno_h_complete=yes])
+  ])
+  if test $gl_cv_header_errno_h_complete = yes; then
+    ERRNO_H=''
+  else
+    gl_NEXT_HEADERS([errno.h])
+    ERRNO_H='errno.h'
+  fi
+  AC_SUBST([ERRNO_H])
+  AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
+  gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
+  gl_REPLACE_ERRNO_VALUE([ENOLINK])
+  gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
+])
+
+# Assuming $1 = EOVERFLOW.
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX.  But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
+# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+# Check for the value of EOVERFLOW.
+# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
+AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
+[
+  if test -n "$ERRNO_H"; then
+    AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
+      AC_EGREP_CPP([yes],[
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+      ],
+      [gl_cv_header_errno_h_]$1[=yes],
+      [gl_cv_header_errno_h_]$1[=no])
+      if test $gl_cv_header_errno_h_]$1[ = no; then
+        AC_EGREP_CPP([yes],[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+          ], [gl_cv_header_errno_h_]$1[=hidden])
+        if test $gl_cv_header_errno_h_]$1[ = hidden; then
+          dnl The macro exists but is hidden.
+          dnl Define it to the same value.
+          AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+])
+        fi
+      fi
+    ])
+    case $gl_cv_header_errno_h_]$1[ in
+      yes | no)
+        ]$1[_HIDDEN=0; ]$1[_VALUE=
+        ;;
+      *)
+        ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
+        ;;
+    esac
+    AC_SUBST($1[_HIDDEN])
+    AC_SUBST($1[_VALUE])
+  fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/gdb/gnulib/import/m4/gnulib-cache.m4 b/gdb/gnulib/import/m4/gnulib-cache.m4
index 22e6796..6110017 100644
--- a/gdb/gnulib/import/m4/gnulib-cache.m4
+++ b/gdb/gnulib/import/m4/gnulib-cache.m4
@@ -27,11 +27,12 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu inttypes memmem update-copyright
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files errno fnmatch-gnu inttypes memmem update-copyright
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
 gl_MODULES([
+  errno
   fnmatch-gnu
   inttypes
   memmem
diff --git a/gdb/gnulib/import/m4/gnulib-comp.m4 b/gdb/gnulib/import/m4/gnulib-comp.m4
index c63587d..ff4608d 100644
--- a/gdb/gnulib/import/m4/gnulib-comp.m4
+++ b/gdb/gnulib/import/m4/gnulib-comp.m4
@@ -41,6 +41,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module alloca:
   # Code from module alloca-opt:
   # Code from module configmake:
+  # Code from module errno:
   # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   # Code from module fnmatch:
@@ -89,6 +90,7 @@ AC_DEFUN([gl_INIT],
   gl_source_base='import'
   gl_FUNC_ALLOCA
   gl_CONFIGMAKE_PREP
+  gl_HEADER_ERRNO_H
   gl_FUNC_FNMATCH_POSIX
   if test -n "$FNMATCH_H"; then
     AC_LIBOBJ([fnmatch])
@@ -292,6 +294,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/alloca.c
   lib/alloca.in.h
   lib/config.charset
+  lib/errno.in.h
   lib/fnmatch.c
   lib/fnmatch.in.h
   lib/fnmatch_loop.c
@@ -323,6 +326,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/alloca.m4
   m4/codeset.m4
   m4/configmake.m4
+  m4/errno_h.m4
   m4/extensions.m4
   m4/fcntl-o.m4
   m4/fnmatch.m4
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index 2d9d0ac..3f409a0 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,8 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright \
+			 errno"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="daf7f8c02242c535d596231e2f655109b97fa2bc"
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [RFA/commit 1/2] update gnulib to 2012-11-05.
@ 2012-12-17 15:08 Joel Brobecker
  2012-12-17 15:08 ` [RFA/commit 2/2] Import gnulib's errno module Joel Brobecker
  2012-12-17 18:26 ` [RFA/commit 1/2] update gnulib to 2012-11-05 Tom Tromey
  0 siblings, 2 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-17 15:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

This is just a straight update to revision
daf7f8c02242c535d596231e2f655109b97fa2bc.

This version includes a fix in module errno which we will need
in order to build GDBserver on ppc-lynx178.

gdb/ChangeLog:

        * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
        daf7f8c02242c535d596231e2f655109b97fa2bc.
        * gnulib/import/alloca.in.h: Update.
        * gnulib/import/localcharset.c: Update.
        * gnulib/import/m4/fcntl-o.m4: Update.
        * gnulib/import/m4/gnulib-cache.m4: Update.
        * gnulib/import/m4/gnulib-comp.m4: Update.
        * gnulib/import/stdbool.in.h: Update.
        * gnulib/import/verify.h: Update.
        * gnulib/configure: Regenerate.

Tested on x86_64-linux. Any objections?

---
 gdb/gnulib/configure                 |   47 ++++++++------
 gdb/gnulib/import/alloca.in.h        |    7 ++
 gdb/gnulib/import/localcharset.c     |    7 ++
 gdb/gnulib/import/m4/fcntl-o.m4      |   13 +++-
 gdb/gnulib/import/m4/gnulib-cache.m4 |    2 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |  116 +++++++++++++++++-----------------
 gdb/gnulib/import/stdbool.in.h       |   51 +++++++++------
 gdb/gnulib/import/verify.h           |    6 +-
 gdb/gnulib/update-gnulib.sh          |    2 +-
 9 files changed, 151 insertions(+), 100 deletions(-)

diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
index 9de03a0..765b1aa 100644
--- a/gdb/gnulib/configure
+++ b/gdb/gnulib/configure
@@ -6586,7 +6586,18 @@ main ()
             #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
+              if (symlink ("/dev/null", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              if (unlink (sym) != 0 || symlink (".", sym) != 0)
                 result |= 2;
               else
                 {
@@ -8479,7 +8490,7 @@ else
 fi
 
 
-if test -n "$FNMATCH_H"; then
+  if test -n "$FNMATCH_H"; then
 
 
 
@@ -8545,13 +8556,13 @@ _ACEOF
 
 
 
-fi
+  fi
 
 
 
 
 
-if test -n "$FNMATCH_H"; then
+  if test -n "$FNMATCH_H"; then
 
 
 
@@ -8617,7 +8628,7 @@ _ACEOF
 
 
 
-fi
+  fi
 
 
 
@@ -8885,7 +8896,7 @@ $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
 
 
 
-LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
 
 
 
@@ -9468,7 +9479,7 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
     fi
   fi
 
-if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
@@ -9482,7 +9493,7 @@ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -9709,7 +9720,7 @@ _ACEOF
     fi
   fi
 
-if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
 
 
@@ -9723,7 +9734,7 @@ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -10063,7 +10074,7 @@ $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
     fi
   fi
 
-if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
 
 
 
@@ -10087,7 +10098,7 @@ if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -10104,7 +10115,7 @@ $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
 
 
 
-if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
 
 
 
@@ -10129,7 +10140,7 @@ fi
 done
 
 
-fi
+  fi
 
 
 
@@ -10240,7 +10251,7 @@ $as_echo "$gl_cv_func_memmem_works_fast" >&6; }
     esac
   fi
 
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
 
 
@@ -10251,7 +10262,7 @@ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
   gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
 
-fi
+  fi
 
 
 
@@ -10368,7 +10379,7 @@ $as_echo "$gl_cv_func_memmem_works_always" >&6; }
   fi
   :
 
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
 
 
@@ -10379,7 +10390,7 @@ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
   gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
 
-fi
+  fi
 
 
 
diff --git a/gdb/gnulib/import/alloca.in.h b/gdb/gnulib/import/alloca.in.h
index e94eb68..d20f4b8 100644
--- a/gdb/gnulib/import/alloca.in.h
+++ b/gdb/gnulib/import/alloca.in.h
@@ -44,6 +44,13 @@
 #  define alloca _alloca
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+#  ifdef  __cplusplus
+extern "C"
+#  endif
+void *_alloca (unsigned short);
+#  pragma intrinsic (_alloca)
+#  define alloca _alloca
 # else
 #  include <stddef.h>
 #  ifdef  __cplusplus
diff --git a/gdb/gnulib/import/localcharset.c b/gdb/gnulib/import/localcharset.c
index b5ee2d6..8d16c87 100644
--- a/gdb/gnulib/import/localcharset.c
+++ b/gdb/gnulib/import/localcharset.c
@@ -542,5 +542,12 @@ locale_charset (void)
   if (codeset[0] == '\0')
     codeset = "ASCII";
 
+#ifdef DARWIN7
+  /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+     (the default codeset) does not work when MB_CUR_MAX is 1.  */
+  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
+    codeset = "ASCII";
+#endif
+
   return codeset;
 }
diff --git a/gdb/gnulib/import/m4/fcntl-o.m4 b/gdb/gnulib/import/m4/fcntl-o.m4
index 9862741..740e78b 100644
--- a/gdb/gnulib/import/m4/fcntl-o.m4
+++ b/gdb/gnulib/import/m4/fcntl-o.m4
@@ -50,7 +50,18 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
             #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
+              if (symlink ("/dev/null", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              if (unlink (sym) != 0 || symlink (".", sym) != 0)
                 result |= 2;
               else
                 {
diff --git a/gdb/gnulib/import/m4/gnulib-cache.m4 b/gdb/gnulib/import/m4/gnulib-cache.m4
index 895c571..22e6796 100644
--- a/gdb/gnulib/import/m4/gnulib-cache.m4
+++ b/gdb/gnulib/import/m4/gnulib-cache.m4
@@ -47,5 +47,5 @@ gl_LIB([libgnu])
 gl_MAKEFILE_NAME([])
 gl_MACRO_PREFIX([gl])
 gl_PO_DOMAIN([])
-gl_WITNESS_C_DOMAIN([])
+gl_WITNESS_C_MACRO([])
 gl_VC_FILES([false])
diff --git a/gdb/gnulib/import/m4/gnulib-comp.m4 b/gdb/gnulib/import/m4/gnulib-comp.m4
index 954ea21..c63587d 100644
--- a/gdb/gnulib/import/m4/gnulib-comp.m4
+++ b/gdb/gnulib/import/m4/gnulib-comp.m4
@@ -87,64 +87,64 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='import'
-gl_FUNC_ALLOCA
-gl_CONFIGMAKE_PREP
-gl_FUNC_FNMATCH_POSIX
-if test -n "$FNMATCH_H"; then
-  AC_LIBOBJ([fnmatch])
-  gl_PREREQ_FNMATCH
-fi
-gl_FUNC_FNMATCH_GNU
-if test -n "$FNMATCH_H"; then
-  AC_LIBOBJ([fnmatch])
-  gl_PREREQ_FNMATCH
-fi
-gl_INTTYPES_H
-gl_INTTYPES_INCOMPLETE
-gl_LOCALCHARSET
-LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
-AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
-gl_FUNC_MBRTOWC
-if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-  AC_LIBOBJ([mbrtowc])
-  gl_PREREQ_MBRTOWC
-fi
-gl_WCHAR_MODULE_INDICATOR([mbrtowc])
-gl_FUNC_MBSINIT
-if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-  AC_LIBOBJ([mbsinit])
-  gl_PREREQ_MBSINIT
-fi
-gl_WCHAR_MODULE_INDICATOR([mbsinit])
-gl_FUNC_MBSRTOWCS
-if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
-  AC_LIBOBJ([mbsrtowcs])
-  AC_LIBOBJ([mbsrtowcs-state])
-  gl_PREREQ_MBSRTOWCS
-fi
-gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
-gl_FUNC_MEMCHR
-if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
-  AC_LIBOBJ([memchr])
-  gl_PREREQ_MEMCHR
-fi
-gl_STRING_MODULE_INDICATOR([memchr])
-gl_FUNC_MEMMEM
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
-  AC_LIBOBJ([memmem])
-fi
-gl_FUNC_MEMMEM_SIMPLE
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
-  AC_LIBOBJ([memmem])
-fi
-gl_STRING_MODULE_INDICATOR([memmem])
-gl_MULTIARCH
-AM_STDBOOL_H
-gl_STDDEF_H
-gl_STDINT_H
-gl_HEADER_STRING_H
-gl_WCHAR_H
-gl_WCTYPE_H
+  gl_FUNC_ALLOCA
+  gl_CONFIGMAKE_PREP
+  gl_FUNC_FNMATCH_POSIX
+  if test -n "$FNMATCH_H"; then
+    AC_LIBOBJ([fnmatch])
+    gl_PREREQ_FNMATCH
+  fi
+  gl_FUNC_FNMATCH_GNU
+  if test -n "$FNMATCH_H"; then
+    AC_LIBOBJ([fnmatch])
+    gl_PREREQ_FNMATCH
+  fi
+  gl_INTTYPES_H
+  gl_INTTYPES_INCOMPLETE
+  gl_LOCALCHARSET
+  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+  gl_FUNC_MBRTOWC
+  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+    AC_LIBOBJ([mbrtowc])
+    gl_PREREQ_MBRTOWC
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+  gl_FUNC_MBSINIT
+  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+    AC_LIBOBJ([mbsinit])
+    gl_PREREQ_MBSINIT
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbsinit])
+  gl_FUNC_MBSRTOWCS
+  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+    AC_LIBOBJ([mbsrtowcs])
+    AC_LIBOBJ([mbsrtowcs-state])
+    gl_PREREQ_MBSRTOWCS
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
+  gl_FUNC_MEMCHR
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+    AC_LIBOBJ([memchr])
+    gl_PREREQ_MEMCHR
+  fi
+  gl_STRING_MODULE_INDICATOR([memchr])
+  gl_FUNC_MEMMEM
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+    AC_LIBOBJ([memmem])
+  fi
+  gl_FUNC_MEMMEM_SIMPLE
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+    AC_LIBOBJ([memmem])
+  fi
+  gl_STRING_MODULE_INDICATOR([memmem])
+  gl_MULTIARCH
+  AM_STDBOOL_H
+  gl_STDDEF_H
+  gl_STDINT_H
+  gl_HEADER_STRING_H
+  gl_WCHAR_H
+  gl_WCTYPE_H
   # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
diff --git a/gdb/gnulib/import/stdbool.in.h b/gdb/gnulib/import/stdbool.in.h
index ed1f9aa..1f8caee 100644
--- a/gdb/gnulib/import/stdbool.in.h
+++ b/gdb/gnulib/import/stdbool.in.h
@@ -66,24 +66,19 @@
 # undef true
 #endif
 
-/* For the sake of symbolic names in gdb, we define true and false as
-   enum constants, not only as macros.
-   It is tempting to write
-      typedef enum { false = 0, true = 1 } _Bool;
-   so that gdb prints values of type 'bool' symbolically. But if we do
-   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
-   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
-   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
-   enum; this ensures that '_Bool' promotes to 'int'.  */
-#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
+#ifdef __cplusplus
+# define _Bool bool
+# define bool bool
+#else
+# if defined __BEOS__ && !defined __HAIKU__
   /* A compiler known to have 'bool'.  */
   /* If the compiler already has both 'bool' and '_Bool', we can assume they
      are the same types.  */
-# if !@HAVE__BOOL@
+#  if !@HAVE__BOOL@
 typedef bool _Bool;
-# endif
-#else
-# if !defined __GNUC__
+#  endif
+# else
+#  if !defined __GNUC__
    /* If @HAVE__BOOL@:
         Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
         the built-in _Bool type is used.  See
@@ -103,19 +98,35 @@ typedef bool _Bool;
           "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
         The only benefit of the enum, debuggability, is not important
         with these compilers.  So use 'signed char' and no enum.  */
-#  define _Bool signed char
-# else
+#   define _Bool signed char
+#  else
    /* With this compiler, trust the _Bool type if the compiler has it.  */
-#  if !@HAVE__BOOL@
+#   if !@HAVE__BOOL@
+   /* For the sake of symbolic names in gdb, define true and false as
+      enum constants, not only as macros.
+      It is tempting to write
+         typedef enum { false = 0, true = 1 } _Bool;
+      so that gdb prints values of type 'bool' symbolically.  But then
+      values of type '_Bool' might promote to 'int' or 'unsigned int'
+      (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+      (see ISO C 99 6.3.1.1.(2)).  So add a negative value to the
+      enum; this ensures that '_Bool' promotes to 'int'.  */
 typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+#   endif
 #  endif
 # endif
+# define bool _Bool
 #endif
-#define bool _Bool
 
 /* The other macros must be usable in preprocessor directives.  */
-#define false 0
-#define true 1
+#ifdef __cplusplus
+# define false false
+# define true true
+#else
+# define false 0
+# define true 1
+#endif
+
 #define __bool_true_false_are_defined 1
 
 #endif /* _GL_STDBOOL_H */
diff --git a/gdb/gnulib/import/verify.h b/gdb/gnulib/import/verify.h
index cef14ad..0c320b1 100644
--- a/gdb/gnulib/import/verify.h
+++ b/gdb/gnulib/import/verify.h
@@ -125,7 +125,7 @@
        extern int (*dummy (void)) [sizeof (struct {...})];
 
    * GCC warns about duplicate declarations of the dummy function if
-     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     -Wredundant-decls is used.  GCC 4.3 and later have a builtin
      __COUNTER__ macro that can let us generate unique identifiers for
      each dummy function, to suppress this warning.
 
@@ -133,6 +133,10 @@
      which do not support _Static_assert, also do not warn about the
      last declaration mentioned above.
 
+   * GCC warns if -Wnested-externs is enabled and verify() is used
+     within a function body; but inside a function, you can always
+     arrange to use verify_expr() instead.
+
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index 1bab512..2d9d0ac 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -32,7 +32,7 @@
 IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright"
 
 # The gnulib commit ID to use for the update.
-GNULIB_COMMIT_SHA1="a39f53ccb70a613e647e1019fb4c63645220267e"
+GNULIB_COMMIT_SHA1="daf7f8c02242c535d596231e2f655109b97fa2bc"
 
 # The expected version number for the various auto tools we will
 # use after the import.
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 1/2] update gnulib to 2012-11-05.
  2012-12-17 15:08 [RFA/commit 1/2] update gnulib to 2012-11-05 Joel Brobecker
  2012-12-17 15:08 ` [RFA/commit 2/2] Import gnulib's errno module Joel Brobecker
@ 2012-12-17 18:26 ` Tom Tromey
  2012-12-18  6:06   ` Joel Brobecker
  1 sibling, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2012-12-17 18:26 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> This is just a straight update to revision
Joel> daf7f8c02242c535d596231e2f655109b97fa2bc.

Joel> Tested on x86_64-linux. Any objections?

No objection, but curious why not pick the latest revision?

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 1/2] update gnulib to 2012-11-05.
  2012-12-17 18:26 ` [RFA/commit 1/2] update gnulib to 2012-11-05 Tom Tromey
@ 2012-12-18  6:06   ` Joel Brobecker
  2012-12-18 16:13     ` Tom Tromey
  0 siblings, 1 reply; 21+ messages in thread
From: Joel Brobecker @ 2012-12-18  6:06 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

> Joel> This is just a straight update to revision
> Joel> daf7f8c02242c535d596231e2f655109b97fa2bc.
> 
> Joel> Tested on x86_64-linux. Any objections?
> 
> No objection, but curious why not pick the latest revision?

Somehow, I thought we were only importing the revisions that
contains the fix that we need... Attached is what I checked in,
which updates gnulib to the current HEAD.

gdb/ChangeLog:

        * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
        8d5bd1402003bd0153984b138735adf537d960b0.
        * gnulib/aclocal.m4, configure, config.in: Regenerate.
        * gnulib/import/m4/extern-inline.m4: Import.
        * gnulib/import/wctype-h.c: Import.
        * gnulib/import/Makefile.am: Update.
        * gnulib/import/Makefile.in: Update.
        * gnulib/import/alloca.in.h: Update.
        * gnulib/import/extra/snippet/warn-on-use.h: Update.
        * gnulib/import/localcharset.c: Update.
        * gnulib/import/m4/fcntl-o.m4: Update.
        * gnulib/import/m4/gnulib-cache.m4: Update.
        * gnulib/import/m4/gnulib-comp.m4: Update.
        * gnulib/import/m4/wctype_h.m4: Update.
        * gnulib/import/stdbool.in.h: Update.
        * gnulib/import/verify.h: Update.
        * gnulib/import/wctype.in.h: Update.

Thanks,
-- 
Joel

[-- Attachment #2: 0001-Update-gnulib-to-current-HEAD.patch --]
[-- Type: text/x-diff, Size: 32919 bytes --]

From 817baeed4ef4118e8997ae9589db3fe6186c9a89 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Tue, 18 Dec 2012 08:45:10 +0400
Subject: [PATCH 1/2] Update gnulib to current HEAD.

gdb/ChangeLog:

        * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
        8d5bd1402003bd0153984b138735adf537d960b0.
        * gnulib/aclocal.m4, configure, config.in: Regenerate.
        * gnulib/import/m4/extern-inline.m4: Import.
        * gnulib/import/wctype-h.c: Import.
        * gnulib/import/Makefile.am: Update.
        * gnulib/import/Makefile.in: Update.
        * gnulib/import/alloca.in.h: Update.
        * gnulib/import/extra/snippet/warn-on-use.h: Update.
        * gnulib/import/localcharset.c: Update.
        * gnulib/import/m4/fcntl-o.m4: Update.
        * gnulib/import/m4/gnulib-cache.m4: Update.
        * gnulib/import/m4/gnulib-comp.m4: Update.
        * gnulib/import/m4/wctype_h.m4: Update.
        * gnulib/import/stdbool.in.h: Update.
        * gnulib/import/verify.h: Update.
        * gnulib/import/wctype.in.h: Update.
---
 gdb/ChangeLog                                 |   20 +++++
 gdb/gnulib/aclocal.m4                         |    1 +
 gdb/gnulib/config.in                          |   58 ++++++++++--
 gdb/gnulib/configure                          |   96 +++++++-------------
 gdb/gnulib/import/Makefile.am                 |    1 +
 gdb/gnulib/import/Makefile.in                 |    8 +-
 gdb/gnulib/import/alloca.in.h                 |    7 ++
 gdb/gnulib/import/extra/snippet/warn-on-use.h |    2 +-
 gdb/gnulib/import/localcharset.c              |    7 ++
 gdb/gnulib/import/m4/extern-inline.m4         |   62 +++++++++++++
 gdb/gnulib/import/m4/fcntl-o.m4               |   13 ++-
 gdb/gnulib/import/m4/gnulib-cache.m4          |    2 +-
 gdb/gnulib/import/m4/gnulib-comp.m4           |  120 +++++++++++++------------
 gdb/gnulib/import/m4/wctype_h.m4              |    4 +-
 gdb/gnulib/import/stdbool.in.h                |   51 ++++++-----
 gdb/gnulib/import/verify.h                    |    6 +-
 gdb/gnulib/import/wctype-h.c                  |    4 +
 gdb/gnulib/import/wctype.in.h                 |   38 ++++----
 gdb/gnulib/update-gnulib.sh                   |    2 +-
 19 files changed, 330 insertions(+), 172 deletions(-)
 create mode 100644 gdb/gnulib/import/m4/extern-inline.m4
 create mode 100644 gdb/gnulib/import/wctype-h.c

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 00e0362..b84c753 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,25 @@
 2012-12-18  Joel Brobecker  <brobecker@adacore.com>
 
+	* gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
+	8d5bd1402003bd0153984b138735adf537d960b0.
+	* gnulib/aclocal.m4, configure, config.in: Regenerate.
+	* gnulib/import/m4/extern-inline.m4: Import.
+	* gnulib/import/wctype-h.c: Import.
+	* gnulib/import/Makefile.am: Update.
+	* gnulib/import/Makefile.in: Update.
+	* gnulib/import/alloca.in.h: Update.
+	* gnulib/import/extra/snippet/warn-on-use.h: Update.
+	* gnulib/import/localcharset.c: Update.
+	* gnulib/import/m4/fcntl-o.m4: Update.
+	* gnulib/import/m4/gnulib-cache.m4: Update.
+	* gnulib/import/m4/gnulib-comp.m4: Update.
+	* gnulib/import/m4/wctype_h.m4: Update.
+	* gnulib/import/stdbool.in.h: Update.
+	* gnulib/import/verify.h: Update.
+	* gnulib/import/wctype.in.h: Update.
+
+2012-12-18  Joel Brobecker  <brobecker@adacore.com>
+
 	* gnulib/update-gnulib.sh: Add call to autoheader.
 
 2012-12-17  Tom Tromey  <tromey@redhat.com>
diff --git a/gdb/gnulib/aclocal.m4 b/gdb/gnulib/aclocal.m4
index ead4506..f19993c 100644
--- a/gdb/gnulib/aclocal.m4
+++ b/gdb/gnulib/aclocal.m4
@@ -1017,6 +1017,7 @@ m4_include([import/m4/alloca.m4])
 m4_include([import/m4/codeset.m4])
 m4_include([import/m4/configmake.m4])
 m4_include([import/m4/extensions.m4])
+m4_include([import/m4/extern-inline.m4])
 m4_include([import/m4/fcntl-o.m4])
 m4_include([import/m4/fnmatch.m4])
 m4_include([import/m4/glibc21.m4])
diff --git a/gdb/gnulib/config.in b/gdb/gnulib/config.in
index 7d97b4b..34a71a0 100644
--- a/gdb/gnulib/config.in
+++ b/gdb/gnulib/config.in
@@ -528,15 +528,61 @@
 #endif
 
 
-/* Define to a replacement function name for fnmatch(). */
-#undef fnmatch
+/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
+   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
+   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
+     in an include file, before uses of _GL_INLINE.
+     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
+     when FOO is an inline function in the header; see
+     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
+   _GL_INLINE_HEADER_END contains useful stuff to put
+     in the same include file, after uses of _GL_INLINE.
+
+   Suppress the use of extern inline on Apple's platforms,
+   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : 199901L <= __STDC_VERSION__) \
+     && !defined __APPLE__)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
+# if __GNUC_GNU_INLINE__
+   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
+#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
 
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
+#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#  define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+#  define _GL_INLINE_HEADER_CONST_PRAGMA \
+     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+    _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
 #endif
 
+/* Define to a replacement function name for fnmatch(). */
+#undef fnmatch
+
 /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure
index 9de03a0..d9809cc 100644
--- a/gdb/gnulib/configure
+++ b/gdb/gnulib/configure
@@ -4290,6 +4290,7 @@ fi
   # Code from module configmake:
   # Code from module extensions:
 
+  # Code from module extern-inline:
   # Code from module fnmatch:
   # Code from module fnmatch-gnu:
   # Code from module include_next:
@@ -5126,6 +5127,9 @@ fi
 
 
 
+
+
+
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
 if test "${ac_cv_type_mbstate_t+set}" = set; then :
@@ -6586,7 +6590,18 @@ main ()
             #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
+              if (symlink ("/dev/null", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              if (unlink (sym) != 0 || symlink (".", sym) != 0)
                 result |= 2;
               else
                 {
@@ -8181,48 +8196,6 @@ $as_echo "#define HAVE_WINT_T 1" >>confdefs.h
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
 
    if false; then
   GL_COND_LIBTOOL_TRUE=
@@ -8343,6 +8316,7 @@ fi
 
 
 
+
   FNMATCH_H=
   gl_fnmatch_required_lowercase=`
     echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
@@ -8479,7 +8453,7 @@ else
 fi
 
 
-if test -n "$FNMATCH_H"; then
+  if test -n "$FNMATCH_H"; then
 
 
 
@@ -8545,13 +8519,13 @@ _ACEOF
 
 
 
-fi
+  fi
 
 
 
 
 
-if test -n "$FNMATCH_H"; then
+  if test -n "$FNMATCH_H"; then
 
 
 
@@ -8617,7 +8591,7 @@ _ACEOF
 
 
 
-fi
+  fi
 
 
 
@@ -8885,7 +8859,7 @@ $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
 
 
 
-LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
 
 
 
@@ -9468,7 +9442,7 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
     fi
   fi
 
-if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
@@ -9482,7 +9456,7 @@ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -9709,7 +9683,7 @@ _ACEOF
     fi
   fi
 
-if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
 
 
@@ -9723,7 +9697,7 @@ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -10063,7 +10037,7 @@ $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
     fi
   fi
 
-if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
 
 
 
@@ -10087,7 +10061,7 @@ if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
 
   :
 
-fi
+  fi
 
 
 
@@ -10104,7 +10078,7 @@ $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
 
 
 
-if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
 
 
 
@@ -10129,7 +10103,7 @@ fi
 done
 
 
-fi
+  fi
 
 
 
@@ -10240,7 +10214,7 @@ $as_echo "$gl_cv_func_memmem_works_fast" >&6; }
     esac
   fi
 
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
 
 
@@ -10251,7 +10225,7 @@ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
   gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
 
-fi
+  fi
 
 
 
@@ -10368,7 +10342,7 @@ $as_echo "$gl_cv_func_memmem_works_always" >&6; }
   fi
   :
 
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
 
 
@@ -10379,7 +10353,7 @@ if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
 
   gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext"
 
-fi
+  fi
 
 
 
@@ -10716,8 +10690,6 @@ fi
 
 
 
-
-
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
   else
diff --git a/gdb/gnulib/import/Makefile.am b/gdb/gnulib/import/Makefile.am
index 12c1c93..efa828f 100644
--- a/gdb/gnulib/import/Makefile.am
+++ b/gdb/gnulib/import/Makefile.am
@@ -739,6 +739,7 @@ EXTRA_DIST += wchar.in.h
 ## begin gnulib module wctype-h
 
 BUILT_SOURCES += wctype.h
+libgnu_a_SOURCES += wctype-h.c
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
diff --git a/gdb/gnulib/import/Makefile.in b/gdb/gnulib/import/Makefile.in
index 514380b..7b396c1 100644
--- a/gdb/gnulib/import/Makefile.in
+++ b/gdb/gnulib/import/Makefile.in
@@ -68,6 +68,7 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
 	$(top_srcdir)/import/m4/codeset.m4 \
 	$(top_srcdir)/import/m4/configmake.m4 \
 	$(top_srcdir)/import/m4/extensions.m4 \
+	$(top_srcdir)/import/m4/extern-inline.m4 \
 	$(top_srcdir)/import/m4/fcntl-o.m4 \
 	$(top_srcdir)/import/m4/fnmatch.m4 \
 	$(top_srcdir)/import/m4/glibc21.m4 \
@@ -108,7 +109,8 @@ CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 libgnu_a_AR = $(AR) $(ARFLAGS)
 am__DEPENDENCIES_1 =
-am_libgnu_a_OBJECTS = localcharset.$(OBJEXT) strnlen1.$(OBJEXT)
+am_libgnu_a_OBJECTS = localcharset.$(OBJEXT) strnlen1.$(OBJEXT) \
+	wctype-h.$(OBJEXT)
 libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -565,7 +567,8 @@ DISTCLEANFILES =
 MAINTAINERCLEANFILES = 
 AM_CPPFLAGS = 
 AM_CFLAGS = 
-libgnu_a_SOURCES = localcharset.h localcharset.c strnlen1.h strnlen1.c
+libgnu_a_SOURCES = localcharset.h localcharset.c strnlen1.h strnlen1.c \
+	wctype-h.c
 libgnu_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@
 libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@
 EXTRA_libgnu_a_SOURCES = alloca.c fnmatch.c fnmatch_loop.c mbrtowc.c \
@@ -645,6 +648,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmem.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/gdb/gnulib/import/alloca.in.h b/gdb/gnulib/import/alloca.in.h
index e94eb68..d20f4b8 100644
--- a/gdb/gnulib/import/alloca.in.h
+++ b/gdb/gnulib/import/alloca.in.h
@@ -44,6 +44,13 @@
 #  define alloca _alloca
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+#  ifdef  __cplusplus
+extern "C"
+#  endif
+void *_alloca (unsigned short);
+#  pragma intrinsic (_alloca)
+#  define alloca _alloca
 # else
 #  include <stddef.h>
 #  ifdef  __cplusplus
diff --git a/gdb/gnulib/import/extra/snippet/warn-on-use.h b/gdb/gnulib/import/extra/snippet/warn-on-use.h
index d4cb94f..51e69bb 100644
--- a/gdb/gnulib/import/extra/snippet/warn-on-use.h
+++ b/gdb/gnulib/import/extra/snippet/warn-on-use.h
@@ -55,7 +55,7 @@
    rather than issue the nice warning, but the end result of informing
    the developer about their portability problem is still achieved):
    #if HAVE_RAW_DECL_ENVIRON
-   static inline char ***rpl_environ (void) { return &environ; }
+   static char ***rpl_environ (void) { return &environ; }
    _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
    # undef environ
    # define environ (*rpl_environ ())
diff --git a/gdb/gnulib/import/localcharset.c b/gdb/gnulib/import/localcharset.c
index b5ee2d6..8d16c87 100644
--- a/gdb/gnulib/import/localcharset.c
+++ b/gdb/gnulib/import/localcharset.c
@@ -542,5 +542,12 @@ locale_charset (void)
   if (codeset[0] == '\0')
     codeset = "ASCII";
 
+#ifdef DARWIN7
+  /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+     (the default codeset) does not work when MB_CUR_MAX is 1.  */
+  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
+    codeset = "ASCII";
+#endif
+
   return codeset;
 }
diff --git a/gdb/gnulib/import/m4/extern-inline.m4 b/gdb/gnulib/import/m4/extern-inline.m4
new file mode 100644
index 0000000..0a9fc9a
--- /dev/null
+++ b/gdb/gnulib/import/m4/extern-inline.m4
@@ -0,0 +1,62 @@
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EXTERN_INLINE],
+[
+  AH_VERBATIM([extern_inline],
+[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
+   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
+   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
+     in an include file, before uses of _GL_INLINE.
+     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
+     when FOO is an inline function in the header; see
+     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
+   _GL_INLINE_HEADER_END contains useful stuff to put
+     in the same include file, after uses of _GL_INLINE.
+
+   Suppress the use of extern inline on Apple's platforms,
+   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : 199901L <= __STDC_VERSION__) \
+     && !defined __APPLE__)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
+# if __GNUC_GNU_INLINE__
+   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
+#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#  define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+#  define _GL_INLINE_HEADER_CONST_PRAGMA \
+     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+    _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif])
+])
diff --git a/gdb/gnulib/import/m4/fcntl-o.m4 b/gdb/gnulib/import/m4/fcntl-o.m4
index 9862741..740e78b 100644
--- a/gdb/gnulib/import/m4/fcntl-o.m4
+++ b/gdb/gnulib/import/m4/fcntl-o.m4
@@ -50,7 +50,18 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
             #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
+              if (symlink ("/dev/null", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              if (unlink (sym) != 0 || symlink (".", sym) != 0)
                 result |= 2;
               else
                 {
diff --git a/gdb/gnulib/import/m4/gnulib-cache.m4 b/gdb/gnulib/import/m4/gnulib-cache.m4
index 895c571..22e6796 100644
--- a/gdb/gnulib/import/m4/gnulib-cache.m4
+++ b/gdb/gnulib/import/m4/gnulib-cache.m4
@@ -47,5 +47,5 @@ gl_LIB([libgnu])
 gl_MAKEFILE_NAME([])
 gl_MACRO_PREFIX([gl])
 gl_PO_DOMAIN([])
-gl_WITNESS_C_DOMAIN([])
+gl_WITNESS_C_MACRO([])
 gl_VC_FILES([false])
diff --git a/gdb/gnulib/import/m4/gnulib-comp.m4 b/gdb/gnulib/import/m4/gnulib-comp.m4
index 954ea21..6d0b35b 100644
--- a/gdb/gnulib/import/m4/gnulib-comp.m4
+++ b/gdb/gnulib/import/m4/gnulib-comp.m4
@@ -43,6 +43,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module configmake:
   # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  # Code from module extern-inline:
   # Code from module fnmatch:
   # Code from module fnmatch-gnu:
   # Code from module include_next:
@@ -87,64 +88,65 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='import'
-gl_FUNC_ALLOCA
-gl_CONFIGMAKE_PREP
-gl_FUNC_FNMATCH_POSIX
-if test -n "$FNMATCH_H"; then
-  AC_LIBOBJ([fnmatch])
-  gl_PREREQ_FNMATCH
-fi
-gl_FUNC_FNMATCH_GNU
-if test -n "$FNMATCH_H"; then
-  AC_LIBOBJ([fnmatch])
-  gl_PREREQ_FNMATCH
-fi
-gl_INTTYPES_H
-gl_INTTYPES_INCOMPLETE
-gl_LOCALCHARSET
-LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
-AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
-gl_FUNC_MBRTOWC
-if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-  AC_LIBOBJ([mbrtowc])
-  gl_PREREQ_MBRTOWC
-fi
-gl_WCHAR_MODULE_INDICATOR([mbrtowc])
-gl_FUNC_MBSINIT
-if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-  AC_LIBOBJ([mbsinit])
-  gl_PREREQ_MBSINIT
-fi
-gl_WCHAR_MODULE_INDICATOR([mbsinit])
-gl_FUNC_MBSRTOWCS
-if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
-  AC_LIBOBJ([mbsrtowcs])
-  AC_LIBOBJ([mbsrtowcs-state])
-  gl_PREREQ_MBSRTOWCS
-fi
-gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
-gl_FUNC_MEMCHR
-if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
-  AC_LIBOBJ([memchr])
-  gl_PREREQ_MEMCHR
-fi
-gl_STRING_MODULE_INDICATOR([memchr])
-gl_FUNC_MEMMEM
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
-  AC_LIBOBJ([memmem])
-fi
-gl_FUNC_MEMMEM_SIMPLE
-if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
-  AC_LIBOBJ([memmem])
-fi
-gl_STRING_MODULE_INDICATOR([memmem])
-gl_MULTIARCH
-AM_STDBOOL_H
-gl_STDDEF_H
-gl_STDINT_H
-gl_HEADER_STRING_H
-gl_WCHAR_H
-gl_WCTYPE_H
+  gl_FUNC_ALLOCA
+  gl_CONFIGMAKE_PREP
+  AC_REQUIRE([gl_EXTERN_INLINE])
+  gl_FUNC_FNMATCH_POSIX
+  if test -n "$FNMATCH_H"; then
+    AC_LIBOBJ([fnmatch])
+    gl_PREREQ_FNMATCH
+  fi
+  gl_FUNC_FNMATCH_GNU
+  if test -n "$FNMATCH_H"; then
+    AC_LIBOBJ([fnmatch])
+    gl_PREREQ_FNMATCH
+  fi
+  gl_INTTYPES_H
+  gl_INTTYPES_INCOMPLETE
+  gl_LOCALCHARSET
+  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+  gl_FUNC_MBRTOWC
+  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+    AC_LIBOBJ([mbrtowc])
+    gl_PREREQ_MBRTOWC
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+  gl_FUNC_MBSINIT
+  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+    AC_LIBOBJ([mbsinit])
+    gl_PREREQ_MBSINIT
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbsinit])
+  gl_FUNC_MBSRTOWCS
+  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+    AC_LIBOBJ([mbsrtowcs])
+    AC_LIBOBJ([mbsrtowcs-state])
+    gl_PREREQ_MBSRTOWCS
+  fi
+  gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
+  gl_FUNC_MEMCHR
+  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+    AC_LIBOBJ([memchr])
+    gl_PREREQ_MEMCHR
+  fi
+  gl_STRING_MODULE_INDICATOR([memchr])
+  gl_FUNC_MEMMEM
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+    AC_LIBOBJ([memmem])
+  fi
+  gl_FUNC_MEMMEM_SIMPLE
+  if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+    AC_LIBOBJ([memmem])
+  fi
+  gl_STRING_MODULE_INDICATOR([memmem])
+  gl_MULTIARCH
+  AM_STDBOOL_H
+  gl_STDDEF_H
+  gl_STDINT_H
+  gl_HEADER_STRING_H
+  gl_WCHAR_H
+  gl_WCTYPE_H
   # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -318,12 +320,14 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/strnlen1.h
   lib/verify.h
   lib/wchar.in.h
+  lib/wctype-h.c
   lib/wctype.in.h
   m4/00gnulib.m4
   m4/alloca.m4
   m4/codeset.m4
   m4/configmake.m4
   m4/extensions.m4
+  m4/extern-inline.m4
   m4/fcntl-o.m4
   m4/fnmatch.m4
   m4/glibc21.m4
diff --git a/gdb/gnulib/import/m4/wctype_h.m4 b/gdb/gnulib/import/m4/wctype_h.m4
index 4b19f64..885e6fc 100644
--- a/gdb/gnulib/import/m4/wctype_h.m4
+++ b/gdb/gnulib/import/m4/wctype_h.m4
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 17
+# wctype_h.m4 serial 18
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -22,8 +22,6 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_ISWCNTRL])
 
-  AC_REQUIRE([AC_C_INLINE])
-
   AC_REQUIRE([gt_TYPE_WINT_T])
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
diff --git a/gdb/gnulib/import/stdbool.in.h b/gdb/gnulib/import/stdbool.in.h
index ed1f9aa..1f8caee 100644
--- a/gdb/gnulib/import/stdbool.in.h
+++ b/gdb/gnulib/import/stdbool.in.h
@@ -66,24 +66,19 @@
 # undef true
 #endif
 
-/* For the sake of symbolic names in gdb, we define true and false as
-   enum constants, not only as macros.
-   It is tempting to write
-      typedef enum { false = 0, true = 1 } _Bool;
-   so that gdb prints values of type 'bool' symbolically. But if we do
-   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
-   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
-   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
-   enum; this ensures that '_Bool' promotes to 'int'.  */
-#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
+#ifdef __cplusplus
+# define _Bool bool
+# define bool bool
+#else
+# if defined __BEOS__ && !defined __HAIKU__
   /* A compiler known to have 'bool'.  */
   /* If the compiler already has both 'bool' and '_Bool', we can assume they
      are the same types.  */
-# if !@HAVE__BOOL@
+#  if !@HAVE__BOOL@
 typedef bool _Bool;
-# endif
-#else
-# if !defined __GNUC__
+#  endif
+# else
+#  if !defined __GNUC__
    /* If @HAVE__BOOL@:
         Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
         the built-in _Bool type is used.  See
@@ -103,19 +98,35 @@ typedef bool _Bool;
           "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
         The only benefit of the enum, debuggability, is not important
         with these compilers.  So use 'signed char' and no enum.  */
-#  define _Bool signed char
-# else
+#   define _Bool signed char
+#  else
    /* With this compiler, trust the _Bool type if the compiler has it.  */
-#  if !@HAVE__BOOL@
+#   if !@HAVE__BOOL@
+   /* For the sake of symbolic names in gdb, define true and false as
+      enum constants, not only as macros.
+      It is tempting to write
+         typedef enum { false = 0, true = 1 } _Bool;
+      so that gdb prints values of type 'bool' symbolically.  But then
+      values of type '_Bool' might promote to 'int' or 'unsigned int'
+      (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+      (see ISO C 99 6.3.1.1.(2)).  So add a negative value to the
+      enum; this ensures that '_Bool' promotes to 'int'.  */
 typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+#   endif
 #  endif
 # endif
+# define bool _Bool
 #endif
-#define bool _Bool
 
 /* The other macros must be usable in preprocessor directives.  */
-#define false 0
-#define true 1
+#ifdef __cplusplus
+# define false false
+# define true true
+#else
+# define false 0
+# define true 1
+#endif
+
 #define __bool_true_false_are_defined 1
 
 #endif /* _GL_STDBOOL_H */
diff --git a/gdb/gnulib/import/verify.h b/gdb/gnulib/import/verify.h
index cef14ad..0c320b1 100644
--- a/gdb/gnulib/import/verify.h
+++ b/gdb/gnulib/import/verify.h
@@ -125,7 +125,7 @@
        extern int (*dummy (void)) [sizeof (struct {...})];
 
    * GCC warns about duplicate declarations of the dummy function if
-     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     -Wredundant-decls is used.  GCC 4.3 and later have a builtin
      __COUNTER__ macro that can let us generate unique identifiers for
      each dummy function, to suppress this warning.
 
@@ -133,6 +133,10 @@
      which do not support _Static_assert, also do not warn about the
      last declaration mentioned above.
 
+   * GCC warns if -Wnested-externs is enabled and verify() is used
+     within a function body; but inside a function, you can always
+     arrange to use verify_expr() instead.
+
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
diff --git a/gdb/gnulib/import/wctype-h.c b/gdb/gnulib/import/wctype-h.c
new file mode 100644
index 0000000..bb5f847
--- /dev/null
+++ b/gdb/gnulib/import/wctype-h.c
@@ -0,0 +1,4 @@
+/* Normally this would be wctype.c, but that name's already taken.  */
+#include <config.h>
+#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE
+#include "wctype.h"
diff --git a/gdb/gnulib/import/wctype.in.h b/gdb/gnulib/import/wctype.in.h
index aa018b1..3c98fa3 100644
--- a/gdb/gnulib/import/wctype.in.h
+++ b/gdb/gnulib/import/wctype.in.h
@@ -54,6 +54,11 @@
 #ifndef _@GUARD_PREFIX@_WCTYPE_H
 #define _@GUARD_PREFIX@_WCTYPE_H
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_WCTYPE_INLINE
+# define _GL_WCTYPE_INLINE _GL_INLINE
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
@@ -148,7 +153,7 @@ typedef unsigned int rpl_wint_t;
 #   endif
 #  endif
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswalnum
 #  else
@@ -160,7 +165,7 @@ iswalnum
           || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswalpha
 #  else
@@ -171,7 +176,7 @@ iswalpha
   return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswblank
 #  else
@@ -182,7 +187,7 @@ iswblank
   return wc == ' ' || wc == '\t';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswcntrl
 #  else
@@ -193,7 +198,7 @@ iswcntrl
   return (wc & ~0x1f) == 0 || wc == 0x7f;
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswdigit
 #  else
@@ -204,7 +209,7 @@ iswdigit
   return wc >= '0' && wc <= '9';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswgraph
 #  else
@@ -215,7 +220,7 @@ iswgraph
   return wc >= '!' && wc <= '~';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswlower
 #  else
@@ -226,7 +231,7 @@ iswlower
   return wc >= 'a' && wc <= 'z';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswprint
 #  else
@@ -237,7 +242,7 @@ iswprint
   return wc >= ' ' && wc <= '~';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswpunct
 #  else
@@ -250,7 +255,7 @@ iswpunct
                || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswspace
 #  else
@@ -262,7 +267,7 @@ iswspace
           || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswupper
 #  else
@@ -273,7 +278,7 @@ iswupper
   return wc >= 'A' && wc <= 'Z';
 }
 
-static inline int
+_GL_WCTYPE_INLINE int
 #  if @REPLACE_ISWCNTRL@
 rpl_iswxdigit
 #  else
@@ -285,7 +290,7 @@ iswxdigit
           || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
 }
 
-static inline wint_t
+_GL_WCTYPE_INLINE wint_t
 #  if @REPLACE_TOWLOWER@
 rpl_towlower
 #  else
@@ -296,7 +301,7 @@ towlower
   return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
 }
 
-static inline wint_t
+_GL_WCTYPE_INLINE wint_t
 #  if @REPLACE_TOWLOWER@
 rpl_towupper
 #  else
@@ -336,7 +341,7 @@ _GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
       result register.  We need to fix this by adding a zero-extend from
       wchar_t to wint_t after the call.  */
 
-static inline wint_t
+_GL_WCTYPE_INLINE wint_t
 rpl_towlower (wint_t wc)
 {
   return (wint_t) (wchar_t) towlower (wc);
@@ -345,7 +350,7 @@ rpl_towlower (wint_t wc)
 #   define towlower rpl_towlower
 #  endif
 
-static inline wint_t
+_GL_WCTYPE_INLINE wint_t
 rpl_towupper (wint_t wc)
 {
   return (wint_t) (wchar_t) towupper (wc);
@@ -493,6 +498,7 @@ _GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
 # endif
 #endif
 
+_GL_INLINE_HEADER_END
 
 #endif /* _@GUARD_PREFIX@_WCTYPE_H */
 #endif /* _@GUARD_PREFIX@_WCTYPE_H */
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index 87218ca..a99bad8 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -32,7 +32,7 @@
 IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright"
 
 # The gnulib commit ID to use for the update.
-GNULIB_COMMIT_SHA1="a39f53ccb70a613e647e1019fb4c63645220267e"
+GNULIB_COMMIT_SHA1="8d5bd1402003bd0153984b138735adf537d960b0"
 
 # The expected version number for the various auto tools we will
 # use after the import.
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-17 15:08 ` [RFA/commit 2/2] Import gnulib's errno module Joel Brobecker
@ 2012-12-18  6:07   ` Joel Brobecker
  2012-12-18 16:40     ` Tom Tromey
  2012-12-19  4:16     ` Reverted: " Joel Brobecker
  0 siblings, 2 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-18  6:07 UTC (permalink / raw)
  To: gdb-patches

> This module is needed in order to build GDBserver on ppc-lynx178,
> because the system does not define EILSEQ.

Attached is the updated patch which I just checked in.
The difference comes from the fact that patch #1 was replaced with
an update to gnulib's current HEAD, rather than a specific revision
in the past.

gdb/ChangeLog:

        * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add errno.
        * gnulib/import/errno.in.h: Import.
        * gnulib/import/m4/errno_h.m4: Import.
        * gnulib/aclocal.m4: Regenerate.
        * gnulib/configure: Regenerate.
        * gnulib/import/Makefile.am: Update.
        * gnulib/import/Makefile.in: Update.
        * gnulib/import/m4/gnulib-cache.m4: Update.
        * gnulib/import/m4/gnulib-comp.m4: Update.

Tested on x86_64-linux and ppc-lynx178.  Checked in.

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 1/2] update gnulib to 2012-11-05.
  2012-12-18  6:06   ` Joel Brobecker
@ 2012-12-18 16:13     ` Tom Tromey
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 16:13 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel> Somehow, I thought we were only importing the revisions that
Joel> contains the fix that we need... Attached is what I checked in,
Joel> which updates gnulib to the current HEAD.

I don't really know.
My gnulib series imported a revision after the one in your original
patch but before the one going in now; but only because that was gnulib
master at the time I started the series.

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18  6:07   ` Joel Brobecker
@ 2012-12-18 16:40     ` Tom Tromey
  2012-12-18 16:46       ` Tom Tromey
  2012-12-18 16:51       ` Joel Brobecker
  2012-12-19  4:16     ` Reverted: " Joel Brobecker
  1 sibling, 2 replies; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 16:40 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> This module is needed in order to build GDBserver on ppc-lynx178,
Joel> because the system does not define EILSEQ.

I had a vague memory of some other errno defines, so I grepped and I
found this in charset.c:

/* Some systems don't have EILSEQ, so we define it here, but not as
   EINVAL, because callers of `iconv' want to distinguish EINVAL and
   EILSEQ.  This is what iconv.h from libiconv does as well.  Note
   that wchar.h may also define EILSEQ, so this needs to be after we
   include wchar.h, which happens in defs.h through gdb_wchar.h.  */
#ifndef EILSEQ
#define EILSEQ ENOENT
#endif


My first thought was that we can now get rid of this define.

But now I wonder whether this define will cause problems if we also use
libiconv; unless maybe the various header files are included in the
right order.

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 16:40     ` Tom Tromey
@ 2012-12-18 16:46       ` Tom Tromey
  2012-12-18 16:55         ` Joel Brobecker
  2012-12-18 16:51       ` Joel Brobecker
  1 sibling, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 16:46 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Tom> But now I wonder whether this define will cause problems if we also use
Tom> libiconv; unless maybe the various header files are included in the
Tom> right order.

Sorry, I meant to say that I wonder if the gnulib errno.h will cause
problems, not that define.  I think that define is definitely obsolete
at this point.

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 16:40     ` Tom Tromey
  2012-12-18 16:46       ` Tom Tromey
@ 2012-12-18 16:51       ` Joel Brobecker
  2012-12-18 17:03         ` Tom Tromey
  1 sibling, 1 reply; 21+ messages in thread
From: Joel Brobecker @ 2012-12-18 16:51 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> /* Some systems don't have EILSEQ, so we define it here, but not as
>    EINVAL, because callers of `iconv' want to distinguish EINVAL and
>    EILSEQ.  This is what iconv.h from libiconv does as well.  Note
>    that wchar.h may also define EILSEQ, so this needs to be after we
>    include wchar.h, which happens in defs.h through gdb_wchar.h.  */
> #ifndef EILSEQ
> #define EILSEQ ENOENT
> #endif
> 
> 
> My first thought was that we can now get rid of this define.
> 
> But now I wonder whether this define will cause problems if we also
> use libiconv; unless maybe the various header files are included in
> the right order.

I though libiconv had its own mechanism for defining EILSEQ.
Do you think the two are going to interfere?

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 16:46       ` Tom Tromey
@ 2012-12-18 16:55         ` Joel Brobecker
  0 siblings, 0 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-18 16:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> Sorry, I meant to say that I wonder if the gnulib errno.h will cause
> problems, not that define.  I think that define is definitely obsolete
> at this point.

I can back the change out, if you think we need to think this over.
Conceptually, we need the module, because some of the other gnulib
modules depend on a full errno (mbrtowc, in particular), and I do
not think we can solve the problem without modifying gnulib.

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 16:51       ` Joel Brobecker
@ 2012-12-18 17:03         ` Tom Tromey
  2012-12-18 18:11           ` Joel Brobecker
  0 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 17:03 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> I though libiconv had its own mechanism for defining EILSEQ.
Joel> Do you think the two are going to interfere?

It seems possible to me.

Suppose you have a system without EILSEQ and where libiconv is used.

libiconv will be compiled with its definition of EILSEQ.  This will
often be ENOENT, though I didn't read m4/eilseq.m4 in detail.

gnulib defines it as:

# ifndef EILSEQ
#  define EILSEQ 2015
#  define GNULIB_defined_EILSEQ 1
# endif


Now, if libiconv ever returns EILSEQ (I didn't check this), gdb will
either interpret the libiconv result properly, or not, depending on
whether the gnulib errno.h or libiconv.h is included first.

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 17:03         ` Tom Tromey
@ 2012-12-18 18:11           ` Joel Brobecker
  2012-12-18 18:38             ` Tom Tromey
  0 siblings, 1 reply; 21+ messages in thread
From: Joel Brobecker @ 2012-12-18 18:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> Joel> I though libiconv had its own mechanism for defining EILSEQ.
> Joel> Do you think the two are going to interfere?
> 
> It seems possible to me.

Yes, indeed. I don't know how to solve the problem, however,
short of maybe asking gnulib to define it as ENOENT as well.
But I don't know how I could justify this request, since
other projects might have chosen a different value.

IMO, a more promising approach would be to convince libiconv
to use gnulib's errno instead.

Or, something that occured to me today, would be to undo my change,
and let the user figure out that to build on a system that does not
provide EILSEQ, he should build with -DEILSEQ=ENOENT. Seems horrible
to me, but it would probably work.

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 18:11           ` Joel Brobecker
@ 2012-12-18 18:38             ` Tom Tromey
  2012-12-18 19:16               ` Eli Zaretskii
  2012-12-19  3:55               ` Joel Brobecker
  0 siblings, 2 replies; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 18:38 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel> Yes, indeed. I don't know how to solve the problem, however,
Joel> short of maybe asking gnulib to define it as ENOENT as well.
Joel> But I don't know how I could justify this request, since
Joel> other projects might have chosen a different value.

A couple choices --

1. Ensure that charset.c includes the files in the correct order.

2. Back out your change and promote the EILSEQ define out of charset.c
   to somewhere more global in gdb.

Joel> IMO, a more promising approach would be to convince libiconv
Joel> to use gnulib's errno instead.

You could try it but that option scares me a little in that what if
there is gnulib version skew between gdb and libiconv?

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 18:38             ` Tom Tromey
@ 2012-12-18 19:16               ` Eli Zaretskii
  2012-12-18 21:30                 ` Tom Tromey
  2012-12-19  3:55               ` Joel Brobecker
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2012-12-18 19:16 UTC (permalink / raw)
  To: Tom Tromey; +Cc: brobecker, gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Tue, 18 Dec 2012 11:37:47 -0700
> 
> A couple choices --
> 
> 1. Ensure that charset.c includes the files in the correct order.
> 
> 2. Back out your change and promote the EILSEQ define out of charset.c
>    to somewhere more global in gdb.

How about

3. Test for either ENOENT or EILSEQ where we now test for EILSEQ.

?

We could also test whether GNULIB_defined_EILSEQ is defined, if worse
comes to worst.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 19:16               ` Eli Zaretskii
@ 2012-12-18 21:30                 ` Tom Tromey
  2012-12-18 21:38                   ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2012-12-18 21:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: brobecker, gdb-patches

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> How about
Eli> 3. Test for either ENOENT or EILSEQ where we now test for EILSEQ.
Eli> ?

It is tempting but I think it exposes us to libiconv's internals too
much.  That is, if libiconv changes its choice here, and we are using
the gnulib EILSEQ, then gdb would start doing the wrong thing.

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 21:30                 ` Tom Tromey
@ 2012-12-18 21:38                   ` Eli Zaretskii
  0 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2012-12-18 21:38 UTC (permalink / raw)
  To: Tom Tromey; +Cc: brobecker, gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Cc: brobecker@adacore.com, gdb-patches@sourceware.org
> Date: Tue, 18 Dec 2012 14:30:11 -0700
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> How about
> Eli> 3. Test for either ENOENT or EILSEQ where we now test for EILSEQ.
> Eli> ?
> 
> It is tempting but I think it exposes us to libiconv's internals too
> much.  That is, if libiconv changes its choice here, and we are using
> the gnulib EILSEQ, then gdb would start doing the wrong thing.

How about limiting that to known versions of libiconv, then?

I mean, I agree that this all is kludgey, but the whole issue is a
mess.  A library should not define a global symbol, it should only
define symbols for its own private use.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18 18:38             ` Tom Tromey
  2012-12-18 19:16               ` Eli Zaretskii
@ 2012-12-19  3:55               ` Joel Brobecker
  2012-12-19  4:25                 ` Joel Brobecker
  2012-12-19 15:44                 ` Tom Tromey
  1 sibling, 2 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-19  3:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> 1. Ensure that charset.c includes the files in the correct order.
> 
> 2. Back out your change and promote the EILSEQ define out of charset.c
>    to somewhere more global in gdb.

The reason why I imported gnulib's errno was because gnulib's
mbrtowc failed to build (on ppc-lynx178), because EILSEQ wasn't
defined. Neither of these options, I think would address the
problem in gnulib, because it only includes system and gnulib
includes.

For the GDB sources themselves, option 1 would only partially
work.  It would work when testing after libiconv routines,
but not after wide-char conversion routines.

Perhaps the way forward is to test for both EILSEQ and ENOENT when
EILSEQ is defined by gnulib, instead of just EILSEQ. Another option:
Define LIBICONV_EILSEQ to the value that libiconv uses, and then
use this macro when testing the reusult of libiconv routines.

> Joel> IMO, a more promising approach would be to convince libiconv
> Joel> to use gnulib's errno instead.
> 
> You could try it but that option scares me a little in that what if
> there is gnulib version skew between gdb and libiconv?

Yes - we'd need to check minimum libiconv version. Definitely
a long term plan at best...

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Reverted: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-18  6:07   ` Joel Brobecker
  2012-12-18 16:40     ` Tom Tromey
@ 2012-12-19  4:16     ` Joel Brobecker
  1 sibling, 0 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-19  4:16 UTC (permalink / raw)
  To: gdb-patches

> Attached is the updated patch which I just checked in.
> The difference comes from the fact that patch #1 was replaced with
> an update to gnulib's current HEAD, rather than a specific revision
> in the past.
> 
> gdb/ChangeLog:
> 
>         * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add errno.
>         * gnulib/import/errno.in.h: Import.
>         * gnulib/import/m4/errno_h.m4: Import.
>         * gnulib/aclocal.m4: Regenerate.
>         * gnulib/configure: Regenerate.
>         * gnulib/import/Makefile.am: Update.
>         * gnulib/import/Makefile.in: Update.
>         * gnulib/import/m4/gnulib-cache.m4: Update.
>         * gnulib/import/m4/gnulib-comp.m4: Update.
> 
> Tested on x86_64-linux and ppc-lynx178.  Checked in.

This is to confirm that I reverted this patch for now, given the current
discussion regarding compatibility with libiconv.

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-19  3:55               ` Joel Brobecker
@ 2012-12-19  4:25                 ` Joel Brobecker
  2012-12-19 15:44                 ` Tom Tromey
  1 sibling, 0 replies; 21+ messages in thread
From: Joel Brobecker @ 2012-12-19  4:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> Perhaps the way forward is to test for both EILSEQ and ENOENT when
> EILSEQ is defined by gnulib, instead of just EILSEQ. Another option:
> Define LIBICONV_EILSEQ to the value that libiconv uses, and then
> use this macro when testing the reusult of libiconv routines.

One of the things that worry me also is the case where the system
libiconv rather than GNU libiconv is used to build GDB.  In that
case, we already potentially have a mismatch...

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-19  3:55               ` Joel Brobecker
  2012-12-19  4:25                 ` Joel Brobecker
@ 2012-12-19 15:44                 ` Tom Tromey
  2013-01-02 10:44                   ` Joel Brobecker
  1 sibling, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2012-12-19 15:44 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> Perhaps the way forward is to test for both EILSEQ and ENOENT when
Joel> EILSEQ is defined by gnulib, instead of just EILSEQ. Another option:
Joel> Define LIBICONV_EILSEQ to the value that libiconv uses, and then
Joel> use this macro when testing the reusult of libiconv routines.

I couldn't think of how to do this without patching libiconv.

Maybe mail to the libiconv and gnulib maintainers is needed now :)

Tom


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [RFA/commit 2/2] Import gnulib's errno module.
  2012-12-19 15:44                 ` Tom Tromey
@ 2013-01-02 10:44                   ` Joel Brobecker
  0 siblings, 0 replies; 21+ messages in thread
From: Joel Brobecker @ 2013-01-02 10:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> Maybe mail to the libiconv and gnulib maintainers is needed now :)

For the record, I have just addded -DEILSEQ=ENOENT to my CFLAGS;
and case closed.

In terms of contacting both projects, I just sent them an email
quickly summarizing the issue, with a pointer to both the gnulib
discusion leading to the gnulib fix, and this discussion. Alea
jacta est.

-- 
Joel


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-01-02 10:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 15:08 [RFA/commit 1/2] update gnulib to 2012-11-05 Joel Brobecker
2012-12-17 15:08 ` [RFA/commit 2/2] Import gnulib's errno module Joel Brobecker
2012-12-18  6:07   ` Joel Brobecker
2012-12-18 16:40     ` Tom Tromey
2012-12-18 16:46       ` Tom Tromey
2012-12-18 16:55         ` Joel Brobecker
2012-12-18 16:51       ` Joel Brobecker
2012-12-18 17:03         ` Tom Tromey
2012-12-18 18:11           ` Joel Brobecker
2012-12-18 18:38             ` Tom Tromey
2012-12-18 19:16               ` Eli Zaretskii
2012-12-18 21:30                 ` Tom Tromey
2012-12-18 21:38                   ` Eli Zaretskii
2012-12-19  3:55               ` Joel Brobecker
2012-12-19  4:25                 ` Joel Brobecker
2012-12-19 15:44                 ` Tom Tromey
2013-01-02 10:44                   ` Joel Brobecker
2012-12-19  4:16     ` Reverted: " Joel Brobecker
2012-12-17 18:26 ` [RFA/commit 1/2] update gnulib to 2012-11-05 Tom Tromey
2012-12-18  6:06   ` Joel Brobecker
2012-12-18 16:13     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox