Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [COMMITTED] libiberty: sync with GCC
@ 2026-11-03  1:25 Pietro Monteiro
  0 siblings, 0 replies; 2+ messages in thread
From: Pietro Monteiro @ 2026-11-03  1:25 UTC (permalink / raw)
  To: binutils, gdb-patches; +Cc: Pietro Monteiro

Sync the libiberty/ directory with gcc commit
be07ead43d9d980584b745ee6e06c5d4309ced1d.  This pulls in the following
gcc commits and the associated updates to 'libiberty/ChangeLog':

2612b60e5b6 libiberty: Update Makefile dependencies
d58a2bf4760 config: mmap: Avoid the sanitizer configure check failure
f5e51990065 libiberty: drop obsolete C functionality tests
db890f7a7d3 configury: replace autoconf obsolete macros [PR103459]
619a5e55867 driver: Spill long COLLECT_GCC_OPTIONS to a response file [PR111527]
f746787e2c3 libiberty, Darwin: Read dylibs too

The commit:

d9d9119bf2f libiberty d_compact_number signed integer overflow

was already in the binutils-gdb tree I just brought its changelog
entry from the GCC tree.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
 libiberty/ChangeLog              |  49 ++++++++++++
 libiberty/Makefile.in            |  36 +++++----
 libiberty/acinclude.m4           |  35 ++++-----
 libiberty/config.in              |   9 ---
 libiberty/configure              | 123 -------------------------------
 libiberty/configure.ac           |  34 ++++-----
 libiberty/functions.texi         |  70 ++++++++++++------
 libiberty/simple-object-mach-o.c |   5 +-
 8 files changed, 153 insertions(+), 208 deletions(-)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index e60b5951ea4..8f962f9020e 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,52 @@
+2026-11-02  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	* Makefile.in (aclocal_deps): Depend on
+	../config/clang-plugin.m4, ../config/hwcaps.m4, and
+	../config/mmap.m4.
+	(./filedescriptor.$(objext)): Update dependencies.
+	(./filename_cmp.$(objext)): Likewise.
+	(./memrchr.$(objext)): Likewise.
+	( ./pex-unix.$(objext)): Likewise.
+	(./setenv.$(objext)): Likewise.
+	( ./xmalloc.$(objext)): Likewise.
+	* acinclude.m4: Stop including ../config/mmap.m4.
+	* aclocal.m4: Regenerate.
+	* functions.texi: Likewise.
+
+2026-10-16  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	* acinclude.m4: Change AC_FUNC_MMAP to GCC_AC_FUNC_MMAP.
+	* configure: Regenerate.
+
+2026-10-15  Sam James  <sam@gentoo.org>
+
+	PR bootstrap/112422
+	* config.in: Regenerate.
+	* configure: Regenerate.
+	* configure.ac: Drop AC_C_CONST and AC_C_INLINE.
+
+2026-07-01  Alan Modra  <amodra@gmail.com>
+
+	* cp-demangle.c (d_compact_number): Avoid signed overflow.
+
+2026-06-29  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	PR bootstrap/103459
+	* acinclude.m4: Replace AC_TRY_RUN with AC_RUN_IFELSE.  Replace
+	AC_TRY_COMPILE with AC_COMPILE_IFELSE.
+	* configure.ac: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE.  Replace
+	AC_ISC_POSIX with AC_SEARCH_LIBS([strerror],[cposix]).
+
+2026-06-13  Sunil Dora  <sunilkumar.dora@windriver.com>
+
+	PR driver/111527
+	* argv.c (expandargstr): New function.
+
+2026-06-10  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	* simple-object-mach-o.c (MACH_O_MH_DYLIB): New definition.
+	(simple_object_mach_o_match): Accept dylibs as well as object files.
+
 2026-06-07  Andrew Burgess  <aburgess@redhat.com>
 
 	* d-demangle.c (struct dlang_info::options): New field,
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 6d8c88ebfe7..38d770d89d6 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -508,8 +508,10 @@ ACLOCAL_AMFLAGS = -I ../config -I ..
 aclocal_deps = \
 	$(srcdir)/../config/acx.m4 \
 	$(srcdir)/../config/cet.m4 \
+	$(srcdir)/../config/clang-plugin.m4 \
 	$(srcdir)/../config/enable.m4 \
 	$(srcdir)/../config/gcc-plugin.m4 \
