Update the gnulib import to fixes these issues:
- GDB build with clang + glibc < 2.33.
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=
d6a07b4dc21b3118727743142c678858df442853
https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00072.html
With glibc < 2.33, gnulib (since relatively recently) enables a
replacement for free (see gnulib/import/m4/free.m4). In that path,
clang shows this error:
make[2]: Entering directory '/home/smarchi/build/binutils-gdb-clang/gdbsupport'
CXX agent.o
In file included from /home/smarchi/src/binutils-gdb/gdbsupport/agent.cc:20:
In file included from /home/smarchi/src/binutils-gdb/gdbsupport/common-defs.h:95:
../gnulib/import/string.h:636:19: error: exception specification in declaration does not match previous declaration
_GL_EXTERN_C void free (void *) throw ();
^
../gnulib/import/stdlib.h:737:17: note: expanded from macro 'free'
# define free rpl_free
^
../gnulib/import/stdlib.h:739:1: note: previous declaration is here
_GL_FUNCDECL_RPL (free, void, (void *ptr));
^
../gnulib/import/sys/select.h:251:23: note: expanded from macro '_GL_FUNCDECL_RPL'
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
^
<scratch space>:139:1: note: expanded from here
rpl_free
^
The gnulib commit mentioned fixes the exception specification of `free`.
- GDB build on RHEL 7:
CC libgnu_a-openat-proc.o
In file included from /usr/include/string.h:633,
from ./string.h:41,
from ../../../binutils-gdb/gnulib/import/openat-proc.c:30:
./string.h:1105:1: error: expected identifier or '(' before '__extension__'
1105 | _GL_FUNCDECL_SYS (strndup, char *,
| ^~~~~~~~~~~~~~~~
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=
84863a1c4dc8cca8fb0f6f670f67779cdd2d543b
https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00075.html
Change-Id: Ibd51302feece6f385d0c53e0d08921b5d95e2776
#endif
#ifdef __has_c_attribute
+# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710 \
+ && _GL_GNUC_PREREQ (4, 6))
+# pragma GCC diagnostic ignored "-Wpedantic"
+# endif
# define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__)
#else
# define _GL_HAS_C_ATTRIBUTE(attr) 0
$as_echo_n "(cached) " >&6
else
if test $cross_compiling != yes; then
- if ln -s conf-file conf$$-globtest 2>/dev/null && touch conf-file
+ if ln -s conf$$-file conf$$-globtest 2>/dev/null && touch conf$$-file
then
gl_cv_glob_omit_nondir_symlinks=maybe
else
fi
fi
- rm -f conf$$-globtest
+ rm -f conf$$-file conf$$-globtest
else
gl_cv_glob_omit_nondir_symlinks="$gl_cross_guess_normal"
fi
}
else
{
- int dfd = dirfd (stream);
+ DIR *dirp = stream;
+ int dfd = dirfd (dirp);
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
flags |= GLOB_MAGCHAR;
-# glob.m4 serial 25
+# glob.m4 serial 26
dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_CACHE_CHECK([whether glob NOTDIR*/ omits symlink to nondir],
[gl_cv_glob_omit_nondir_symlinks],
[if test $cross_compiling != yes; then
- if ln -s conf-file conf$$-globtest 2>/dev/null && touch conf-file
+ if ln -s conf$$-file conf$$-globtest 2>/dev/null && touch conf$$-file
then
gl_cv_glob_omit_nondir_symlinks=maybe
else
:
])
fi
- rm -f conf$$-globtest
+ rm -f conf$$-file conf$$-globtest
else
gl_cv_glob_omit_nondir_symlinks="$gl_cross_guess_normal"
fi
-# gnulib-common.m4 serial 72
+# gnulib-common.m4 serial 73
dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
#endif
#ifdef __has_c_attribute
+# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710 \
+ && _GL_GNUC_PREREQ (4, 6))
+# pragma GCC diagnostic ignored "-Wpedantic"
+# endif
# define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__)
#else
# define _GL_HAS_C_ATTRIBUTE(attr) 0
# undef free
# define free rpl_free
# endif
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
+# else
_GL_FUNCDECL_RPL (free, void, (void *ptr));
+# endif
_GL_CXXALIAS_RPL (free, void, (void *ptr));
# else
_GL_CXXALIAS_SYS (free, void, (void *ptr));
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
# else
-# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11
+# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
_GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n)
_GL_ARG_NONNULL ((1))
# endif
_GL_CXXALIASWARN (strndup);
#else
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined strndup
/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
_GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n)
# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wnested-externs"
+# endif
#endif
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
"
# The gnulib commit ID to use for the update.
-GNULIB_COMMIT_SHA1="0cda5beb7962f6567f0c4e377df870fa05c6d681"
+GNULIB_COMMIT_SHA1="bd11400942d63de12371988dca8144925de9e2c3"
# The expected version number for the various auto tools we will
# use after the import.