From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +QPNE0M46WpExQYAWB0awg (envelope-from ) for ; Mon, 02 Nov 2026 20:26:27 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm3 header.b=d2sts0Sa; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=r/Gb6U+3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 467A6378002; Mon, 02 Nov 2026 20:26:27 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0E1561E043 for ; Mon, 02 Nov 2026 20:26:21 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE88B4BB1C16 for ; Tue, 3 Nov 2026 01:26:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE88B4BB1C16 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm3 header.b=d2sts0Sa; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=r/Gb6U+3 Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) by sourceware.org (Postfix) with ESMTPS id B96754B99F7B for ; Tue, 3 Nov 2026 01:25:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B96754B99F7B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=sociotechnical.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sociotechnical.xyz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B96754B99F7B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=202.12.124.145 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793669144; cv=none; b=WLRW90HD7cpUgAzOF1rIPDlIWW+iBAR1qcyZFDGgmK+Xnod/HCJwI/nH8zmzx1+zKcfwU/OCknRbr3IUN5CPK3oQKgmyRr5KOwyJTWT6HOW8Ljk18V5R+yk7OB3VVKOf/tackakYfNpaEstK96UKOgaNtDDgGupp+7nlGsEZJUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793669144; c=relaxed/simple; bh=K58silaNEwTmcogtfWaLJf7zVoUw13slyUDFMOPDaB0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=Urbtxu1dxyO3rSoz1dJVjCp4FtikpjSugjQORutsdViILTkG8GIzNxC5436a9XsMABVaJerZpa/YQIZVMhN39m7gMtFs7AnLAZ649FLCYoI6qPwMuHkmeheAuOPr0oiOIzeyUMcxBgfDY6PfMioAB2firqjrnh87XjlWoFbelN0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm3 header.b=d2sts0Sa; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=r/Gb6U+3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B96754B99F7B Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 1E7AE1D000DD for ; Mon, 2 Nov 2026 20:25:39 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 02 Nov 2026 20:25:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sociotechnical.xyz; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to; s=fm3; t= 1793669138; x=1793755538; bh=XDDu0Qs05AEUe9yDHhmiWhfB0xrT8bW3U/3 FkGjgGrU=; b=d2sts0SaAnGRxuplQQfal7CR/2FBAMDbH/0jjVLYANptuQL6UIn uvLaS+qcf8oKishk9NY+wI/tRd7Hr4BUVGsa5p53j9eSHcWN76S9CbO/SRgSD71T xPzPuW4vfKKdK+GkS3dcTQQr6Y/rRZm4xvzZD/Rlxlwm9oQfOug9Tkfko6kXCKEm BOS7W6fFkXI/QIlEbTdZJ2jESUhNnTLWr6eTvBhVpMSMDV+aEY+lpUogt4GnlBsG zosdbUUC5PkuO0n1tbhg2RfRFDdcSoG09mDXOS4GUAMYVJbFa7BP00sxzPWL/vRM WJGvCDt+fhS1y16fQ1CayOCiXPiuz1KEVnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1793669138; x=1793755538; bh=XDDu0Qs05AEUe9yDHhmiWhfB0xrT8bW3U/3 FkGjgGrU=; b=r/Gb6U+37s31HVOc4/ApSGBvy9j0UHC/lnL9nTS2Ju+n2ewA6pX zXYjvUGYspjs0TxtJHR300HfLBLY6DLMMpKizmEQZD7gTFPZxZ5SexqUJhVa+yUe LIDorgrf+uX6VG6FCh1h1d+kGgklPc1gLyfUBcVDWhuVktSfalslpXVwTrmqcyAA PA3F7IH12B4q79d1cdQILS9wF47DMZt1C47o4SGbWvq2imFZyAJd63Tv2soOK4oI ZDOWQrMYbY2vSp5Gm3T15O/L5QoPwVQdX6hyAl45dH85J/ix41rqW8ivEmYBzBXk 7iTuuGAnspp1UhsSDTwqs//KhUXUbd3geFA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08; repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox; action=sign d=sociotechnical.xyz a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1793669138; d=sociotechnical.xyz; mf=PHBpZXRyb0Bzb2Npb3RlY2huaWNhbC54eXo+; rt=PGdkYi1wYXRjaGVzQHNvdXJjZXdhcmUub3JnPg==; s=fm3:rsa-sha256:ELmWOVzFchROQo44NlSCPT6Y82tBe/xKLxuElBc7T3o4J9H GboblslCVEgmDCV4Ogufv3uYpIGT5gisM+PjLl0yXsc+jjoR1/5Pe+vR7eZiWBlB JR4OZRP/9prG/mYmyu2BTN1VB0zmgJHbGnCBi6uFo2OP1+QHP61HpJ5eucZNIcqW 01nBttEC9jm+eXuUrX0msrWIaF7tdEVH65QeC7WarbIOyh8fjcfDsVO1Xr/TnPbG lfDPWGW32rgBunN1QjvAWZazc9Dtw/g6d0mauviVa5URns8ND1uLeJdh/K/9LN7M IDXkXL3MQvcw+h5GOQd9jRIDH9zoSxAnkg2Ie4Q==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08; repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox; action=mi-m=1; hc=9; hn=cc,content-transfer-encoding,date,feedback-id,from, message-id,mime-version,subject,to; Message-Instance: m=1; h=sha256:t1Gttrm1/puP9uZt3F2CPwxLRykzlez7/zpK45ZmkPQ=:K58silaNEwTmcogtfWaLJf7zVoUw13slyUDFMOPDaB0=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGAYXM+J3neyw5aVggOWYL+Vhmm32pXspg7wIM13cFJRsAmDsBm9LVDdgfbJ9nQT9 fzOBh84IJV0vCqULwUx/XH9qshn/ES78r9q71gaRYcKu4dnkvC1tCo8T/cPHMJP2Nl7v9X tzAqihl+HgJX+Ia7AkJxtmprkWD6+Xtk1MCNEBA9omVEVOjhMPcxqh224UbcLQdaj5La6G rd772pJmdsMWOlG5hFTrjpzK+5E94rLv+5DWggM0TsKs3n1meeCELEXoIUv+WWKIp3LxYZ 1U9/tAYfRz5beNYx574vuTQVQ8U2q5LbvSLC1oZ/SS4I2rchEw3SK2PNjFTLmnKJdA8faS CeLwUs3kmmYbA7G1vNSt+JVtqGevmx7GimkDUXnB9YgJds2sjPriBV+tLX4fGNLPcjMSBi hl5QFotCEn+5YTaoAfgOEVXiR8lLL+ADcf1nY3SUSC20Jkmg004BRSyUm92iGpIZzeEH/3 rHCNNoVbngIfNk8zvzjDY/Yd+bO9GGNi6DbAR+Yyd1Z9UDdpzRqWEbWVC9hIHwFiwyKuTB WzIAOPhKyGlW8oh8MgbYev1L4SxzWie8TsVmn/cuNxyazEKspk3imufjONO/anwx99USEn 5g30boIBUGIdUk/qNxL8s9PBrOgzca7gzs+3qd2D/xwDBP14aInzNqBcym/w X-ME-Proxy: Feedback-ID: i7f494689:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Nov 2026 20:25:38 -0500 (EST) From: Pietro Monteiro To: binutils@sourceware.org, gdb-patches@sourceware.org Cc: Pietro Monteiro Subject: [COMMITTED] libiberty: sync with GCC Date: Mon, 2 Nov 2026 20:25:26 -0500 Message-ID: <20261103012525.1143918-2-pietro@sociotechnical.xyz> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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 --- 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 + + * 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 + + * acinclude.m4: Change AC_FUNC_MMAP to GCC_AC_FUNC_MMAP. + * configure: Regenerate. + +2026-10-15 Sam James + + PR bootstrap/112422 + * config.in: Regenerate. + * configure: Regenerate. + * configure.ac: Drop AC_C_CONST and AC_C_INLINE. + +2026-07-01 Alan Modra + + * cp-demangle.c (d_compact_number): Avoid signed overflow. + +2026-06-29 Pietro Monteiro + + 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 + + PR driver/111527 + * argv.c (expandargstr): New function. + +2026-06-10 Pietro Monteiro + + * 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 * 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 @@ -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 is included. AC_DEFUN([libiberty_AC_DECLARE_ERRNO], [AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno, -[AC_TRY_COMPILE( -[#include ], -[int x = errno;], -libiberty_cv_declare_errno=no, -libiberty_cv_declare_errno=yes)]) +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#include ]], +[[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 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 #ifdef HAVE_STRING_H @@ -125,9 +125,10 @@ AC_CACHE_VAL(libiberty_cv_decl_needed_$1, #endif #ifdef HAVE_UNISTD_H #include -#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 +[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include 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 -#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 #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 #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