+	$(srcdir)/../config/hwcaps.m4 \
 	$(srcdir)/../config/mmap.m4 \
 	$(srcdir)/../config/no-executables.m4 \
 	$(srcdir)/../config/override.m4 \
@@ -800,8 +802,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
 
-./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/libiberty.h
+./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h \
+	$(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/filedescriptor.c -o pic/$@; \
 	else true; fi
@@ -810,9 +812,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/filedescriptor.c $(OUTPUT_OPTION)
 
-
 ./filename_cmp.$(objext): $(srcdir)/filename_cmp.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+	$(INCDIR)/filenames.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h \
 	$(INCDIR)/safe-ctype.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
@@ -1027,15 +1028,6 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/memchr.c $(OUTPUT_OPTION)
 
-./memrchr.$(objext): $(srcdir)/memrchr.c $(INCDIR)/ansidecl.h
-	if [ x"$(PICFLAG)" != x ]; then \
-	  $(COMPILE.c) $(PICFLAG) $(srcdir)/memrchr.c -o pic/$@; \
-	else true; fi
-	if [ x"$(NOASANFLAG)" != x ]; then \
-	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/memrchr.c -o noasan/$@; \
-	else true; fi
-	$(COMPILE.c) $(srcdir)/memrchr.c $(OUTPUT_OPTION)
-
 ./memcmp.$(objext): $(srcdir)/memcmp.c $(INCDIR)/ansidecl.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/memcmp.c -o pic/$@; \
@@ -1081,6 +1073,15 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/mempcpy.c $(OUTPUT_OPTION)
 
+./memrchr.$(objext): $(srcdir)/memrchr.c $(INCDIR)/ansidecl.h
+	if [ x"$(PICFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(srcdir)/memrchr.c -o pic/$@; \
+	else true; fi
+	if [ x"$(NOASANFLAG)" != x ]; then \
+	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/memrchr.c -o noasan/$@; \
+	else true; fi
+	$(COMPILE.c) $(srcdir)/memrchr.c $(OUTPUT_OPTION)
+
 ./memset.$(objext): $(srcdir)/memset.c $(INCDIR)/ansidecl.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/memset.c -o pic/$@; \
@@ -1179,7 +1180,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	$(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)
 
 ./pex-unix.$(objext): $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
+	$(INCDIR)/environ.h $(INCDIR)/libiberty.h \
+	$(srcdir)/pex-common.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
 	else true; fi
@@ -1285,7 +1287,8 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	else true; fi
 	$(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
 
-./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
+./setenv.$(objext): $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h \
+	$(INCDIR)/environ.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
 	else true; fi
@@ -1736,7 +1739,7 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	$(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
 
 ./xmalloc.$(objext): $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
-	$(INCDIR)/libiberty.h
+	$(INCDIR)/environ.h $(INCDIR)/libiberty.h
 	if [ x"$(PICFLAG)" != x ]; then \
 	  $(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
 	else true; fi
@@ -1794,3 +1797,4 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir
 	  $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/xvasprintf.c -o noasan/$@; \
 	else true; fi
 	$(COMPILE.c) $(srcdir)/xvasprintf.c $(OUTPUT_OPTION)
+
diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4
index 49f621bf629..41285c5bf08 100644
--- a/libiberty/acinclude.m4
+++ b/libiberty/acinclude.m4
@@ -21,7 +21,7 @@ dnl a SEGV in some cases.
 AC_DEFUN([libiberty_AC_FUNC_STRNCMP],
 [AC_REQUIRE([GCC_AC_FUNC_MMAP])
 AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works,
-[AC_TRY_RUN([
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
 /* Test by Jim Wilson and Kaveh Ghazi.
    Check whether strncmp reads past the end of its string parameters. */
 #include <stdlib.h>
@@ -84,8 +84,8 @@ main (void)
 #endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
   exit (0);
 }
-], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no,
-  ac_cv_func_strncmp_works=yes)
+]])], [ac_cv_func_strncmp_works=yes], [ac_cv_func_strncmp_works=no],
+  [ac_cv_func_strncmp_works=yes])
 rm -f core core.* *.core])
 if test $ac_cv_func_strncmp_works = no ; then
   AC_LIBOBJ([strncmp])
@@ -95,11 +95,11 @@ fi
 dnl See if errno must be declared even when <errno.h> is included.
 AC_DEFUN([libiberty_AC_DECLARE_ERRNO],
 [AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno,
-[AC_TRY_COMPILE(
-[#include <errno.h>],
-[int x = errno;],
-libiberty_cv_declare_errno=no,
-libiberty_cv_declare_errno=yes)])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <errno.h>]],
+[[int x = errno;]])],
+[libiberty_cv_declare_errno=no],
+[libiberty_cv_declare_errno=yes])])
 if test $libiberty_cv_declare_errno = yes
 then AC_DEFINE(NEED_DECLARATION_ERRNO, 1,
   [Define if errno must be declared even when <errno.h> is included.])
@@ -110,7 +110,7 @@ dnl See whether we need a declaration for a function.
 AC_DEFUN([libiberty_NEED_DECLARATION],
 [AC_MSG_CHECKING([whether $1 must be declared])
 AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
-[AC_TRY_COMPILE([
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include "confdefs.h"
 #include <stdio.h>
 #ifdef HAVE_STRING_H
@@ -125,9 +125,10 @@ AC_CACHE_VAL(libiberty_cv_decl_needed_$1,
 #endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif],
-[char *(*pfn) = (char *(*)) $1],
-libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)])
+#endif]],
+[[char *(*pfn) = (char *(*)) $1]])],
+[libiberty_cv_decl_needed_$1=no],
+[libiberty_cv_decl_needed_$1=yes])])
 AC_MSG_RESULT($libiberty_cv_decl_needed_$1)
 if test $libiberty_cv_decl_needed_$1 = yes; then
   AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
@@ -160,7 +161,7 @@ if test $ac_cv_os_cray = yes; then
 fi
 
 AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
-[AC_TRY_RUN([#include <stdlib.h>
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
 
 int
 find_stack_direction (void)
@@ -180,10 +181,10 @@ int
 main (void)
 {
   exit (find_stack_direction() < 0);
-}],
-  ac_cv_c_stack_direction=1,
-  ac_cv_c_stack_direction=-1,
-  ac_cv_c_stack_direction=0)])
+}]])],
+  [ac_cv_c_stack_direction=1],
+  [ac_cv_c_stack_direction=-1],
+  [ac_cv_c_stack_direction=0])])
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
   [Define if you know the direction of stack growth for your system;
    otherwise it will be automatically deduced at run-time.
diff --git a/libiberty/config.in b/libiberty/config.in
index 3b8716511f0..931fcc80ade 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -568,15 +568,6 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* 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
-#endif
-
 /* Define to the type of a signed integer type wide enough to hold a pointer,
    if such a type exists, and if the system does not define it. */
 #undef intptr_t
diff --git a/libiberty/configure b/libiberty/configure
index 379a3cfa9c3..228cfd4740a 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5112,129 +5112,6 @@ fi
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
-  typedef int charset[2];
-  const charset cs = { 0, 0 };
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this sort of thing.  */
-    char tx;
-    char *t = &tx;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; } bx;
-    struct s *b = &bx; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
-else
-  ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; 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
-
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
 if ${ac_cv_c_bigendian+:} false; then :
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 03b835ce828..a56a1017f1a 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -210,8 +210,6 @@ fi
 AC_SUBST(NO_MINUS_C_MINUS_O)
 AC_SUBST(OUTPUT_OPTION)
 
-AC_C_CONST
-AC_C_INLINE
 AC_C_BIGENDIAN
 
 dnl When we start using libtool:
@@ -329,30 +327,30 @@ AC_CHECK_TYPE([long long],
 # Look for a 64-bit type.
 AC_MSG_CHECKING([for a 64-bit type])
 AC_CACHE_VAL(liberty_cv_uint64,
-[AC_TRY_COMPILE(
-[#ifdef HAVE_STDINT_H
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_STDINT_H
 #include <stdint.h>
-#endif],
-[extern uint64_t foo;],
-liberty_cv_uint64=uint64_t,
-[AC_TRY_COMPILE(
-[#ifdef HAVE_LIMITS_H
+#endif]],
+[[extern uint64_t foo;]])],
+[liberty_cv_uint64=uint64_t],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
 #ifndef CHAR_BIT
 #define CHAR_BIT 8
-#endif],
-[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];],
-liberty_cv_uint64="unsigned long",
-[AC_TRY_COMPILE(
-[#ifdef HAVE_LIMITS_H
+#endif]],
+[[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];]])],
+[liberty_cv_uint64="unsigned long"],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
 #ifndef CHAR_BIT
 #define CHAR_BIT 8
-#endif],
-[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];],
-liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])])
+#endif]],
+[[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];]])],
+[liberty_cv_uint64="unsigned long long"], [liberty_cv_uint64=none])])])])
 AC_MSG_RESULT($liberty_cv_uint64)
 if test "$liberty_cv_uint64" != none; then
   AC_DEFINE_UNQUOTED(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64,
@@ -701,7 +699,7 @@ if test -z "${setobjs}"; then
 
   # We haven't set the list of objects yet.  Use the standard autoconf
   # tests.  This will only work if the compiler works.
-  AC_ISC_POSIX
+  AC_SEARCH_LIBS([strerror],[cposix])
   AC_REPLACE_FUNCS($funcs)
   libiberty_AC_FUNC_C_ALLOCA
   AC_FUNC_FORK
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 7c7da1ba296..16a9d3ae4ac 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -101,7 +101,7 @@ is respectively less than, matching, or greater than the array member.
 
 @end deftypefn
 
-@c argv.c:138
+@c argv.c:129
 @deftypefn Extension char** buildargv (char *@var{sp})
 
 Given a pointer to a string, parse the string extracting fields
@@ -165,7 +165,7 @@ not recommended.
 
 @end deftypefn
 
-@c make-temp-file.c:95
+@c make-temp-file.c:108
 @deftypefn Replacement const char* choose_tmpdir ()
 
 Returns a pointer to a directory path suitable for creating temporary
@@ -192,7 +192,7 @@ Concatenate zero or more of strings and return the result in freshly
 
 @end deftypefn
 
-@c argv.c:495
+@c argv.c:474
 @deftypefn Extension int countargv (char * const *@var{argv})
 
 Return the number of elements in @var{argv}.
@@ -257,7 +257,18 @@ symbolic name or message.
 
 @end deftypefn
 
-@c argv.c:352
+@c argv.c:497
+@deftypefn Extension {char *} expandargstr @
+  (const char *@var{progname}, const char *@var{val})
+
+Expand @var{val} as a response file via @code{expandargv} if it begins
+with @samp{@@}, using @var{progname} as @code{argv[0]}, and return the
+expanded option list as a shell-quoted string.  Returns a newly
+allocated string.
+
+@end deftypefn
+
+@c argv.c:337
 @deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
 
 The @var{argcp} and @code{argvp} arguments are pointers to the usual
@@ -690,6 +701,19 @@ and a path ending in @code{/} returns the empty string after it.
 
 @end deftypefn
 
+@c ldirname.c:23
+@deftypefn Replacement {char*} ldirname (const char *@var{name})
+
+Given a pointer to a string containing a typical pathname
+(@samp{/usr/src/cmd/ls/ls.c} for example), returns a string containing the
+passed string up to, but not including, the final directory separator.
+
+If the given pathname doesn't contain a directory separator then this function
+returns the empty string; this includes an empty given pathname.  @code{NULL}
+is returned on memory allocation error.
+
+@end deftypefn
+
 @c lrealpath.c:25
 @deftypefn Replacement {const char*} lrealpath (const char *@var{name})
 
@@ -726,7 +750,7 @@ relative prefix can be found, return @code{NULL}.
 
 @end deftypefn
 
-@c make-temp-file.c:173
+@c make-temp-file.c:185
 @deftypefn Replacement char* make_temp_file (const char *@var{suffix})
 
 Return a temporary file name (as a string) or @code{NULL} if unable to
@@ -749,20 +773,6 @@ returned.
 
 @end deftypefn
 
-@c memrchr.c:3
-@deftypefn Supplemental void* memrchr (const void *@var{s}, int @var{c}, @
-  size_t @var{n})
-
-This function searches memory for the character @var{c} in reverse order,
-starting at @code{*@var{s}+@var{n}-1} .  The search only ends with
-the first occurrence of @var{c}, or when the start us reached; in particular,
-a null character does not terminate the search.  If the character @var{c} is
-found within @var{length} characters of @code{*@var{s}}, a pointer
-to the character is returned.  If @var{c} is not found, then @code{NULL} is
-returned.
-
-@end deftypefn
-
 @c memcmp.c:6
 @deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, @
   size_t @var{count})
@@ -812,6 +822,20 @@ Copies @var{length} bytes from memory region @var{in} to region
 
 @end deftypefn
 
+@c memrchr.c:3
+@deftypefn Supplemental void* memrchr (const void *@var{s}, int @var{c}, @
+  size_t @var{n})
+
+This function searches memory for the character @var{c} in reverse order,
+starting at @code{*@var{s}+@var{n}-1} .  The search only ends with
+the first occurrence of @var{c}, or when the start us reached; in particular,
+a null character does not terminate the search.  If the character @var{c} is
+found within @var{length} characters of @code{*@var{s}}, a pointer
+to the character is returned.  If @var{c} is not found, then @code{NULL} is
+returned.
+
+@end deftypefn
+
 @c memset.c:6
 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
   size_t @var{count})
@@ -1761,7 +1785,7 @@ that the converted value is unsigned.
 @c strtoll.c:33
 @deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
   char **@var{endptr}, int @var{base})
-@deftypefnx Supplemental {unsigned long long int} strtoull (@
+@deftypefnx Supplemental {unsigned long long int} strtoul (@
   const char *@var{string}, char **@var{endptr}, int @var{base})
 
 The @code{strtoll} function converts the string in @var{string} to a
@@ -1948,12 +1972,12 @@ does the return value.  The third argument is unused in @libib{}.
 
 @end deftypefn
 
-@c argv.c:289
+@c argv.c:287
 @deftypefn Extension int writeargv (char * const *@var{argv}, FILE *@var{file})
 
 Write each member of ARGV, handling all necessary quoting, to the file
-named by FILE, separated by whitespace.  Return 0 on success, non-zero
-if an error occurred while writing to FILE.
+associated with FILE, separated by whitespace.  Return 0 on success,
+non-zero if an error occurred while writing to FILE.
 
 @end deftypefn
 
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index c6dfe697497..aaa9cbf3a06 100644
--- a/libiberty/simple-object-mach-o.c
+++ b/libiberty/simple-object-mach-o.c
@@ -78,6 +78,7 @@ struct mach_o_header_64
 /* For filetype field in header.  */
 
 #define MACH_O_MH_OBJECT		0x01
+#define MACH_O_MH_DYLIB			0x06
 
 /* A Mach-O file is a list of load commands.  This is the header of a
    load command.  */
@@ -312,9 +313,9 @@ simple_object_mach_o_match (
   b = &buf[0];
 
   filetype = (*fetch_32) (b + offsetof (struct mach_o_header_32, filetype));
-  if (filetype != MACH_O_MH_OBJECT)
+  if (!(filetype == MACH_O_MH_OBJECT || filetype == MACH_O_MH_DYLIB))
     {
-      *errmsg = "Mach-O file is not object file";
+      *errmsg = "Mach-O file is neither object file nor dylib";
       *err = 0;
       return NULL;
     }
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [COMMITTED] libiberty: sync with GCC
@ 2026-11-12  1:14 Pietro Monteiro
  0 siblings, 0 replies; 2+ messages in thread
From: Pietro Monteiro @ 2026-11-12  1:14 UTC (permalink / raw)
  To: binutils, gdb-patches; +Cc: Pietro Monteiro

Sync the libiberty/ directory with gcc commit
cdab94a53bbe481af689bcc0cd89ea690c4202f3.  This pulls in the following
gcc commits and the associated updates to 'libiberty/ChangeLog':

cdab94a53bb libiberty: Fix docs typo
33ed38d4ee0 libiberty: Simplify finding libiberty_topdir
aa4d1d5481d configury: replace obsolete macro AC_CONFIG_HEADER [PR103459]

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
 libiberty/ChangeLog      | 15 ++++++++
 libiberty/configure      | 75 ++++++++++++++++------------------------
 libiberty/configure.ac   | 20 +----------
 libiberty/functions.texi |  2 +-
 libiberty/strtoll.c      |  2 +-
 5 files changed, 48 insertions(+), 66 deletions(-)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 8f962f9020e..e25d746a8e9 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,18 @@
+2026-11-12  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	* functions.texi: Regenerate.
+	* strtoll.c: Replace strtoul with strtoull in the documentation comment.
+
+2026-11-10  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	* configure: Regenerate.
+	* configure.ac: Set libiberty_topdir to "${srcdir}/.." and remove AC_CONFIG_AUX_DIR.
+
+2026-11-04  Pietro Monteiro  <pietro@sociotechnical.xyz>
+
+	PR bootstrap/103459
+	* configure.ac: Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS.
+
 2026-11-02  Pietro Monteiro  <pietro@sociotechnical.xyz>
 
 	* Makefile.in (aclocal_deps): Depend on
diff --git a/libiberty/configure b/libiberty/configure
index 228cfd4740a..16a9b04609c 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -2503,51 +2503,7 @@ if test "${with_newlib+set}" = set; then :
 fi
 
 
-if test "${srcdir}" = "."; then
-  if test -n "${with_build_subdir}"; then
-    libiberty_topdir="${srcdir}/../.."
-    with_target_subdir=
-  elif test -z "${with_target_subdir}"; then
-    libiberty_topdir="${srcdir}/.."
-  else
-    if test "${with_target_subdir}" != "."; then
-      libiberty_topdir="${srcdir}/${with_multisrctop}../.."
-    else
-      libiberty_topdir="${srcdir}/${with_multisrctop}.."
-    fi
-  fi
-else
-  libiberty_topdir="${srcdir}/.."
-fi
-
-ac_aux_dir=
-for ac_dir in $libiberty_topdir "$srcdir"/$libiberty_topdir; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in $libiberty_topdir \"$srcdir\"/$libiberty_topdir" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
+libiberty_topdir="${srcdir}/.."
 
 
 
@@ -2690,6 +2646,35 @@ else
 fi
 
 
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index a56a1017f1a..f9bba96d59a 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -20,24 +20,8 @@ AC_ARG_WITH(cross-host,
 AC_ARG_WITH(newlib,
 [  --with-newlib                    Configuring with newlib])
 
-if test "${srcdir}" = "."; then
-  if test -n "${with_build_subdir}"; then
-    libiberty_topdir="${srcdir}/../.."
-    with_target_subdir=
-  elif test -z "${with_target_subdir}"; then
-    libiberty_topdir="${srcdir}/.."
-  else
-    if test "${with_target_subdir}" != "."; then
-      libiberty_topdir="${srcdir}/${with_multisrctop}../.."
-    else
-      libiberty_topdir="${srcdir}/${with_multisrctop}.."
-    fi
-  fi
-else
-  libiberty_topdir="${srcdir}/.."
-fi
+libiberty_topdir="${srcdir}/.."
 AC_SUBST(libiberty_topdir)
-AC_CONFIG_AUX_DIR($libiberty_topdir)
 
 dnl Very limited version of automake's enable-maintainer-mode
 
@@ -220,8 +204,6 @@ dnl AM_DISABLE_SHARED
 dnl When we start using libtool:
 dnl AM_PROG_LIBTOOL
 
-dnl When we start using automake:
-dnl AM_CONFIG_HEADER(config.h:config.in)
 AC_CONFIG_HEADERS([config.h:config.in])
 
 dnl When we start using automake:
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 16a9d3ae4ac..98991367cf4 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -1785,7 +1785,7 @@ that the converted value is unsigned.
 @c strtoll.c:33
 @deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
   char **@var{endptr}, int @var{base})
-@deftypefnx Supplemental {unsigned long long int} strtoul (@
+@deftypefnx Supplemental {unsigned long long int} strtoull (@
   const char *@var{string}, char **@var{endptr}, int @var{base})
 
 The @code{strtoll} function converts the string in @var{string} to a
diff --git a/libiberty/strtoll.c b/libiberty/strtoll.c
index 37ff8cd3d4c..d8127211c54 100644
--- a/libiberty/strtoll.c
+++ b/libiberty/strtoll.c
@@ -32,7 +32,7 @@
 
 @deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
   char **@var{endptr}, int @var{base})
-@deftypefnx Supplemental {unsigned long long int} strtoul (@
+@deftypefnx Supplemental {unsigned long long int} strtoull (@
   const char *@var{string}, char **@var{endptr}, int @var{base})
 
 The @code{strtoll} function converts the string in @var{string} to a
-- 
2.56.0


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

end of thread, other threads:[~2026-11-12  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  1:25 [COMMITTED] libiberty: sync with GCC Pietro Monteiro
2026-11-12  1:14 Pietro Monteiro

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