public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
@ 2023-08-07 10:32 Arsen Arsenović
  2023-08-07 10:32 ` [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
                   ` (24 more replies)
  0 siblings, 25 replies; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arsen Arsenović

Hello,

This patch set, combined with a sibling patch set sent on the binutils
and GDB MLs, bring up the shared infrastructure between the two projects
in sync again.

It largely consists of cherry-picks from various people which have been
reviewed and accepted on the binutils-gdb side, as well as a couple of
patches for differences that seemed to get lost during the
pick-and-regenerate process, though I've had to reformat quite a few
commits so that they match what the changelog verifier expects.

Some of these commits were previously applied and then reverted, namely
"Check if AR works with --plugin and rc", but the reversion reason[1]
seems to be no longer valid as of requiring Binutils 2.35 for LTO
anyway.

In addition, I'm not entirely certain that the handling of the removed
targets I re-added is correct, nor what their status in binutils and gdb
is, so feedback is welcome there.

During this process, it appears that I overlooked passing -x to
cherry-pick, so the paper trail got lost.  If needed, I can hack
together some code to associate commits based on subjects with their
pair in the other repository, and amend the commits with these
references added.

These patches ignore the intl/ directory, as I plan to follow up this
patchset with one that can be cleanly applied to both trees which gets
rid of the intl/ directory in favor of out-of-tree gettext (ISL, GMP, et
al. style).

Bootstrapped and reg-tested on x86_64-pc-linux-gnu.

OK for master?

Thanks in advance, have a lovely day.

[1]: https://inbox.sourceware.org/gcc-patches/CAMe9rOqFSOSM5Sw5SBMiy20rdgRJkftUXdw=yKEXHvDMUtykdQ@mail.gmail.com/

Alan Modra (4):
  PR29961, plugin-api.h: "Could not detect architecture endianess"
  gcc-4.5 build fixes
  egrep in binutils
  PR27116, Spelling errors found by Debian style checker

Alexander von Gluck IV (1):
  Add support for the haiku operating system

Arsen Arsenović (3):
  toplevel: Substitute GDCFLAGS instead of using CFLAGS
  toplevel: Recover tilegx/tilepro targets
  configure: reinstate 32b PA-RISC HP-UX target in toplevel

Christophe Lyon (1):
  configure: require libzstd >= 1.4.0

Fangrui Song (1):
  binutils, gdb: support zstd compressed debug sections

H.J. Lu (4):
  Sync with binutils: GCC: Pass --plugin to AR and RANLIB
  GCC: Check if AR works with --plugin and rc
  PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
  PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works

Indu Bhagat (2):
  bfd: linker: merge .sframe sections
  toplevel: Makefile.def: add install-strip dependency on libsframe

John Ericson (1):
  Deprecate a.out support for NetBSD targets.

Luis Machado (1):
  Disable year 2038 support on 32-bit hosts by default

Martin Liska (1):
  add --enable-default-compressed-debug-sections-algorithm configure
    option

Nick Alcock (3):
  libtool.m4: fix nm BSD flag detection
  libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
  libtool.m4: augment symcode for Solaris 11

Simon Marchi (1):
  Pass PKG_CONFIG_PATH down from top-level Makefile

Vladimir Mezentsev (1):
  gprofng: a new GNU profiler

 Makefile.def               |  18 ++
 Makefile.in                | 517 ++++++++++++++++++++++++++++++++++++-
 Makefile.tpl               |  10 +-
 config/gcc-plugin.m4       |  40 +++
 config/lib-ld.m4           |   8 +-
 config/override.m4         |   2 +-
 config/picflag.m4          |   4 +-
 config/pkg.m4              |   8 +
 config/zstd.m4             |  23 ++
 configure                  | 224 +++++++++++++++-
 configure.ac               |  74 +++++-
 fixincludes/configure      |   3 +-
 gcc/configure              | 140 ++++++----
 include/collectorAPI.h     |  73 ++++++
 include/libcollector.h     |  89 +++++++
 include/libfcollector.h    |  42 +++
 include/plugin-api.h       |  49 ++--
 include/xtensa-dynconfig.h |   2 -
 intl/configure             |   4 +-
 libada/configure           |   4 +-
 libatomic/configure        | 130 ++++++----
 libbacktrace/configure     | 130 ++++++----
 libcc1/configure           | 132 ++++++----
 libcpp/configure           |   4 +-
 libffi/configure           | 132 ++++++----
 libgcc/configure           |   6 +-
 libgfortran/configure      | 132 ++++++----
 libgm2/configure           | 132 ++++++----
 libgomp/configure          | 132 ++++++----
 libiberty/Makefile.in      |   5 +-
 libiberty/aclocal.m4       |   1 +
 libiberty/configure        | 144 ++++++++++-
 libiberty/configure.ac     |  12 +
 libitm/configure           | 132 ++++++----
 libobjc/configure          | 130 ++++++----
 libphobos/configure        | 130 ++++++----
 libquadmath/configure      | 130 ++++++----
 libsanitizer/configure     | 132 ++++++----
 libssp/configure           | 130 ++++++----
 libstdc++-v3/configure     | 148 +++++++----
 libtool.m4                 | 130 ++++++----
 libvtv/configure           | 132 ++++++----
 lto-plugin/configure       | 130 ++++++----
 zlib/configure             | 130 ++++++----
 44 files changed, 2924 insertions(+), 956 deletions(-)
 create mode 100644 config/zstd.m4
 create mode 100644 include/collectorAPI.h
 create mode 100644 include/libcollector.h
 create mode 100644 include/libfcollector.h

-- 
2.41.0


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

* [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:30   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess" Arsen Arsenović
                   ` (23 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arsen Arsenović

r14-2875-g1ed21e23d6d4da ("Use substituted GDCFLAGS") already
implemented this change, but only on the generated file rather than in
the template it is generated from.

ChangeLog:

	* Makefile.tpl: Substitute @GDCFLAGS@ instead of using
	$(CFLAGS).
---
 Makefile.tpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.tpl b/Makefile.tpl
index d0fe7e2fb77..4fdca604eb0 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -447,7 +447,7 @@ LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
 GOCFLAGS = $(CFLAGS)
-GDCFLAGS = $(CFLAGS)
+GDCFLAGS = @GDCFLAGS@
 GM2FLAGS = $(CFLAGS)
 
 # Pass additional PGO and LTO compiler options to the PGO build.
-- 
2.41.0


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

* [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess"
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
  2023-08-07 10:32 ` [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 19:16   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 03/24] gcc-4.5 build fixes Arsen Arsenović
                   ` (22 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alan Modra

From: Alan Modra <amodra@gmail.com>

Found when attempting to build binutils on sparc sunos-5.8 where
sys/byteorder.h defines _BIG_ENDIAN but not any of the BYTE_ORDER
variants.  This patch adds the extra tests to cope with the old
machine, and tidies the header a little.

include/ChangeLog:

	* plugin-api.h: When handling non-gcc or gcc < 4.6.0 include
	necessary header files before testing macros.  Make more use
	of #elif.  Test _LITTLE_ENDIAN and _BIG_ENDIAN in final tests.
---
 include/plugin-api.h | 49 ++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/include/plugin-api.h b/include/plugin-api.h
index 395d5bcc598..f3cf2d8101b 100644
--- a/include/plugin-api.h
+++ b/include/plugin-api.h
@@ -37,7 +37,7 @@
 #error cannot find uint64_t type
 #endif
 
-/* Detect endianess based on __BYTE_ORDER__ macro.  */
+/* Detect endianess based on gcc's (>=4.6.0) __BYTE_ORDER__ macro.  */
 #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
     defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_PDP_ENDIAN__)
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
@@ -47,46 +47,47 @@
 #elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
 #define PLUGIN_PDP_ENDIAN 1
 #endif
+
 #else
-/* Older GCC releases (<4.6.0) can make detection from glibc macros.  */
+/* Include header files to define endian macros.  */
 #if defined(__GLIBC__) || defined(__GNU_LIBRARY__) || defined(__ANDROID__)
 #include <endian.h>
-#ifdef __BYTE_ORDER
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define PLUGIN_LITTLE_ENDIAN 1
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#define PLUGIN_BIG_ENDIAN 1
-#endif
-#endif
-#endif
-/* Include all necessary header files based on target.  */
-#if defined(__SVR4) && defined(__sun)
+
+#elif defined(__SVR4) && defined(__sun)
 #include <sys/byteorder.h>
-#endif
-#if defined(__FreeBSD__) || defined(__NetBSD__) || \
-    defined(__DragonFly__) || defined(__minix)
+
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || \
+      defined(__DragonFly__) || defined(__minix)
 #include <sys/endian.h>
-#endif
-#if defined(__OpenBSD__)
+
+#elif defined(__OpenBSD__)
 #include <machine/endian.h>
 #endif
+
+/* Detect endianess based on __BYTE_ORDER.  */
+#ifdef __BYTE_ORDER
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define PLUGIN_LITTLE_ENDIAN 1
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define PLUGIN_BIG_ENDIAN 1
+#endif
+
 /* Detect endianess based on _BYTE_ORDER.  */
-#ifdef _BYTE_ORDER
+#elif defined _BYTE_ORDER
 #if _BYTE_ORDER == _LITTLE_ENDIAN
 #define PLUGIN_LITTLE_ENDIAN 1
 #elif _BYTE_ORDER == _BIG_ENDIAN
 #define PLUGIN_BIG_ENDIAN 1
 #endif
-#endif
+
 /* Detect based on _WIN32.  */
-#if defined(_WIN32)
+#elif defined _WIN32
 #define PLUGIN_LITTLE_ENDIAN 1
-#endif
+
 /* Detect based on __BIG_ENDIAN__ and __LITTLE_ENDIAN__ */
-#ifdef __LITTLE_ENDIAN__
+#elif defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN
 #define PLUGIN_LITTLE_ENDIAN 1
-#endif
-#ifdef __BIG_ENDIAN__
+#elif defined __BIG_ENDIAN__ || defined _BIG_ENDIAN
 #define PLUGIN_BIG_ENDIAN 1
 #endif
 #endif
-- 
2.41.0


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

* [PATCH 03/24] gcc-4.5 build fixes
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
  2023-08-07 10:32 ` [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
  2023-08-07 10:32 ` [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess" Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:31   ` Jeff Law
  2023-08-07 20:06   ` Eric Gallager
  2023-08-07 10:32 ` [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB Arsen Arsenović
                   ` (21 subsequent siblings)
  24 siblings, 2 replies; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alan Modra

From: Alan Modra <amodra@gmail.com>

Trying to build binutils with an older gcc currently fails.  Working
around these gcc bugs is not onerous so let's fix them.

include/ChangeLog:

	* xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary
	forward declaration.
---
 include/xtensa-dynconfig.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/xtensa-dynconfig.h b/include/xtensa-dynconfig.h
index 48877ebb6b6..45d54dcd0e0 100644
--- a/include/xtensa-dynconfig.h
+++ b/include/xtensa-dynconfig.h
@@ -121,8 +121,6 @@ struct xtensa_config_v4
   int xchal_unaligned_store_hw;
 };
 
-typedef struct xtensa_isa_internal_struct xtensa_isa_internal;
-
 extern const void *xtensa_load_config (const char *name,
 				       const void *no_plugin_def,
 				       const void *no_name_def);
-- 
2.41.0


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

* [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (2 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 03/24] gcc-4.5 build fixes Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 19:15   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 05/24] GCC: Check if AR works with --plugin and rc Arsen Arsenović
                   ` (20 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: H.J. Lu

From: "H.J. Lu" <hjl.tools@gmail.com>

Sync with binutils for building binutils with LTO:

50ad1254d50 GCC: Pass --plugin to AR and RANLIB

Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

ChangeLog:

	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	* configure.ac: Include config/gcc-plugin.m4.
	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
	RANLIB if possible.
	* Makefile.in: Regenerated.
	* configure: Likewise.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/ChangeLog:

	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	(configure_deps): Depend on ../config/gcc-plugin.m4.
	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	RANLIB_PLUGIN_OPTION.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

zlib/ChangeLog:

	* configure: Regenerated.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.
---
 Makefile.in            |  5 +++--
 Makefile.tpl           |  5 +++--
 config/gcc-plugin.m4   | 28 ++++++++++++++++++++++++++++
 configure              | 39 +++++++++++++++++++++++++++++++++++++++
 configure.ac           | 15 +++++++++++++++
 gcc/configure          | 27 +++++++++++++++++++++++++--
 libatomic/configure    | 27 +++++++++++++++++++++++++--
 libbacktrace/configure | 27 +++++++++++++++++++++++++--
 libcc1/configure       | 27 +++++++++++++++++++++++++--
 libffi/configure       | 27 +++++++++++++++++++++++++--
 libgfortran/configure  | 27 +++++++++++++++++++++++++--
 libgm2/configure       | 27 +++++++++++++++++++++++++--
 libgomp/configure      | 27 +++++++++++++++++++++++++--
 libiberty/Makefile.in  |  5 +++--
 libiberty/aclocal.m4   |  1 +
 libiberty/configure    | 37 +++++++++++++++++++++++++++++++++++++
 libiberty/configure.ac | 12 ++++++++++++
 libitm/configure       | 27 +++++++++++++++++++++++++--
 libobjc/configure      | 27 +++++++++++++++++++++++++--
 libphobos/configure    | 27 +++++++++++++++++++++++++--
 libquadmath/configure  | 27 +++++++++++++++++++++++++--
 libsanitizer/configure | 27 +++++++++++++++++++++++++--
 libssp/configure       | 27 +++++++++++++++++++++++++--
 libstdc++-v3/configure | 39 +++++++++++++++++++++++++++++++--------
 libtool.m4             | 25 ++++++++++++++++++++++++-
 libvtv/configure       | 27 +++++++++++++++++++++++++--
 lto-plugin/configure   | 27 +++++++++++++++++++++++++--
 zlib/configure         | 27 +++++++++++++++++++++++++--
 28 files changed, 621 insertions(+), 49 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 144bccd2603..6539fb201dc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -417,7 +417,7 @@ MAKEINFOFLAGS = --split-size=5000000
 # ---------------------------------------------
 
 AS = @AS@
-AR = @AR@
+AR = @AR@ @AR_PLUGIN_OPTION@
 AR_FLAGS = rc
 CC = @CC@
 CXX = @CXX@
@@ -428,7 +428,7 @@ LIPO = @LIPO@
 NM = @NM@
 OBJDUMP = @OBJDUMP@
 OTOOL = @OTOOL@
-RANLIB = @RANLIB@
+RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
 READELF = @READELF@
 STRIP = @STRIP@
 WINDRES = @WINDRES@
@@ -66748,6 +66748,7 @@ AUTOCONF = autoconf
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
 	$(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
 	$(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
+	$(srcdir)/config/gcc-plugin.m4 \
 	$(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
 	$(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
 	cd $(srcdir) && $(AUTOCONF)
diff --git a/Makefile.tpl b/Makefile.tpl
index 4fdca604eb0..6586e907964 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -420,7 +420,7 @@ MAKEINFOFLAGS = --split-size=5000000
 # ---------------------------------------------
 
 AS = @AS@
-AR = @AR@
+AR = @AR@ @AR_PLUGIN_OPTION@
 AR_FLAGS = rc
 CC = @CC@
 CXX = @CXX@
@@ -431,7 +431,7 @@ LIPO = @LIPO@
 NM = @NM@
 OBJDUMP = @OBJDUMP@
 OTOOL = @OTOOL@
-RANLIB = @RANLIB@
+RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
 READELF = @READELF@
 STRIP = @STRIP@
 WINDRES = @WINDRES@
@@ -2106,6 +2106,7 @@ AUTOCONF = autoconf
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
 	$(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
 	$(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
+	$(srcdir)/config/gcc-plugin.m4 \
 	$(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
 	$(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
 	cd $(srcdir) && $(AUTOCONF)
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index 2ccb9ca7258..d782d52858e 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -129,3 +129,31 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
      fi
    fi
 ])
+
+dnl
+dnl
+dnl GCC_PLUGIN_OPTION
+dnl    (SHELL-CODE_HANDLER)
+dnl
+AC_DEFUN([GCC_PLUGIN_OPTION],[dnl
+AC_MSG_CHECKING([for -plugin option])
+
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -n "$plugin_option"; then
+  $1="$plugin_option"
+  AC_MSG_RESULT($plugin_option)
+else
+  AC_MSG_RESULT([no])
+fi
+])
diff --git a/configure b/configure
index 3269da9829f..4aa1ca21a38 100755
--- a/configure
+++ b/configure
@@ -620,6 +620,8 @@ GFORTRAN_FOR_TARGET
 GCC_FOR_TARGET
 CXX_FOR_TARGET
 CC_FOR_TARGET
+RANLIB_PLUGIN_OPTION
+AR_PLUGIN_OPTION
 GDCFLAGS
 READELF
 OTOOL
@@ -12949,6 +12951,43 @@ fi
 
 GDCFLAGS=${GDCFLAGS-${CFLAGS}}
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -n "$plugin_option"; then
+  PLUGIN_OPTION="$plugin_option"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+AR_PLUGIN_OPTION=
+RANLIB_PLUGIN_OPTION=
+if test -n "$PLUGIN_OPTION"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
+  fi
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
+  fi
+fi
+
+
+
 # Target tools.
 
 # Check whether --with-build-time-tools was given.
diff --git a/configure.ac b/configure.ac
index d07a0fa7698..a11b1006427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,7 @@ m4_include(config/override.m4)
 m4_include(config/proginstall.m4)
 m4_include(config/elf.m4)
 m4_include(config/ax_cxx_compile_stdcxx.m4)
+m4_include(config/gcc-plugin.m4)
 m4_include([libtool.m4])
 m4_include([ltoptions.m4])
 m4_include([ltsugar.m4])
@@ -3664,6 +3665,20 @@ AC_SUBST(GDC)
 AC_SUBST(GDCFLAGS)
 GDCFLAGS=${GDCFLAGS-${CFLAGS}}
 
+GCC_PLUGIN_OPTION(PLUGIN_OPTION)
+AR_PLUGIN_OPTION=
+RANLIB_PLUGIN_OPTION=
+if test -n "$PLUGIN_OPTION"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
+  fi
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
+  fi
+fi
+AC_SUBST(AR_PLUGIN_OPTION)
+AC_SUBST(RANLIB_PLUGIN_OPTION)
+
 # Target tools.
 AC_ARG_WITH([build-time-tools], 
   [AS_HELP_STRING([--with-build-time-tools=PATH],
diff --git a/gcc/configure b/gcc/configure
index c341ee12a8a..7c4a544fb19 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -14899,6 +14899,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -14992,6 +15005,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -15196,6 +15214,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -19850,7 +19873,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19853 "configure"
+#line 19876 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19956,7 +19979,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19959 "configure"
+#line 19982 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libatomic/configure b/libatomic/configure
index 1994662b7c5..739613c097c 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6144,6 +6144,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6237,6 +6250,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6441,6 +6459,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11364,7 +11387,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11367 "configure"
+#line 11390 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11470,7 +11493,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11473 "configure"
+#line 11496 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libbacktrace/configure b/libbacktrace/configure
index 88156e2c63b..ba778f8d407 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -6589,6 +6589,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6682,6 +6695,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6886,6 +6904,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11541,7 +11564,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11544 "configure"
+#line 11567 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11647,7 +11670,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11650 "configure"
+#line 11673 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libcc1/configure b/libcc1/configure
index bae3b8712b6..c2607b31bce 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5850,6 +5850,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -5943,6 +5956,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6147,6 +6165,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -10801,7 +10824,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10804 "configure"
+#line 10827 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10907,7 +10930,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10910 "configure"
+#line 10933 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libffi/configure b/libffi/configure
index 2bb9f8d83d6..2d177916c1e 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -6376,6 +6376,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6469,6 +6482,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6673,6 +6691,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11596,7 +11619,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11599 "configure"
+#line 11622 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11702,7 +11725,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11705 "configure"
+#line 11728 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 1cde8e8f025..12b6e18602d 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -7778,6 +7778,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7871,6 +7884,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -8075,6 +8093,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12761,7 +12784,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12764 "configure"
+#line 12787 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12867,7 +12890,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12870 "configure"
+#line 12893 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgm2/configure b/libgm2/configure
index da3d3bd4391..b7bca2d4e88 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -7680,6 +7680,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7773,6 +7786,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7977,6 +7995,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12664,7 +12687,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12667 "configure"
+#line 12690 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12770,7 +12793,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12773 "configure"
+#line 12796 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgomp/configure b/libgomp/configure
index e4e79c5199a..5b52e6fe4a8 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -6158,6 +6158,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6251,6 +6264,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6455,6 +6473,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11378,7 +11401,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11381 "configure"
+#line 11404 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11484,7 +11507,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11487 "configure"
+#line 11510 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 72608f3e4a7..f9fbba23e2c 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -50,13 +50,13 @@ mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs
 # Some compilers can't handle cc -c blah.c -o foo/blah.o.
 OUTPUT_OPTION = @OUTPUT_OPTION@
 
-AR = @AR@
+AR = @AR@ @AR_PLUGIN_OPTION@
 AR_FLAGS = rc
 
 CC = @CC@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
-RANLIB = @RANLIB@
+RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
 MAKEINFO = @MAKEINFO@
 PERL = @PERL@
 
@@ -507,6 +507,7 @@ aclocal_deps = \
 	$(srcdir)/../config/acx.m4 \
 	$(srcdir)/../config/cet.m4 \
 	$(srcdir)/../config/enable.m4 \
+	$(srcdir)/../config/gcc-plugin.m4 \
 	$(srcdir)/../config/no-executables.m4 \
 	$(srcdir)/../config/override.m4 \
 	$(srcdir)/../config/picflag.m4 \
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index 3378316dced..0757688d52a 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -15,6 +15,7 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun
 m4_include([../config/acx.m4])
 m4_include([../config/cet.m4])
 m4_include([../config/enable.m4])
+m4_include([../config/gcc-plugin.m4])
 m4_include([../config/no-executables.m4])
 m4_include([../config/picflag.m4])
 m4_include([../config/warnings.m4])
diff --git a/libiberty/configure b/libiberty/configure
index b8a19c42110..83c679b8a39 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -645,6 +645,8 @@ CPPFLAGS
 LDFLAGS
 CFLAGS
 CC
+RANLIB_PLUGIN_OPTION
+AR_PLUGIN_OPTION
 RANLIB
 AR
 host_os
@@ -2936,6 +2938,41 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
+$as_echo_n "checking for -plugin option... " >&6; }
+
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+if test -n "$plugin_option"; then
+  PLUGIN_OPTION="$plugin_option"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
+$as_echo "$plugin_option" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test -n "$PLUGIN_OPTION"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
+
+  fi
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
+
+  fi
+fi
+
 # Add --enable-multilib to configure.
 # Default to --enable-multilib
 # Check whether --enable-multilib was given.
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 6747a7b5cff..0748c592704 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -114,6 +114,18 @@ dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
+GCC_PLUGIN_OPTION(PLUGIN_OPTION)
+if test -n "$PLUGIN_OPTION"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR_PLUGIN_OPTION="$PLUGIN_OPTION"
+    AC_SUBST(AR_PLUGIN_OPTION)
+  fi
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
+    AC_SUBST(RANLIB_PLUGIN_OPTION)
+  fi
+fi
+
 dnl When switching to automake, replace the following with AM_ENABLE_MULTILIB.
 # Add --enable-multilib to configure.
 # Default to --enable-multilib
diff --git a/libitm/configure b/libitm/configure
index 74a8f4affd5..bcc853c5f4b 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -6819,6 +6819,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6912,6 +6925,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7116,6 +7134,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12040,7 +12063,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12043 "configure"
+#line 12066 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12146,7 +12169,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12149 "configure"
+#line 12172 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libobjc/configure b/libobjc/configure
index 6da20b8e4ff..03b1162160c 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -5504,6 +5504,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -5597,6 +5610,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -5801,6 +5819,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -10796,7 +10819,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10799 "configure"
+#line 10822 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10902,7 +10925,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10905 "configure"
+#line 10928 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libphobos/configure b/libphobos/configure
index d702c8f494c..ab611c8fc7f 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -6823,6 +6823,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6916,6 +6929,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7120,6 +7138,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11774,7 +11797,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11777 "configure"
+#line 11800 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11880,7 +11903,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11883 "configure"
+#line 11906 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libquadmath/configure b/libquadmath/configure
index 958fb876c5b..efbada5f3ef 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -5845,6 +5845,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -5938,6 +5951,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6142,6 +6160,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -10830,7 +10853,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10833 "configure"
+#line 10856 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10936,7 +10959,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10939 "configure"
+#line 10962 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libsanitizer/configure b/libsanitizer/configure
index e7984f96615..a68acb5c99b 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -7432,6 +7432,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7525,6 +7538,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7729,6 +7747,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12383,7 +12406,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12386 "configure"
+#line 12409 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12489,7 +12512,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12492 "configure"
+#line 12515 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libssp/configure b/libssp/configure
index 492915d2ce0..d34178b2262 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -6031,6 +6031,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -6124,6 +6137,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -6328,6 +6346,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -11016,7 +11039,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11019 "configure"
+#line 11042 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11122,7 +11145,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11125 "configure"
+#line 11148 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 36f217c898c..e33235e6b76 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -7074,6 +7074,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7167,6 +7180,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7371,6 +7389,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12187,7 +12210,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12190 "configure"
+#line 12213 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12293,7 +12316,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12296 "configure"
+#line 12319 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16017,7 +16040,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 16020 "configure"
+#line 16043 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -16052,7 +16075,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16055 "configure"
+#line 16078 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -16087,7 +16110,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16090 "configure"
+#line 16113 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -16123,7 +16146,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16126 "configure"
+#line 16149 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -16279,7 +16302,7 @@ $as_echo "mutex" >&6; }
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 16282 "configure"
+#line 16305 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -16321,7 +16344,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
   cat > conftest.$ac_ext << EOF
-#line 16324 "configure"
+#line 16347 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
diff --git a/libtool.m4 b/libtool.m4
index b92e284d9f9..adf75bdc48b 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -1325,8 +1325,26 @@ need_locks="$enable_libtool_lock"
 # _LT_CMD_OLD_ARCHIVE
 # -------------------
 m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
+[plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
+AC_CHECK_TOOL(AR, ar, false)
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 _LT_DECL([], [AR], [1], [The archiver])
 _LT_DECL([], [AR_FLAGS], [1])
@@ -1337,6 +1355,11 @@ _LT_DECL([], [STRIP], [1], [A symbol stripping program])
 
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 _LT_DECL([], [RANLIB], [1],
     [Commands used to install an old-style archive])
 
diff --git a/libvtv/configure b/libvtv/configure
index e7e490d8b3e..5f8e2bdbf39 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -7327,6 +7327,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7420,6 +7433,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7624,6 +7642,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12278,7 +12301,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12281 "configure"
+#line 12304 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12384,7 +12407,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12387 "configure"
+#line 12410 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 675b9cfa522..3e70f6fdbde 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -7198,6 +7198,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -7291,6 +7304,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -7495,6 +7513,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -12150,7 +12173,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12153 "configure"
+#line 12176 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12256,7 +12279,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12259 "configure"
+#line 12282 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/zlib/configure b/zlib/configure
index 9308866a636..1d141b36e39 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -5511,6 +5511,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+  if test x$plugin_so = x$plugin; then
+    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+  fi
+  if test x$plugin_so != x$plugin; then
+    plugin_option="--plugin $plugin_so"
+    break
+  fi
+done
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -5604,6 +5617,11 @@ else
 fi
 
 test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+  if $AR --help 2>&1 | grep -q "\--plugin"; then
+    AR="$AR $plugin_option"
+  fi
+fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
@@ -5808,6 +5826,11 @@ else
 fi
 
 test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+  if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+    RANLIB="$RANLIB $plugin_option"
+  fi
+fi
 
 
 
@@ -10763,7 +10786,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10766 "configure"
+#line 10789 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10869,7 +10892,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10872 "configure"
+#line 10895 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
-- 
2.41.0


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

* [PATCH 05/24] GCC: Check if AR works with --plugin and rc
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (3 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:41   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 06/24] toplevel: Recover tilegx/tilepro targets Arsen Arsenović
                   ` (19 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: H.J. Lu

From: "H.J. Lu" <hjl.tools@gmail.com>

AR from older binutils doesn't work with --plugin and rc:

[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$

Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

ChangeLog:

	* configure: Regenerated.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
	--plugin and rc before enabling --plugin.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
	--plugin and rc before enabling --plugin.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
---
 config/gcc-plugin.m4   |  12 +++++
 configure              | 103 +++++++++++++++++++++++++++++++++++++++++
 gcc/configure          |  14 ++++--
 libatomic/configure    |  14 ++++--
 libbacktrace/configure |  14 ++++--
 libcc1/configure       |  14 ++++--
 libffi/configure       |  14 ++++--
 libgfortran/configure  |  14 ++++--
 libgm2/configure       |  14 ++++--
 libgomp/configure      |  14 ++++--
 libiberty/configure    | 103 +++++++++++++++++++++++++++++++++++++++++
 libitm/configure       |  14 ++++--
 libobjc/configure      |  14 ++++--
 libphobos/configure    |  14 ++++--
 libquadmath/configure  |  14 ++++--
 libsanitizer/configure |  14 ++++--
 libssp/configure       |  14 ++++--
 libstdc++-v3/configure |  26 +++++++----
 libtool.m4             |   9 +++-
 libvtv/configure       |  14 ++++--
 lto-plugin/configure   |  14 ++++--
 zlib/configure         |  14 ++++--
 22 files changed, 430 insertions(+), 61 deletions(-)

diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index d782d52858e..c731a6fab38 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -150,6 +150,18 @@ for plugin in $plugin_names; do
     break
   fi
 done
+dnl Check if ${AR} $plugin_option rc works.
+AC_CHECK_TOOL(AR, ar)
+if test "${AR}" = "" ; then
+  AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
+fi
+touch conftest.c
+${AR} $plugin_option rc conftest.a conftest.c
+if test "$?" != 0; then
+  AC_MSG_WARN([Failed: $AR $plugin_option rc])
+  plugin_option=
+fi
+rm -f conftest.*
 if test -n "$plugin_option"; then
   $1="$plugin_option"
   AC_MSG_RESULT($plugin_option)
diff --git a/configure b/configure
index 4aa1ca21a38..3fe4a1804cf 100755
--- a/configure
+++ b/configure
@@ -12966,6 +12966,109 @@ for plugin in $plugin_names; do
     break
   fi
 done
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test "${AR}" = "" ; then
+  as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+fi
+touch conftest.c
+${AR} $plugin_option rc conftest.a conftest.c
+if test "$?" != 0; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+  plugin_option=
+fi
+rm -f conftest.*
 if test -n "$plugin_option"; then
   PLUGIN_OPTION="$plugin_option"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
diff --git a/gcc/configure b/gcc/configure
index 7c4a544fb19..55cb24ef453 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -15007,7 +15007,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -19873,7 +19881,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19876 "configure"
+#line 19884 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19979,7 +19987,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19982 "configure"
+#line 19990 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libatomic/configure b/libatomic/configure
index 739613c097c..8e10b70d443 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6252,7 +6252,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11387,7 +11395,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11390 "configure"
+#line 11398 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11493,7 +11501,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11496 "configure"
+#line 11504 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libbacktrace/configure b/libbacktrace/configure
index ba778f8d407..d086b86a088 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -6697,7 +6697,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11564,7 +11572,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11567 "configure"
+#line 11575 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11670,7 +11678,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11673 "configure"
+#line 11681 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libcc1/configure b/libcc1/configure
index c2607b31bce..84964de24de 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5958,7 +5958,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -10824,7 +10832,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10827 "configure"
+#line 10835 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10930,7 +10938,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10933 "configure"
+#line 10941 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libffi/configure b/libffi/configure
index 2d177916c1e..a1824ceaeb3 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -6484,7 +6484,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11619,7 +11627,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11622 "configure"
+#line 11630 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11725,7 +11733,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11728 "configure"
+#line 11736 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 12b6e18602d..425d1e32b39 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -7886,7 +7886,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12784,7 +12792,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12787 "configure"
+#line 12795 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12890,7 +12898,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12893 "configure"
+#line 12901 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgm2/configure b/libgm2/configure
index b7bca2d4e88..d3c3ab06ada 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -7788,7 +7788,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12687,7 +12695,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12690 "configure"
+#line 12698 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12793,7 +12801,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12796 "configure"
+#line 12804 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgomp/configure b/libgomp/configure
index 5b52e6fe4a8..49b43ba0967 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -6266,7 +6266,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11401,7 +11409,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11404 "configure"
+#line 11412 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11507,7 +11515,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11510 "configure"
+#line 11518 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libiberty/configure b/libiberty/configure
index 83c679b8a39..bdc860f1623 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -2953,6 +2953,109 @@ for plugin in $plugin_names; do
     break
   fi
 done
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test "${AR}" = "" ; then
+  as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5
+fi
+touch conftest.c
+${AR} $plugin_option rc conftest.a conftest.c
+if test "$?" != 0; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+  plugin_option=
+fi
+rm -f conftest.*
 if test -n "$plugin_option"; then
   PLUGIN_OPTION="$plugin_option"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5
diff --git a/libitm/configure b/libitm/configure
index bcc853c5f4b..6961eb879b3 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -6927,7 +6927,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12063,7 +12071,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12066 "configure"
+#line 12074 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12169,7 +12177,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12172 "configure"
+#line 12180 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libobjc/configure b/libobjc/configure
index 03b1162160c..cbac20271cf 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -5612,7 +5612,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -10819,7 +10827,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10822 "configure"
+#line 10830 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10925,7 +10933,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10928 "configure"
+#line 10936 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libphobos/configure b/libphobos/configure
index ab611c8fc7f..7c453f58771 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -6931,7 +6931,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11797,7 +11805,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11800 "configure"
+#line 11808 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11903,7 +11911,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11906 "configure"
+#line 11914 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libquadmath/configure b/libquadmath/configure
index efbada5f3ef..60844f38265 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -5953,7 +5953,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -10853,7 +10861,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10856 "configure"
+#line 10864 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10959,7 +10967,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10962 "configure"
+#line 10970 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libsanitizer/configure b/libsanitizer/configure
index a68acb5c99b..52c6677793e 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -7540,7 +7540,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12406,7 +12414,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12409 "configure"
+#line 12417 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12512,7 +12520,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12515 "configure"
+#line 12523 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libssp/configure b/libssp/configure
index d34178b2262..fdf4e9d234d 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -6139,7 +6139,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -11039,7 +11047,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11042 "configure"
+#line 11050 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11145,7 +11153,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11148 "configure"
+#line 11156 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index e33235e6b76..b280071391d 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -7182,7 +7182,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12210,7 +12218,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12213 "configure"
+#line 12221 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12316,7 +12324,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12319 "configure"
+#line 12327 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16040,7 +16048,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 16043 "configure"
+#line 16051 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -16075,7 +16083,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16078 "configure"
+#line 16086 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -16110,7 +16118,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16113 "configure"
+#line 16121 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -16146,7 +16154,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16149 "configure"
+#line 16157 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -16302,7 +16310,7 @@ $as_echo "mutex" >&6; }
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 16305 "configure"
+#line 16313 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -16344,7 +16352,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
   cat > conftest.$ac_ext << EOF
-#line 16347 "configure"
+#line 16355 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
diff --git a/libtool.m4 b/libtool.m4
index adf75bdc48b..7af548938ec 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -1342,7 +1342,14 @@ AC_CHECK_TOOL(AR, ar, false)
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      AC_MSG_WARN([Failed: $AR $plugin_option rc])
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
diff --git a/libvtv/configure b/libvtv/configure
index 5f8e2bdbf39..33ca49e63c6 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -7435,7 +7435,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12301,7 +12309,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12304 "configure"
+#line 12312 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12407,7 +12415,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12410 "configure"
+#line 12418 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 3e70f6fdbde..69ccd66b038 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -7306,7 +7306,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -12173,7 +12181,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12176 "configure"
+#line 12184 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12279,7 +12287,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12282 "configure"
+#line 12290 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/zlib/configure b/zlib/configure
index 1d141b36e39..29eeb350429 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -5619,7 +5619,15 @@ fi
 test -z "$AR" && AR=ar
 if test -n "$plugin_option"; then
   if $AR --help 2>&1 | grep -q "\--plugin"; then
-    AR="$AR $plugin_option"
+    touch conftest.c
+    $AR $plugin_option rc conftest.a conftest.c
+    if test "$?" != 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5
+$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;}
+    else
+      AR="$AR $plugin_option"
+    fi
+    rm -f conftest.*
   fi
 fi
 test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -10786,7 +10794,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10789 "configure"
+#line 10797 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10892,7 +10900,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10895 "configure"
+#line 10903 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
-- 
2.41.0


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

* [PATCH 06/24] toplevel: Recover tilegx/tilepro targets
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (4 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 05/24] GCC: Check if AR works with --plugin and rc Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:42   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 07/24] binutils, gdb: support zstd compressed debug sections Arsen Arsenović
                   ` (18 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arsen Arsenović

These are still supported in Binutils.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Recover tilegx/tilepro targets.
---
 configure    | 5 ++++-
 configure.ac | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3fe4a1804cf..04369383079 100755
--- a/configure
+++ b/configure
@@ -3072,7 +3072,7 @@ case "${ENABLE_GOLD}" in
       # Check for target supported by gold.
       case "${target}" in
         i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
-        | aarch64*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*)
+        | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*)
 	  configdirs="$configdirs gold"
 	  if test x${ENABLE_GOLD} = xdefault; then
 	    default_ld=gold
@@ -3977,6 +3977,9 @@ case "${target}" in
   tic6x-*-*)
     noconfigdirs="$noconfigdirs sim"
     ;;
+  tilepro*-*-* | tilegx*-*-*)
+    noconfigdirs="$noconfigdirs sim"
+    ;;
   v810-*-*)
     noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
     ;;
diff --git a/configure.ac b/configure.ac
index a11b1006427..3632216fd1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,7 +360,7 @@ case "${ENABLE_GOLD}" in
       # Check for target supported by gold.
       case "${target}" in
         i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-* \
-        | aarch64*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*)
+        | aarch64*-*-* | tilegx*-*-* | mips*-*-* | s390*-*-* | loongarch*-*-*)
 	  configdirs="$configdirs gold"
 	  if test x${ENABLE_GOLD} = xdefault; then
 	    default_ld=gold
@@ -1227,6 +1227,9 @@ case "${target}" in
   tic6x-*-*)
     noconfigdirs="$noconfigdirs sim"
     ;;
+  tilepro*-*-* | tilegx*-*-*)
+    noconfigdirs="$noconfigdirs sim"
+    ;;
   v810-*-*)
     noconfigdirs="$noconfigdirs bfd binutils gas gdb ld opcodes target-libgloss"
     ;;
-- 
2.41.0


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

* [PATCH 07/24] binutils, gdb: support zstd compressed debug sections
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (5 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 06/24] toplevel: Recover tilegx/tilepro targets Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:43   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 08/24] configure: require libzstd >= 1.4.0 Arsen Arsenović
                   ` (17 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Fangrui Song

From: Fangrui Song <maskray@google.com>

PR29397 PR29563: Add new configure option --with-zstd which defaults to
auto.  If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support
zstd compressed debug sections for most tools.

* bfd: for addr2line, objdump --dwarf, gdb, etc
* gas: support --compress-debug-sections=zstd
* ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
* objcopy: support ELFCOMPRESS_ZSTD input for
  --decompress-debug-sections and --compress-debug-sections=zstd
* gdb: support ELFCOMPRESS_ZSTD input.  The bfd change references zstd
  symbols, so gdb has to link against -lzstd in this patch.

If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error.  We
can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this
is too heavyweight, so don't do it for now.

```
% ld/ld-new a.o
ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...

% ld/ld-new a.o --compress-debug-sections=zstd
ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support

% binutils/objcopy --compress-debug-sections=zstd a.o b.o
binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support

% binutils/objcopy b.o --decompress-debug-sections
binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...
```

config/ChangeLog:

	* zstd.m4: New file.

ChangeLog:
	* configure: Regenerate.
	* configure.ac: Add --with-zstd.
---
 config/zstd.m4 | 23 +++++++++++++++++++++++
 configure      | 10 ++++++++++
 configure.ac   |  3 +++
 3 files changed, 36 insertions(+)
 create mode 100644 config/zstd.m4

diff --git a/config/zstd.m4 b/config/zstd.m4
new file mode 100644
index 00000000000..6da4db68c58
--- /dev/null
+++ b/config/zstd.m4
@@ -0,0 +1,23 @@
+dnl Copyright (C) 2022 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Enable features using the zstd library.
+AC_DEFUN([AC_ZSTD], [
+AC_ARG_WITH(zstd,
+  [AS_HELP_STRING([--with-zstd], [support zstd compressed debug sections (default=auto)])],
+  [], [with_zstd=auto])
+
+AS_IF([test "$with_zstd" != no],
+  [PKG_CHECK_MODULES(ZSTD, [libzstd], [
+    AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.])
+  ], [
+    if test "$with_zstd" = yes; then
+      AC_MSG_ERROR([--with-zstd was given, but pkgconfig/libzstd.pc is not found])
+    fi
+  ])
+  ])
+])
diff --git a/configure b/configure
index 04369383079..a5f6282bb0e 100755
--- a/configure
+++ b/configure
@@ -800,6 +800,7 @@ ac_user_opts='
 enable_option_checking
 with_build_libsubdir
 with_system_zlib
+with_zstd
 enable_as_accelerator_for
 enable_offload_targets
 enable_offload_defaulted
@@ -1589,6 +1590,8 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-build-libsubdir=DIR  Directory where to find libraries for build system
   --with-system-zlib      use installed libz
+  --with-zstd             Support zstd compressed debug sections
+                          (default=auto)
   --with-mpc=PATH         specify prefix directory for installed MPC package.
                           Equivalent to --with-mpc-include=PATH/include plus
                           --with-mpc-lib=PATH/lib
@@ -2962,6 +2965,13 @@ if test x$with_system_readline = xyes ; then
   noconfigdirs="$noconfigdirs readline"
 fi
 
+
+# Check whether --with-zstd was given.
+if test "${with_zstd+set}" = set; then :
+  withval=$with_zstd;
+fi
+
+
 # some tools are so dependent upon X11 that if we're not building with X,
 # it's not even worth trying to configure, much less build, that tool.
 
diff --git a/configure.ac b/configure.ac
index 3632216fd1c..e820940c81e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,6 +254,9 @@ if test x$with_system_readline = xyes ; then
   noconfigdirs="$noconfigdirs readline"
 fi
 
+AC_ARG_WITH(zstd,
+[AS_HELP_STRING([--with-zstd], [Support zstd compressed debug sections (default=auto)])])
+
 # some tools are so dependent upon X11 that if we're not building with X, 
 # it's not even worth trying to configure, much less build, that tool.
 
-- 
2.41.0


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

* [PATCH 08/24] configure: require libzstd >= 1.4.0
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (6 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 07/24] binutils, gdb: support zstd compressed debug sections Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:43   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option Arsen Arsenović
                   ` (16 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Christophe Lyon

From: Christophe Lyon <christophe.lyon@arm.com>

gas uses ZSTD_compressStream2 which is only available with libzstd >=
1.4.0, leading to build errors when an older version is installed.

This patch updates the check libzstd presence to check its version is
>= 1.4.0. However, since gas seems to be the only component requiring
such a recent version this may imply that we disable ZSTD support for
all components although some would still benefit from an older
version.

I ran 'autoreconf -f' in all directories containing a configure.ac
file, using vanilla autoconf-2.69 and automake-1.15.1. I noticed
several errors from autoheader in readline, as well as warnings in
intl, but they are unrelated to this patch.

This should fix some of the buildbots.

OK for trunk?

Thanks,

Christophe

config/ChangeLog:

	* zstd.m4: Add minimum version requirement of 1.4.0.
---
 config/zstd.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/zstd.m4 b/config/zstd.m4
index 6da4db68c58..eb34c0f36d7 100644
--- a/config/zstd.m4
+++ b/config/zstd.m4
@@ -12,7 +12,7 @@ AC_ARG_WITH(zstd,
   [], [with_zstd=auto])
 
 AS_IF([test "$with_zstd" != no],
-  [PKG_CHECK_MODULES(ZSTD, [libzstd], [
+  [PKG_CHECK_MODULES(ZSTD, [libzstd >= 1.4.0], [
     AC_DEFINE(HAVE_ZSTD, 1, [Define to 1 if zstd is enabled.])
   ], [
     if test "$with_zstd" = yes; then
-- 
2.41.0


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

* [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (7 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 08/24] configure: require libzstd >= 1.4.0 Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:53   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 10/24] gprofng: a new GNU profiler Arsen Arsenović
                   ` (15 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Martin Liska

From: Martin Liska <mliska@suse.cz>

ChangeLog:

	* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
	* configure: Regenerate.
---
 configure    | 13 +++++++++++++
 configure.ac |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/configure b/configure
index a5f6282bb0e..c5f6ae8e745 100755
--- a/configure
+++ b/configure
@@ -807,6 +807,7 @@ enable_offload_defaulted
 enable_gold
 enable_ld
 enable_compressed_debug_sections
+enable_default_compressed_debug_sections_algorithm
 enable_libquadmath
 enable_libquadmath_support
 enable_libada
@@ -1546,6 +1547,9 @@ Optional Features:
   --enable-compressed-debug-sections={all,gas,gold,ld,none}
                           Enable compressed debug sections for gas, gold or ld
                           by default
+  --enable-default-compressed-debug-sections-algorithm={zlib,zstd}
+                          Default compression algorithm for
+                          --enable-compressed-debug-sections.
   --disable-libquadmath   do not build libquadmath directory
   --disable-libquadmath-support
                           disable libquadmath support for Fortran
@@ -3142,6 +3146,15 @@ else
 fi
 
 
+# Select default compression algorithm.
+# Check whether --enable-default_compressed_debug_sections_algorithm was given.
+if test "${enable_default_compressed_debug_sections_algorithm+set}" = set; then :
+  enableval=$enable_default_compressed_debug_sections_algorithm;
+else
+  default_compressed_debug_sections_algorithm=
+fi
+
+
 # Configure extra directories which are host specific
 
 case "${host}" in
diff --git a/configure.ac b/configure.ac
index e820940c81e..ef30300af28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -418,6 +418,12 @@ AC_ARG_ENABLE(compressed_debug_sections,
   fi
 ], [enable_compressed_debug_sections=])
 
+# Select default compression algorithm.
+AC_ARG_ENABLE(default_compressed_debug_sections_algorithm,
+[AS_HELP_STRING([--enable-default-compressed-debug-sections-algorithm={zlib,zstd}],
+		[Default compression algorithm for --enable-compressed-debug-sections.])],
+[], [default_compressed_debug_sections_algorithm=])
+
 # Configure extra directories which are host specific
 
 case "${host}" in
-- 
2.41.0


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

* [PATCH 10/24] gprofng: a new GNU profiler
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (8 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:44   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default Arsen Arsenović
                   ` (14 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vladimir Mezentsev

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

ChangeLog:

	* Makefile.def: Add gprofng module.
	* configure.ac: Add --enable-gprofng option.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

include/ChangeLog:

	* collectorAPI.h: New file.
	* libcollector.h: New file.
	* libfcollector.h: New file.
---
 Makefile.def            |  11 +
 Makefile.in             | 497 ++++++++++++++++++++++++++++++++++++++++
 configure               |  18 ++
 configure.ac            |  14 ++
 include/collectorAPI.h  |  73 ++++++
 include/libcollector.h  |  89 +++++++
 include/libfcollector.h |  42 ++++
 7 files changed, 744 insertions(+)
 create mode 100644 include/collectorAPI.h
 create mode 100644 include/libcollector.h
 create mode 100644 include/libfcollector.h

diff --git a/Makefile.def b/Makefile.def
index 9b4a8a2bf7a..86d25f43762 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -73,6 +73,7 @@ host_modules= { module= isl; lib_path=.libs; bootstrap=true;
 		no_install= true; };
 host_modules= { module= gold; bootstrap=true; };
 host_modules= { module= gprof; };
+host_modules= { module= gprofng; };
 // intl acts on 'host_shared' directly, and does not support --with-pic.
 host_modules= { module= intl; bootstrap=true; };
 host_modules= { module= tcl;
@@ -511,6 +512,16 @@ dependencies = { module=all-gprof; on=all-bfd; };
 dependencies = { module=all-gprof; on=all-opcodes; };
 dependencies = { module=all-gprof; on=all-intl; };
 dependencies = { module=all-gprof; on=all-gas; };
+
+dependencies = { module=configure-gprofng; on=configure-intl; };
+dependencies = { module=all-gprofng; on=all-libiberty; };
+dependencies = { module=all-gprofng; on=all-bfd; };
+dependencies = { module=all-gprofng; on=all-opcodes; };
+dependencies = { module=all-gprofng; on=all-intl; };
+dependencies = { module=all-gprofng; on=all-gas; };
+dependencies = { module=install-gprofng; on=install-opcodes; };
+dependencies = { module=install-gprofng; on=install-bfd; };
+
 dependencies = { module=configure-ld; on=configure-intl; };
 dependencies = { module=all-ld; on=all-libiberty; };
 dependencies = { module=all-ld; on=all-bfd; };
diff --git a/Makefile.in b/Makefile.in
index 6539fb201dc..f177ce176fb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1089,6 +1089,7 @@ configure-host:  \
     maybe-configure-isl \
     maybe-configure-gold \
     maybe-configure-gprof \
+    maybe-configure-gprofng \
     maybe-configure-intl \
     maybe-configure-tcl \
     maybe-configure-itcl \
@@ -1242,6 +1243,7 @@ all-host: maybe-all-isl
 all-host: maybe-all-gold
 @endif gold-no-bootstrap
 all-host: maybe-all-gprof
+all-host: maybe-all-gprofng
 @if intl-no-bootstrap
 all-host: maybe-all-intl
 @endif intl-no-bootstrap
@@ -1381,6 +1383,7 @@ info-host: maybe-info-mpc
 info-host: maybe-info-isl
 info-host: maybe-info-gold
 info-host: maybe-info-gprof
+info-host: maybe-info-gprofng
 info-host: maybe-info-intl
 info-host: maybe-info-tcl
 info-host: maybe-info-itcl
@@ -1471,6 +1474,7 @@ dvi-host: maybe-dvi-mpc
 dvi-host: maybe-dvi-isl
 dvi-host: maybe-dvi-gold
 dvi-host: maybe-dvi-gprof
+dvi-host: maybe-dvi-gprofng
 dvi-host: maybe-dvi-intl
 dvi-host: maybe-dvi-tcl
 dvi-host: maybe-dvi-itcl
@@ -1561,6 +1565,7 @@ pdf-host: maybe-pdf-mpc
 pdf-host: maybe-pdf-isl
 pdf-host: maybe-pdf-gold
 pdf-host: maybe-pdf-gprof
+pdf-host: maybe-pdf-gprofng
 pdf-host: maybe-pdf-intl
 pdf-host: maybe-pdf-tcl
 pdf-host: maybe-pdf-itcl
@@ -1651,6 +1656,7 @@ html-host: maybe-html-mpc
 html-host: maybe-html-isl
 html-host: maybe-html-gold
 html-host: maybe-html-gprof
+html-host: maybe-html-gprofng
 html-host: maybe-html-intl
 html-host: maybe-html-tcl
 html-host: maybe-html-itcl
@@ -1741,6 +1747,7 @@ TAGS-host: maybe-TAGS-mpc
 TAGS-host: maybe-TAGS-isl
 TAGS-host: maybe-TAGS-gold
 TAGS-host: maybe-TAGS-gprof
+TAGS-host: maybe-TAGS-gprofng
 TAGS-host: maybe-TAGS-intl
 TAGS-host: maybe-TAGS-tcl
 TAGS-host: maybe-TAGS-itcl
@@ -1831,6 +1838,7 @@ install-info-host: maybe-install-info-mpc
 install-info-host: maybe-install-info-isl
 install-info-host: maybe-install-info-gold
 install-info-host: maybe-install-info-gprof
+install-info-host: maybe-install-info-gprofng
 install-info-host: maybe-install-info-intl
 install-info-host: maybe-install-info-tcl
 install-info-host: maybe-install-info-itcl
@@ -1921,6 +1929,7 @@ install-dvi-host: maybe-install-dvi-mpc
 install-dvi-host: maybe-install-dvi-isl
 install-dvi-host: maybe-install-dvi-gold
 install-dvi-host: maybe-install-dvi-gprof
+install-dvi-host: maybe-install-dvi-gprofng
 install-dvi-host: maybe-install-dvi-intl
 install-dvi-host: maybe-install-dvi-tcl
 install-dvi-host: maybe-install-dvi-itcl
@@ -2011,6 +2020,7 @@ install-pdf-host: maybe-install-pdf-mpc
 install-pdf-host: maybe-install-pdf-isl
 install-pdf-host: maybe-install-pdf-gold
 install-pdf-host: maybe-install-pdf-gprof
+install-pdf-host: maybe-install-pdf-gprofng
 install-pdf-host: maybe-install-pdf-intl
 install-pdf-host: maybe-install-pdf-tcl
 install-pdf-host: maybe-install-pdf-itcl
@@ -2101,6 +2111,7 @@ install-html-host: maybe-install-html-mpc
 install-html-host: maybe-install-html-isl
 install-html-host: maybe-install-html-gold
 install-html-host: maybe-install-html-gprof
+install-html-host: maybe-install-html-gprofng
 install-html-host: maybe-install-html-intl
 install-html-host: maybe-install-html-tcl
 install-html-host: maybe-install-html-itcl
@@ -2191,6 +2202,7 @@ installcheck-host: maybe-installcheck-mpc
 installcheck-host: maybe-installcheck-isl
 installcheck-host: maybe-installcheck-gold
 installcheck-host: maybe-installcheck-gprof
+installcheck-host: maybe-installcheck-gprofng
 installcheck-host: maybe-installcheck-intl
 installcheck-host: maybe-installcheck-tcl
 installcheck-host: maybe-installcheck-itcl
@@ -2281,6 +2293,7 @@ mostlyclean-host: maybe-mostlyclean-mpc
 mostlyclean-host: maybe-mostlyclean-isl
 mostlyclean-host: maybe-mostlyclean-gold
 mostlyclean-host: maybe-mostlyclean-gprof
+mostlyclean-host: maybe-mostlyclean-gprofng
 mostlyclean-host: maybe-mostlyclean-intl
 mostlyclean-host: maybe-mostlyclean-tcl
 mostlyclean-host: maybe-mostlyclean-itcl
@@ -2371,6 +2384,7 @@ clean-host: maybe-clean-mpc
 clean-host: maybe-clean-isl
 clean-host: maybe-clean-gold
 clean-host: maybe-clean-gprof
+clean-host: maybe-clean-gprofng
 clean-host: maybe-clean-intl
 clean-host: maybe-clean-tcl
 clean-host: maybe-clean-itcl
@@ -2461,6 +2475,7 @@ distclean-host: maybe-distclean-mpc
 distclean-host: maybe-distclean-isl
 distclean-host: maybe-distclean-gold
 distclean-host: maybe-distclean-gprof
+distclean-host: maybe-distclean-gprofng
 distclean-host: maybe-distclean-intl
 distclean-host: maybe-distclean-tcl
 distclean-host: maybe-distclean-itcl
@@ -2551,6 +2566,7 @@ maintainer-clean-host: maybe-maintainer-clean-mpc
 maintainer-clean-host: maybe-maintainer-clean-isl
 maintainer-clean-host: maybe-maintainer-clean-gold
 maintainer-clean-host: maybe-maintainer-clean-gprof
+maintainer-clean-host: maybe-maintainer-clean-gprofng
 maintainer-clean-host: maybe-maintainer-clean-intl
 maintainer-clean-host: maybe-maintainer-clean-tcl
 maintainer-clean-host: maybe-maintainer-clean-itcl
@@ -2699,6 +2715,7 @@ check-host:  \
     maybe-check-isl \
     maybe-check-gold \
     maybe-check-gprof \
+    maybe-check-gprofng \
     maybe-check-intl \
     maybe-check-tcl \
     maybe-check-itcl \
@@ -2836,6 +2853,7 @@ install-host-nogcc:  \
     maybe-install-isl \
     maybe-install-gold \
     maybe-install-gprof \
+    maybe-install-gprofng \
     maybe-install-intl \
     maybe-install-tcl \
     maybe-install-itcl \
@@ -2891,6 +2909,7 @@ install-host:  \
     maybe-install-isl \
     maybe-install-gold \
     maybe-install-gprof \
+    maybe-install-gprofng \
     maybe-install-intl \
     maybe-install-tcl \
     maybe-install-itcl \
@@ -3001,6 +3020,7 @@ install-strip-host:  \
     maybe-install-strip-isl \
     maybe-install-strip-gold \
     maybe-install-strip-gprof \
+    maybe-install-strip-gprofng \
     maybe-install-strip-intl \
     maybe-install-strip-tcl \
     maybe-install-strip-itcl \
@@ -19301,6 +19321,474 @@ maintainer-clean-gprof:
 
 
 
+.PHONY: configure-gprofng maybe-configure-gprofng
+maybe-configure-gprofng:
+@if gcc-bootstrap
+configure-gprofng: stage_current
+@endif gcc-bootstrap
+@if gprofng
+maybe-configure-gprofng: configure-gprofng
+configure-gprofng: 
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	test ! -f $(HOST_SUBDIR)/gprofng/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gprofng; \
+	$(HOST_EXPORTS)  \
+	echo Configuring in $(HOST_SUBDIR)/gprofng; \
+	cd "$(HOST_SUBDIR)/gprofng" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gprofng/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=gprofng; \
+	$(SHELL) \
+	  $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias}  \
+	  || exit 1
+@endif gprofng
+
+
+
+
+
+.PHONY: all-gprofng maybe-all-gprofng
+maybe-all-gprofng:
+@if gcc-bootstrap
+all-gprofng: stage_current
+@endif gcc-bootstrap
+@if gprofng
+TARGET-gprofng=all
+maybe-all-gprofng: all-gprofng
+all-gprofng: configure-gprofng
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS)  \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS)  \
+		$(TARGET-gprofng))
+@endif gprofng
+
+
+
+
+.PHONY: check-gprofng maybe-check-gprofng
+maybe-check-gprofng:
+@if gprofng
+maybe-check-gprofng: check-gprofng
+
+check-gprofng:
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS)  \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif gprofng
+
+.PHONY: install-gprofng maybe-install-gprofng
+maybe-install-gprofng:
+@if gprofng
+maybe-install-gprofng: install-gprofng
+
+install-gprofng: installdirs
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif gprofng
+
+.PHONY: install-strip-gprofng maybe-install-strip-gprofng
+maybe-install-strip-gprofng:
+@if gprofng
+maybe-install-strip-gprofng: install-strip-gprofng
+
+install-strip-gprofng: installdirs
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(FLAGS_TO_PASS)  install-strip)
+
+@endif gprofng
+
+# Other targets (info, dvi, pdf, etc.)
+
+.PHONY: maybe-info-gprofng info-gprofng
+maybe-info-gprofng:
+@if gprofng
+maybe-info-gprofng: info-gprofng
+
+info-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          info) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-dvi-gprofng dvi-gprofng
+maybe-dvi-gprofng:
+@if gprofng
+maybe-dvi-gprofng: dvi-gprofng
+
+dvi-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing dvi in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          dvi) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-pdf-gprofng pdf-gprofng
+maybe-pdf-gprofng:
+@if gprofng
+maybe-pdf-gprofng: pdf-gprofng
+
+pdf-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing pdf in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          pdf) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-html-gprofng html-gprofng
+maybe-html-gprofng:
+@if gprofng
+maybe-html-gprofng: html-gprofng
+
+html-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing html in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          html) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-TAGS-gprofng TAGS-gprofng
+maybe-TAGS-gprofng:
+@if gprofng
+maybe-TAGS-gprofng: TAGS-gprofng
+
+TAGS-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing TAGS in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          TAGS) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-install-info-gprofng install-info-gprofng
+maybe-install-info-gprofng:
+@if gprofng
+maybe-install-info-gprofng: install-info-gprofng
+
+install-info-gprofng: \
+    configure-gprofng \
+    info-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-info in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-info) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-install-dvi-gprofng install-dvi-gprofng
+maybe-install-dvi-gprofng:
+@if gprofng
+maybe-install-dvi-gprofng: install-dvi-gprofng
+
+install-dvi-gprofng: \
+    configure-gprofng \
+    dvi-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-install-pdf-gprofng install-pdf-gprofng
+maybe-install-pdf-gprofng:
+@if gprofng
+maybe-install-pdf-gprofng: install-pdf-gprofng
+
+install-pdf-gprofng: \
+    configure-gprofng \
+    pdf-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-pdf in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-pdf) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-install-html-gprofng install-html-gprofng
+maybe-install-html-gprofng:
+@if gprofng
+maybe-install-html-gprofng: install-html-gprofng
+
+install-html-gprofng: \
+    configure-gprofng \
+    html-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-html in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-html) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-installcheck-gprofng installcheck-gprofng
+maybe-installcheck-gprofng:
+@if gprofng
+maybe-installcheck-gprofng: installcheck-gprofng
+
+installcheck-gprofng: \
+    configure-gprofng 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing installcheck in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          installcheck) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-mostlyclean-gprofng mostlyclean-gprofng
+maybe-mostlyclean-gprofng:
+@if gprofng
+maybe-mostlyclean-gprofng: mostlyclean-gprofng
+
+mostlyclean-gprofng: 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing mostlyclean in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          mostlyclean) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-clean-gprofng clean-gprofng
+maybe-clean-gprofng:
+@if gprofng
+maybe-clean-gprofng: clean-gprofng
+
+clean-gprofng: 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing clean in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          clean) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-distclean-gprofng distclean-gprofng
+maybe-distclean-gprofng:
+@if gprofng
+maybe-distclean-gprofng: distclean-gprofng
+
+distclean-gprofng: 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing distclean in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          distclean) \
+	  || exit 1
+
+@endif gprofng
+
+.PHONY: maybe-maintainer-clean-gprofng maintainer-clean-gprofng
+maybe-maintainer-clean-gprofng:
+@if gprofng
+maybe-maintainer-clean-gprofng: maintainer-clean-gprofng
+
+maintainer-clean-gprofng: 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprofng/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing maintainer-clean in gprofng"; \
+	(cd $(HOST_SUBDIR)/gprofng && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          maintainer-clean) \
+	  || exit 1
+
+@endif gprofng
+
+
+
 .PHONY: configure-intl maybe-configure-intl
 maybe-configure-intl:
 @if gcc-bootstrap
@@ -66063,6 +66551,8 @@ all-stagetrain-gas: maybe-all-stagetrain-intl
 all-stagefeedback-gas: maybe-all-stagefeedback-intl
 all-stageautoprofile-gas: maybe-all-stageautoprofile-intl
 all-stageautofeedback-gas: maybe-all-stageautofeedback-intl
+install-gprofng: maybe-install-opcodes
+install-gprofng: maybe-install-bfd
 configure-ld: maybe-configure-intl
 configure-stage1-ld: maybe-configure-stage1-intl
 configure-stage2-ld: maybe-configure-stage2-intl
@@ -66503,6 +66993,7 @@ configure-gdb: stage_last
 configure-gdbserver: stage_last
 configure-gdbsupport: stage_last
 configure-gprof: stage_last
+configure-gprofng: stage_last
 configure-sid: stage_last
 configure-sim: stage_last
 configure-fastjar: stage_last
@@ -66537,6 +67028,12 @@ all-gprof: maybe-all-bfd
 all-gprof: maybe-all-opcodes
 all-gprof: maybe-all-intl
 all-gprof: maybe-all-gas
+configure-gprofng: maybe-configure-intl
+all-gprofng: maybe-all-libiberty
+all-gprofng: maybe-all-bfd
+all-gprofng: maybe-all-opcodes
+all-gprofng: maybe-all-intl
+all-gprofng: maybe-all-gas
 all-sid: maybe-all-libiberty
 all-sid: maybe-all-bfd
 all-sid: maybe-all-opcodes
diff --git a/configure b/configure
index c5f6ae8e745..35c0c75ee12 100755
--- a/configure
+++ b/configure
@@ -806,6 +806,7 @@ enable_offload_targets
 enable_offload_defaulted
 enable_gold
 enable_ld
+enable_gprofng
 enable_compressed_debug_sections
 enable_default_compressed_debug_sections_algorithm
 enable_libquadmath
@@ -1544,6 +1545,7 @@ Optional Features:
 
   --enable-gold[=ARG]     build gold [ARG={default,yes,no}]
   --enable-ld[=ARG]       build ld [ARG={default,yes,no}]
+  --enable-gprofng[=ARG]  build gprofng [ARG={yes,no}]
   --enable-compressed-debug-sections={all,gas,gold,ld,none}
                           Enable compressed debug sections for gas, gold or ld
                           by default
@@ -3131,6 +3133,22 @@ $as_echo "$as_me: WARNING: neither ld nor gold are enabled" >&2;}
     ;;
 esac
 
+# Check whether --enable-gprofng was given.
+if test "${enable_gprofng+set}" = set; then :
+  enableval=$enable_gprofng; enable_gprofng=$enableval
+else
+  enable_gprofng=yes
+fi
+
+if test "$enable_gprofng" = "yes"; then
+  case "${target}" in
+    x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
+    configdirs="$configdirs gprofng"
+    ;;
+  esac
+fi
+
+
 # PR gas/19109
 # Decide the default method for compressing debug sections.
 # Provide a configure time option to override our default.
diff --git a/configure.ac b/configure.ac
index ef30300af28..71b923d316f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -405,6 +405,20 @@ case "${ENABLE_LD}" in
     ;;
 esac
 
+AC_ARG_ENABLE(gprofng,
+[AS_HELP_STRING([[--enable-gprofng[=ARG]]],
+		[build gprofng @<:@ARG={yes,no}@:>@])],
+enable_gprofng=$enableval,
+enable_gprofng=yes)
+if test "$enable_gprofng" = "yes"; then
+  case "${target}" in
+    x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
+    configdirs="$configdirs gprofng"
+    ;;
+  esac
+fi
+
+
 # PR gas/19109
 # Decide the default method for compressing debug sections.
 # Provide a configure time option to override our default.
diff --git a/include/collectorAPI.h b/include/collectorAPI.h
new file mode 100644
index 00000000000..010074a271f
--- /dev/null
+++ b/include/collectorAPI.h
@@ -0,0 +1,73 @@
+/* Copyright (C) 2021-2023 Free Software Foundation, Inc.
+   Contributed by Oracle.
+
+   This file is part of GNU Binutils.
+
+   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, write to the Free Software
+   Foundation, 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#ifndef _COLLECTORAPI_H
+#define _COLLECTORAPI_H
+
+/* This file contains function prototypes for the user-callable API
+   routines in libcollector.  */
+
+#include <pthread.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+  /* Routine to record a sample in the experiment.  */
+  extern void collector_sample (const char *name);
+
+  /* Routine to suspend data collection during an experiment.  */
+  extern void collector_pause (void);
+
+  /* Routine to resume data collection during an experiment.  */
+  extern void collector_resume (void);
+
+  /* Routine to suspend per-thread data collection during an experiment.  */
+  extern void collector_thread_pause (pthread_t tid);
+
+  /* Routine to resume per-thread data collection during an experiment.  */
+  extern void collector_thread_resume (pthread_t tid);
+
+  /* Routine to close the experiment, and stop all data collection.  */
+  extern void  collector_terminate_expt (void);
+
+  typedef struct
+  {
+    unsigned int offset;
+    unsigned int lineno;
+  } Lineno;
+
+  /* Routines to let libcollector know about dynamically loaded functions.  */
+  extern void collector_func_load (const char *name, const char *alias,
+				   const char *sourcename, void *vaddr,
+				   int size, int lntsize, Lineno *lntable);
+
+  extern void collector_func_unload (void *vaddr);
+
+#ifdef NEED_COLLECTOR_MODULE
+  extern void collector_module_load (const char *modulename, void *vaddr);
+  extern void collector_module_unload (void *vaddr);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _COLLECTORAPI_H */
diff --git a/include/libcollector.h b/include/libcollector.h
new file mode 100644
index 00000000000..e1c2a440b2a
--- /dev/null
+++ b/include/libcollector.h
@@ -0,0 +1,89 @@
+/* Copyright (C) 2021-2023 Free Software Foundation, Inc.
+   Contributed by Oracle.
+
+   This file is part of GNU Binutils.
+
+   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, write to the Free Software
+   Foundation, 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#ifndef _LIBCOLLECTOR_H
+#define _LIBCOLLECTOR_H
+
+typedef struct
+{
+  unsigned int offset;
+  unsigned int lineno;
+} Lineno;
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+  /* This file contains function prototypes for the user-callable API
+     routines in libcollector for C and C++ codes.  */
+
+  /* Routine to record a sample in the experiment.  */
+  void collector_sample (char *name);
+
+  /* Routine to suspend data collection during an experiment.  */
+  void collector_pause (void);
+
+  /* Routine to resume data collection during an experiment.  */
+  void collector_resume (void);
+
+  /* Routine to suspend per-thread data collection during an experiment.  */
+  void collector_thread_pause (unsigned int tid);
+
+  /* Routine to resume per-thread data collection during an experiment.  */
+  void collector_thread_resume (unsigned int tid);
+
+  /* Routine to close the experiment, and stop all data collection.  */
+  void collector_terminate_expt (void);
+
+  /* Routines to let libcollector know about a dynamically loaded function.  */
+  void collector_func_load (char *name, char *alias, char *sourcename,
+			  void *vaddr, int size, int lntsize, Lineno *lntable);
+  void collector_func_unload (void *vaddr);
+
+  /* Define the weak symbols for the API.  */
+  void collector_sample () __attribute__ ((weak));
+  void collector_pause () __attribute__ ((weak));
+  void collector_resume () __attribute__ ((weak));
+  void collector_thread_pause () __attribute__ ((weak));
+  void collector_thread_resume () __attribute__ ((weak));
+  void collector_terminate_expt () __attribute__ ((weak));
+  void collector_func_load () __attribute__ ((weak));
+  void collector_func_unload () __attribute__ ((weak));
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Define the macros that actually get inserted in the caller's code.  */
+#define collector_sample(x)	(collector_sample ? collector_sample(x), 0 : 0)
+#define collector_pause()	(collector_pause ? collector_pause(), 0 : 0)
+#define collector_resume()	(collector_resume ? collector_resume(),0 : 0 
+#define collector_thread_pause(tid) \
+	(collector_thread_pause ? collector_thread_pause(tid), 0 : 0)
+#define collector_thread_resume(tid) \
+	(collector_thread_resume ? collector_thread_resume(tid), 0 : 0)
+#define collector_terminate_expt() \
+	(collector_terminate_expt ? collector_terminate_expt(), 0 : 0)
+#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \
+	collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6), 0 : 0)
+#define collector_func_unload(x) \
+	(collector_func_unload ? collector_func_unload(x), 0 : 0)
+#endif /* _LIBCOLLECTOR_H */
diff --git a/include/libfcollector.h b/include/libfcollector.h
new file mode 100644
index 00000000000..1dc6b144e6c
--- /dev/null
+++ b/include/libfcollector.h
@@ -0,0 +1,42 @@
+! Copyright (C) 2021-2023 Free Software Foundation, Inc.
+! Contributed by Oracle.
+!
+! This file is part of GNU Binutils.
+!
+! 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, write to the Free Software
+! Foundation, 51 Franklin Street - Fifth Floor, Boston,
+! MA 02110-1301, USA.
+!
+! Developer Sampling Collector interface include file
+
+        interface
+
+        ! Routine to record a sample in the experiment.
+        subroutine collector_sample(name)
+        character(len=*), intent(in) :: name
+        end subroutine
+
+        ! Routine to suspend data collection during an experiment.
+        subroutine collector_pause()
+        end subroutine
+
+        ! Routine to resume data collection during an experiment.
+        subroutine collector_resume()
+        end subroutine
+
+        ! Routine to stop all data collection and close the experiment.
+        subroutine collector_terminate_expt()
+        end subroutine
+
+        end interface
-- 
2.41.0


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

* [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (9 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 10/24] gprofng: a new GNU profiler Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:45   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile Arsen Arsenović
                   ` (13 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Luis Machado

From: Luis Machado <luis.machado@arm.com>

With a recent import of gnulib, code has been pulled that tests and enables
64-bit time_t by default on 32-bit hosts that support it.

Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
doesn't do these checks.

As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
have a mismatch between gdb's notion of time_t and bfd's notion of time_t.

This will lead to mismatches in the struct stat size, leading to memory
corruption and crashes.

This patch disables the year 2038 check for now, which makes things work
reliably again.

I'd consider this a temporary fix until we have proper bfd checks for the year
2038, if it makes sense.  64-bit hosts seems to be more common these days, so
I'm not sure how important it is to have this support enabled and how soon
we want to enable it.

Thoughts?

ChangeLog:

	* configure.ac: Disable year2038 by default on 32-bit hosts.
	* configure: Regenerate.
---
 configure    | 22 ++++++++++++++++++++++
 configure.ac | 18 ++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/configure b/configure
index 35c0c75ee12..faa1aedaa04 100755
--- a/configure
+++ b/configure
@@ -809,6 +809,7 @@ enable_ld
 enable_gprofng
 enable_compressed_debug_sections
 enable_default_compressed_debug_sections_algorithm
+enable_year2038
 enable_libquadmath
 enable_libquadmath_support
 enable_libada
@@ -1552,6 +1553,7 @@ Optional Features:
   --enable-default-compressed-debug-sections-algorithm={zlib,zstd}
                           Default compression algorithm for
                           --enable-compressed-debug-sections.
+  --enable-year2038       enable support for timestamps past the year 2038
   --disable-libquadmath   do not build libquadmath directory
   --disable-libquadmath-support
                           disable libquadmath support for Fortran
@@ -3194,6 +3196,20 @@ case "${host}" in
     ;;
 esac
 
+# Default to --disable-year2038 until we can handle differences between
+# projects that use gnulib (which understands year 2038) and projects that
+# do not (like BFD).
+# Check whether --enable-year2038 was given.
+if test "${enable_year2038+set}" = set; then :
+  enableval=$enable_year2038; ENABLE_YEAR2038=$enableval
+else
+  ENABLE_YEAR2038=no
+fi
+
+enable_year2038=
+if test "${ENABLE_YEAR2038}" = "no" ; then
+  enable_year2038=no
+fi
 
 # Check whether --enable-libquadmath was given.
 if test "${enable_libquadmath+set}" = set; then :
@@ -10215,9 +10231,15 @@ if test "$silent" = yes; then
   baseargs="$baseargs --silent"
   tbaseargs="$tbaseargs --silent"
 fi
+
 baseargs="$baseargs --disable-option-checking"
 tbaseargs="$tbaseargs --disable-option-checking"
 
+if test "$enable_year2038" = no; then
+  baseargs="$baseargs --disable-year2038"
+  tbaseargs="$tbaseargs --disable-year2038"
+fi
+
 # Record and document user additions to sub configure arguments.
 
 
diff --git a/configure.ac b/configure.ac
index 71b923d316f..a0dff0ecac8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -459,6 +459,18 @@ case "${host}" in
     ;;
 esac
 
+# Default to --disable-year2038 until we can handle differences between
+# projects that use gnulib (which understands year 2038) and projects that
+# do not (like BFD).
+AC_ARG_ENABLE(year2038,
+AS_HELP_STRING([--enable-year2038],
+  [enable support for timestamps past the year 2038]),
+ENABLE_YEAR2038=$enableval,
+ENABLE_YEAR2038=no)
+enable_year2038=
+if test "${ENABLE_YEAR2038}" = "no" ; then
+  enable_year2038=no
+fi
 
 AC_ARG_ENABLE(libquadmath,
 AS_HELP_STRING([--disable-libquadmath],
@@ -3339,9 +3351,15 @@ if test "$silent" = yes; then
   baseargs="$baseargs --silent"
   tbaseargs="$tbaseargs --silent"
 fi
+
 baseargs="$baseargs --disable-option-checking"
 tbaseargs="$tbaseargs --disable-option-checking"
 
+if test "$enable_year2038" = no; then
+  baseargs="$baseargs --disable-year2038"
+  tbaseargs="$tbaseargs --disable-year2038"
+fi
+
 # Record and document user additions to sub configure arguments.
 AC_ARG_VAR([build_configargs],
 	   [additional configure arguments for build directories])
-- 
2.41.0


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

* [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (10 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:47   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel Arsen Arsenović
                   ` (12 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

[Sending to binutils, gdb-patches and gcc-patches, since it touches the
top-level Makefile/configure]

I have my debuginfod library installed in a non-standard location
(/opt/debuginfod), which requires me to set
PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config.  If I just set it during
configure:

    $ PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config ./configure --with-debuginfod
    $ make

or

    $ ./configure --with-debuginfod PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config
    $ make

Then PKG_CONFIG_PATH is only present (and ignored) during the top-level
configure.  When running make (which runs gdb's and binutils'
configure), PKG_CONFIG_PATH is not set, which results in their configure
script not finding the library:

    checking for libdebuginfod >= 0.179... no
    configure: error: "--with-debuginfod was given, but libdebuginfod is missing or unusable."

Change the top-level configure/Makefile system to capture the value
passed when configuring the top-level and pass it down to
subdirectories (similar to CFLAGS, LDFLAGS, etc).

I don't know much about the top-level build system, so I really don't
know if I did this correctly.  The changes are:

 - Use AC_SUBST(PKG_CONFIG_PATH) in configure.ac, so that
   @PKG_CONFIG_PATH@ gets replaced with the actual PKG_CONFIG_PATH value
   in config files (i.e. Makefile)
 - Add a PKG_CONFIG_PATH Makefile variable in Makefile.tpl, initialized
   to @PKG_CONFIG_PATH@
 - Add PKG_CONFIG_PATH to HOST_EXPORTS in Makefile.tpl, which are the
   variables set when running the sub-configures

I initially added PKG_CONFIG_PATH to flags_to_pass, in Makefile.def, but
I don't think it's needed.  AFAIU, this defines the flags to pass down
when calling "make" in subdirectories.  We only need PKG_CONFIG_PATH to
be passed down during configure.  After that, it's captured in
gdb/config.status, so even if a "make" causes a re-configure later
(because gdb/configure has changed, for example), the PKG_CONFIG_PATH
value will be remembered.

Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf

ChangeLog:

	* configure.ac: Add AC_SUBST(PKG_CONFIG_PATH).
	* configure: Re-generate.
	* Makefile.tpl (HOST_EXPORTS): Pass PKG_CONFIG_PATH.
	(PKG_CONFIG_PATH): New.
	* Makefile.in: Re-generate.
---
 Makefile.in  | 3 +++
 Makefile.tpl | 3 +++
 configure    | 2 ++
 configure.ac | 1 +
 4 files changed, 9 insertions(+)

diff --git a/Makefile.in b/Makefile.in
index f177ce176fb..214a2a15544 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -221,6 +221,7 @@ HOST_EXPORTS = \
 	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
 	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
 	OTOOL="$(OTOOL)"; export OTOOL; \
+	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"; export PKG_CONFIG_PATH; \
 	READELF="$(READELF)"; export READELF; \
 	AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
 	AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
@@ -447,6 +448,8 @@ GOCFLAGS = $(CFLAGS)
 GDCFLAGS = @GDCFLAGS@
 GM2FLAGS = $(CFLAGS)
 
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+
 # Pass additional PGO and LTO compiler options to the PGO build.
 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
 override CFLAGS += $(BUILD_CFLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index 6586e907964..36fa20950d4 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -224,6 +224,7 @@ HOST_EXPORTS = \
 	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
 	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
 	OTOOL="$(OTOOL)"; export OTOOL; \
+	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"; export PKG_CONFIG_PATH; \
 	READELF="$(READELF)"; export READELF; \
 	AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
 	AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
@@ -450,6 +451,8 @@ GOCFLAGS = $(CFLAGS)
 GDCFLAGS = @GDCFLAGS@
 GM2FLAGS = $(CFLAGS)
 
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+
 # Pass additional PGO and LTO compiler options to the PGO build.
 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
 override CFLAGS += $(BUILD_CFLAGS)
diff --git a/configure b/configure
index faa1aedaa04..b6b7487f834 100755
--- a/configure
+++ b/configure
@@ -622,6 +622,7 @@ CXX_FOR_TARGET
 CC_FOR_TARGET
 RANLIB_PLUGIN_OPTION
 AR_PLUGIN_OPTION
+PKG_CONFIG_PATH
 GDCFLAGS
 READELF
 OTOOL
@@ -13017,6 +13018,7 @@ fi
 
 GDCFLAGS=${GDCFLAGS-${CFLAGS}}
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5
 $as_echo_n "checking for -plugin option... " >&6; }
 
diff --git a/configure.ac b/configure.ac
index a0dff0ecac8..39e5649f360 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3708,6 +3708,7 @@ AC_SUBST(CXXFLAGS)
 AC_SUBST(GDC)
 AC_SUBST(GDCFLAGS)
 GDCFLAGS=${GDCFLAGS-${CFLAGS}}
+AC_SUBST(PKG_CONFIG_PATH)
 
 GCC_PLUGIN_OPTION(PLUGIN_OPTION)
 AR_PLUGIN_OPTION=
-- 
2.41.0


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

* [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (11 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:50   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 14/24] libtool.m4: fix nm BSD flag detection Arsen Arsenović
                   ` (11 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arsen Arsenović

The Binutils still support this target.

ChangeLog:

	* configure.ac: Reinstate 32b PA-RISC HP-UX targets
	* configure: Regenerate.
---
 configure    | 10 ++++++++++
 configure.ac | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/configure b/configure
index b6b7487f834..907ebe71777 100755
--- a/configure
+++ b/configure
@@ -3572,6 +3572,11 @@ case "${target}" in
   hppa*64*-*-hpux*)
     noconfigdirs="$noconfigdirs target-libffi"
     ;;
+  hppa*-hp-hpux11*)
+    ;;
+  hppa*-*-hpux*)
+    noconfigdirs="$noconfigdirs target-libffi"
+    ;;
   ia64*-*-*vms*)
     noconfigdirs="$noconfigdirs target-libffi"
     ;;
@@ -3878,9 +3883,14 @@ case "${target}" in
   h8500-*-*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
+  hppa1.1-*-osf* | hppa1.1-*-bsd* )
+    ;;
   hppa*64*-*-hpux*)
     noconfigdirs="$noconfigdirs gdb"
     ;;
+  hppa*-*-hpux11*)
+    noconfigdirs="$noconfigdirs gdb ld"
+    ;;
   hppa*64*-*-linux*)
     ;;
   hppa*-*-linux*)
diff --git a/configure.ac b/configure.ac
index 39e5649f360..6a2e585a39a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -802,6 +802,11 @@ case "${target}" in
   hppa*64*-*-hpux*)
     noconfigdirs="$noconfigdirs target-libffi"
     ;;
+  hppa*-hp-hpux11*)
+    ;;
+  hppa*-*-hpux*)
+    noconfigdirs="$noconfigdirs target-libffi"
+    ;;
   ia64*-*-*vms*)
     noconfigdirs="$noconfigdirs target-libffi"
     ;;
@@ -1105,9 +1110,14 @@ case "${target}" in
   h8500-*-*)
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
+  hppa1.1-*-osf* | hppa1.1-*-bsd* )
+    ;;
   hppa*64*-*-hpux*)
     noconfigdirs="$noconfigdirs gdb"
     ;;
+  hppa*-*-hpux11*)
+    noconfigdirs="$noconfigdirs gdb ld"
+    ;;
   hppa*64*-*-linux*)
     ;;
   hppa*-*-linux*)
-- 
2.41.0


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

* [PATCH 14/24] libtool.m4: fix nm BSD flag detection
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (12 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 19:13   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case Arsen Arsenović
                   ` (10 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nick Alcock

From: Nick Alcock <nick.alcock@oracle.com>

Libtool needs to get BSD-format (or MS-format) output out of the system
nm, so that it can scan generated object files for symbol names for
-export-symbols-regex support.  Some nms need specific flags to turn on
BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
Unfortunately the code to do this has a pair of interlocking flaws:

 - it runs the test by doing an nm of /dev/null.  Some platforms
   reasonably refuse to do an nm on a device file, but before now this
   has only been worked around by assuming that the error message has a
   specific textual form emitted by Tru64 nm, and that getting this
   error means this is Tru64 nm and that nm -B would work to produce
   BSD-format output, even though the test never actually got anything
   but an error message out of nm -B.  This is fixable by nm'ing *nm
   itself* (since we necessarily have a path to it).

 - the test is entirely skipped if NM is set in the environment, on the
   grounds that the user has overridden the test: but the user cannot
   reasonably be expected to know that libtool wants not only nm but
   also flags forcing BSD-format output.  Worse yet, one such "user" is
   the top-level Cygnus configure script, which neither tests for
   nor specifies any BSD-format flags.  So platforms needing BSD-format
   flags always fail to set them when run in a Cygnus tree, breaking
   -export-symbols-regex on such platforms.  Libtool also needs to
   augment $LD on some platforms, but this is done unconditionally,
   augmenting whatever the user specified: the nm check should do the
   same.

   One wrinkle: if the user has overridden $NM, a path might have been
   provided: so we use the user-specified path if there was one, and
   otherwise do the path search as usual.  (If the nm specified doesn't
   work, this might lead to a few extra pointless path searches -- but
   the test is going to fail anyway, so that's not a problem.)

(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
*that* is a symlink to /usr/bin/nm.)

ChangeLog:

	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
	errors from nms that refuse to work on non-regular files.  Remove
	other workarounds for this problem.  Strip out blank lines from the
	nm output.

fixincludes/ChangeLog:

	* configure: Regenerate.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
---
 fixincludes/configure  |   3 +-
 gcc/configure          |  89 ++++++++++++++++++------------------
 libatomic/configure    |  89 ++++++++++++++++++------------------
 libbacktrace/configure |  89 ++++++++++++++++++------------------
 libcc1/configure       |  89 ++++++++++++++++++------------------
 libffi/configure       |  89 ++++++++++++++++++------------------
 libgfortran/configure  |  89 ++++++++++++++++++------------------
 libgm2/configure       |  89 ++++++++++++++++++------------------
 libgomp/configure      |  89 ++++++++++++++++++------------------
 libitm/configure       |  89 ++++++++++++++++++------------------
 libobjc/configure      |  89 ++++++++++++++++++------------------
 libphobos/configure    |  89 ++++++++++++++++++------------------
 libquadmath/configure  |  89 ++++++++++++++++++------------------
 libsanitizer/configure |  89 ++++++++++++++++++------------------
 libssp/configure       |  89 ++++++++++++++++++------------------
 libstdc++-v3/configure | 101 +++++++++++++++++++++--------------------
 libtool.m4             |  88 +++++++++++++++++------------------
 libvtv/configure       |  89 ++++++++++++++++++------------------
 lto-plugin/configure   |  89 ++++++++++++++++++------------------
 zlib/configure         |  89 ++++++++++++++++++------------------
 20 files changed, 863 insertions(+), 842 deletions(-)

diff --git a/fixincludes/configure b/fixincludes/configure
index f1748ebef74..b9770489adc 100755
--- a/fixincludes/configure
+++ b/fixincludes/configure
@@ -2941,7 +2941,8 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 # LT_PATH_NM
 # ----------
-# find the pathname to a BSD- or MS-compatible name lister
+# find the pathname to a BSD- or MS-compatible name lister, and any flags
+# needed to make it compatible
 # LT_PATH_NM
 
 # Old names:
diff --git a/gcc/configure b/gcc/configure
index 55cb24ef453..81b93c1b599 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -14136,48 +14136,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -19881,7 +19882,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19884 "configure"
+#line 19885 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19987,7 +19988,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19990 "configure"
+#line 19991 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libatomic/configure b/libatomic/configure
index 8e10b70d443..72bd9ae5814 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -5381,48 +5381,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11395,7 +11396,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11398 "configure"
+#line 11399 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11501,7 +11502,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11504 "configure"
+#line 11505 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libbacktrace/configure b/libbacktrace/configure
index d086b86a088..9264c2b1968 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -5826,48 +5826,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11572,7 +11573,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11575 "configure"
+#line 11576 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11678,7 +11679,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11681 "configure"
+#line 11682 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libcc1/configure b/libcc1/configure
index 84964de24de..1141b343096 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5087,48 +5087,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -10832,7 +10833,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10835 "configure"
+#line 10836 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10938,7 +10939,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10941 "configure"
+#line 10942 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libffi/configure b/libffi/configure
index a1824ceaeb3..0f34914d876 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -5613,48 +5613,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11627,7 +11628,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11630 "configure"
+#line 11631 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11733,7 +11734,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11736 "configure"
+#line 11737 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 425d1e32b39..2cd8cca82e2 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -7015,48 +7015,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12792,7 +12793,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12795 "configure"
+#line 12796 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12898,7 +12899,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12901 "configure"
+#line 12902 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgm2/configure b/libgm2/configure
index d3c3ab06ada..578f85cfc6a 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -6917,48 +6917,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12695,7 +12696,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12698 "configure"
+#line 12699 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12801,7 +12802,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12804 "configure"
+#line 12805 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgomp/configure b/libgomp/configure
index 49b43ba0967..5a31497cb3b 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -5395,48 +5395,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11409,7 +11410,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11412 "configure"
+#line 11413 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11515,7 +11516,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11518 "configure"
+#line 11519 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libitm/configure b/libitm/configure
index 6961eb879b3..2e552f48770 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -6056,48 +6056,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12071,7 +12072,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12074 "configure"
+#line 12075 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12177,7 +12178,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12180 "configure"
+#line 12181 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libobjc/configure b/libobjc/configure
index cbac20271cf..274f764f7de 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -4744,48 +4744,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -10827,7 +10828,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10830 "configure"
+#line 10831 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10933,7 +10934,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10936 "configure"
+#line 10937 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libphobos/configure b/libphobos/configure
index 7c453f58771..c1126404f28 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -6060,48 +6060,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11805,7 +11806,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11808 "configure"
+#line 11809 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11911,7 +11912,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11914 "configure"
+#line 11915 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libquadmath/configure b/libquadmath/configure
index 60844f38265..5e4632c557b 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -5082,48 +5082,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -10861,7 +10862,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10864 "configure"
+#line 10865 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10967,7 +10968,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10970 "configure"
+#line 10971 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libsanitizer/configure b/libsanitizer/configure
index 52c6677793e..9826fc3d7eb 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -6669,48 +6669,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12414,7 +12415,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12417 "configure"
+#line 12418 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12520,7 +12521,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12523 "configure"
+#line 12524 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libssp/configure b/libssp/configure
index fdf4e9d234d..9e2de53afa5 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -5268,48 +5268,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -11047,7 +11048,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11050 "configure"
+#line 11051 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11153,7 +11154,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11156 "configure"
+#line 11157 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index b280071391d..d029fa4284c 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -6322,48 +6322,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12218,7 +12219,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12221 "configure"
+#line 12222 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12324,7 +12325,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12327 "configure"
+#line 12328 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16048,7 +16049,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 16051 "configure"
+#line 16052 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -16083,7 +16084,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16086 "configure"
+#line 16087 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -16118,7 +16119,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16121 "configure"
+#line 16122 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -16154,7 +16155,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16157 "configure"
+#line 16158 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -16310,7 +16311,7 @@ $as_echo "mutex" >&6; }
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 16313 "configure"
+#line 16314 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -16352,7 +16353,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
   cat > conftest.$ac_ext << EOF
-#line 16355 "configure"
+#line 16356 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
diff --git a/libtool.m4 b/libtool.m4
index 7af548938ec..b827d21177d 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -3231,53 +3231,55 @@ _LT_DECL([], [file_magic_cmd], [1],
 
 # LT_PATH_NM
 # ----------
-# find the pathname to a BSD- or MS-compatible name lister
+# find the pathname to a BSD- or MS-compatible name lister, and any flags
+# needed to make it compatible
 AC_DEFUN([LT_PATH_NM],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}])
 if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
diff --git a/libvtv/configure b/libvtv/configure
index 33ca49e63c6..538b6d110b7 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -6564,48 +6564,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12309,7 +12310,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12312 "configure"
+#line 12313 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12415,7 +12416,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12418 "configure"
+#line 12419 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 69ccd66b038..fb4a736a1f8 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -6435,48 +6435,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -12181,7 +12182,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12184 "configure"
+#line 12185 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12287,7 +12288,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12290 "configure"
+#line 12291 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/zlib/configure b/zlib/configure
index 29eeb350429..88ca62f28da 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -4748,48 +4748,49 @@ if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
+   # Let the user override the nm to test.
+   lt_nm_to_check="$NM"
+ else
+   lt_nm_to_check="${ac_tool_prefix}nm"
+   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+     lt_nm_to_check="$lt_nm_to_check nm"
+   fi
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+     IFS="$lt_save_ifs"
+     test -z "$ac_dir" && ac_dir=.
+     case "$lt_tmp_nm" in
+     */*|*\\*) tmp_nm="$lt_tmp_nm";;
+     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
+     esac
+     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
+	 break
+	 ;;
+       *)
+	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 *$tmp_nm*)
+	   lt_cv_path_NM="$tmp_nm -p"
+	   break
+	   ;;
+	 *)
+	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	   continue # so that we can try to find one that supports BSD flags
+	   ;;
+	 esac
+	 ;;
+       esac
+     fi
+   done
+   IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
@@ -10794,7 +10795,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10797 "configure"
+#line 10798 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10900,7 +10901,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10903 "configure"
+#line 10904 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
-- 
2.41.0


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

* [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (13 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 14/24] libtool.m4: fix nm BSD flag detection Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 19:12   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 16/24] Add support for the haiku operating system Arsen Arsenović
                   ` (9 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nick Alcock

From: Nick Alcock <nick.alcock@oracle.com>

My previous nm patch handled all cases but one -- if the user set NM in
the environment to a path which contained an option, libtool's nm
detection tries to run nm against a copy of nm with the options in it:
e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the
test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle".
This is unlikely to be desirable: in this case we should run
"/usr/bin/nm --blargle /usr/bin/nm".

Furthermore, as part of this nm has to detect when the passed-in $NM
contains a path, and in that case avoid doing a path search itself.
This too was thrown off if an option contained something that looked
like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run
"nm -B../prev-gcc nm" which rarely works well (and indeed it looks
to see whether that nm exists, finds it doesn't, and wrongly concludes
that nm -p or whatever does not work).

Fix all of these by clipping all options (defined as everything
including and after the first " -") before deciding whether nm
contains a path (but not using the clipped value for anything else),
and then removing all options from the path-modified nm before
looking to see whether that nm existed.

NM=my-nm now does a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM=/usr/bin/my-nm now avoids a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM="my-nm -p../wombat" now does a path search and runs e.g.
  /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm

NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search:
  ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm

This seems to be all combinations, including those used by GCC bootstrap
(which, before this commit, fails to bootstrap when configured
--with-build-config=bootstrap-lto, because the lto plugin is now using
--export-symbols-regex, which requires libtool to find a working nm,
while also using -B../prev-gcc to point at the lto plugin associated
with the GCC just built.)

Regenerate all affected configure scripts.

ChangeLog:

	* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
	options, including options containing paths.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
---
 gcc/configure          | 20 +++++++++++++-------
 libatomic/configure    | 20 +++++++++++++-------
 libbacktrace/configure | 20 +++++++++++++-------
 libcc1/configure       | 20 +++++++++++++-------
 libffi/configure       | 20 +++++++++++++-------
 libgfortran/configure  | 20 +++++++++++++-------
 libgm2/configure       | 20 +++++++++++++-------
 libgomp/configure      | 20 +++++++++++++-------
 libitm/configure       | 20 +++++++++++++-------
 libobjc/configure      | 20 +++++++++++++-------
 libphobos/configure    | 20 +++++++++++++-------
 libquadmath/configure  | 20 +++++++++++++-------
 libsanitizer/configure | 20 +++++++++++++-------
 libssp/configure       | 20 +++++++++++++-------
 libstdc++-v3/configure | 32 +++++++++++++++++++-------------
 libtool.m4             | 16 +++++++++++-----
 libvtv/configure       | 20 +++++++++++++-------
 lto-plugin/configure   | 20 +++++++++++++-------
 zlib/configure         | 20 +++++++++++++-------
 19 files changed, 251 insertions(+), 137 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 81b93c1b599..c58a99f5d40 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -14144,25 +14144,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -19882,7 +19888,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19885 "configure"
+#line 19891 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19988,7 +19994,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19991 "configure"
+#line 19997 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libatomic/configure b/libatomic/configure
index 72bd9ae5814..648f0dd7e52 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -5389,25 +5389,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11396,7 +11402,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11399 "configure"
+#line 11405 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11502,7 +11508,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11505 "configure"
+#line 11511 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libbacktrace/configure b/libbacktrace/configure
index 9264c2b1968..73611a3b994 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -5834,25 +5834,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11573,7 +11579,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11576 "configure"
+#line 11582 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11679,7 +11685,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11682 "configure"
+#line 11688 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libcc1/configure b/libcc1/configure
index 1141b343096..db9f6d6852d 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -5095,25 +5095,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -10833,7 +10839,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10836 "configure"
+#line 10842 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10939,7 +10945,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10942 "configure"
+#line 10948 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libffi/configure b/libffi/configure
index 0f34914d876..d8f58eae0a0 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -5621,25 +5621,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11628,7 +11634,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11631 "configure"
+#line 11637 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11734,7 +11740,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11737 "configure"
+#line 11743 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgfortran/configure b/libgfortran/configure
index 2cd8cca82e2..27434bf4ec6 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -7023,25 +7023,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12793,7 +12799,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12796 "configure"
+#line 12802 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12899,7 +12905,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12902 "configure"
+#line 12908 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgm2/configure b/libgm2/configure
index 578f85cfc6a..bfc613dc19a 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -6925,25 +6925,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12696,7 +12702,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12699 "configure"
+#line 12705 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12802,7 +12808,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12805 "configure"
+#line 12811 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgomp/configure b/libgomp/configure
index 5a31497cb3b..75c438eaccc 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -5403,25 +5403,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11410,7 +11416,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11413 "configure"
+#line 11419 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11516,7 +11522,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11519 "configure"
+#line 11525 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libitm/configure b/libitm/configure
index 2e552f48770..8e919417896 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -6064,25 +6064,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12072,7 +12078,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12075 "configure"
+#line 12081 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12178,7 +12184,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12181 "configure"
+#line 12187 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libobjc/configure b/libobjc/configure
index 274f764f7de..2598099aa97 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -4752,25 +4752,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -10828,7 +10834,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10831 "configure"
+#line 10837 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10934,7 +10940,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10937 "configure"
+#line 10943 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libphobos/configure b/libphobos/configure
index c1126404f28..7d3c062e97a 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -6068,25 +6068,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11806,7 +11812,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11809 "configure"
+#line 11815 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11912,7 +11918,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11915 "configure"
+#line 11921 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libquadmath/configure b/libquadmath/configure
index 5e4632c557b..bd0545a164a 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -5090,25 +5090,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -10862,7 +10868,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10865 "configure"
+#line 10871 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10968,7 +10974,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10971 "configure"
+#line 10977 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libsanitizer/configure b/libsanitizer/configure
index 9826fc3d7eb..88f1a3ebfdf 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -6677,25 +6677,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12415,7 +12421,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12418 "configure"
+#line 12424 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12521,7 +12527,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12524 "configure"
+#line 12530 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libssp/configure b/libssp/configure
index 9e2de53afa5..ab356df0ea8 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -5276,25 +5276,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -11048,7 +11054,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11051 "configure"
+#line 11057 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11154,7 +11160,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11157 "configure"
+#line 11163 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index d029fa4284c..634f8595185 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -6330,25 +6330,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12219,7 +12225,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12222 "configure"
+#line 12228 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12325,7 +12331,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12328 "configure"
+#line 12334 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16049,7 +16055,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
   # Fake what AC_TRY_COMPILE does.
 
     cat > conftest.$ac_ext << EOF
-#line 16052 "configure"
+#line 16058 "configure"
 int main()
 {
   typedef bool atomic_type;
@@ -16084,7 +16090,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16087 "configure"
+#line 16093 "configure"
 int main()
 {
   typedef short atomic_type;
@@ -16119,7 +16125,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16122 "configure"
+#line 16128 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
@@ -16155,7 +16161,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
     rm -f conftest*
 
     cat > conftest.$ac_ext << EOF
-#line 16158 "configure"
+#line 16164 "configure"
 int main()
 {
   typedef long long atomic_type;
@@ -16311,7 +16317,7 @@ $as_echo "mutex" >&6; }
   # unnecessary for this test.
 
     cat > conftest.$ac_ext << EOF
-#line 16314 "configure"
+#line 16320 "configure"
 int main()
 {
   _Decimal32 d1;
@@ -16353,7 +16359,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   # unnecessary for this test.
 
   cat > conftest.$ac_ext << EOF
-#line 16356 "configure"
+#line 16362 "configure"
 template<typename T1, typename T2>
   struct same
   { typedef T2 type; };
diff --git a/libtool.m4 b/libtool.m4
index b827d21177d..79f9a7f3957 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -3245,25 +3245,31 @@ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
diff --git a/libvtv/configure b/libvtv/configure
index 538b6d110b7..03656cba8e7 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -6572,25 +6572,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12310,7 +12316,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12313 "configure"
+#line 12319 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12416,7 +12422,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12419 "configure"
+#line 12425 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/lto-plugin/configure b/lto-plugin/configure
index fb4a736a1f8..34891ebb7f2 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -6443,25 +6443,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -12182,7 +12188,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12185 "configure"
+#line 12191 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12288,7 +12294,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12291 "configure"
+#line 12297 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/zlib/configure b/zlib/configure
index 88ca62f28da..db58625c89a 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -4756,25 +4756,31 @@ else
      lt_nm_to_check="$lt_nm_to_check nm"
    fi
  fi
- for lt_tmp_nm in $lt_nm_to_check; do
+ for lt_tmp_nm in "$lt_nm_to_check"; do
    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
      IFS="$lt_save_ifs"
      test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
+     # Strip out any user-provided options from the nm to test twice,
+     # the first time to test to see if nm (rather than its options) has
+     # an explicit path, the second time to yield a file which can be
+     # nm'ed itself.
+     tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
+     case "$tmp_nm_path" in
      */*|*\\*) tmp_nm="$lt_tmp_nm";;
      *) tmp_nm="$ac_dir/$lt_tmp_nm";;
      esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+     tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
+     if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
        # Check to see if the nm accepts a BSD-compat flag.
        # Adding the `sed 1q' prevents false positives on HP-UX, which says:
        #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+       case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
        *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
 	 break
 	 ;;
        *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
+	 case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
 	 *$tmp_nm*)
 	   lt_cv_path_NM="$tmp_nm -p"
 	   break
@@ -10795,7 +10801,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10798 "configure"
+#line 10804 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10901,7 +10907,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10904 "configure"
+#line 10910 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
-- 
2.41.0


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

* [PATCH 16/24] Add support for the haiku operating system
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (14 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:51   ` Jeff Law
  2023-08-07 10:32 ` [PATCH 17/24] egrep in binutils Arsen Arsenović
                   ` (8 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alexander von Gluck IV

From: Alexander von Gluck IV <kallisti5@unixzen.com>

These are the os support patches we have been grooming and maintaining
for quite a few years over on git.haiku-os.org.  All of these
architectures are working and most have been stable for quite some time.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add Haiku to list of ELF OSes
	* libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
---
 configure              | 2 +-
 configure.ac           | 2 +-
 gcc/configure          | 4 ++--
 libatomic/configure    | 2 +-
 libbacktrace/configure | 2 +-
 libcc1/configure       | 4 ++--
 libffi/configure       | 4 ++--
 libgfortran/configure  | 4 ++--
 libgm2/configure       | 4 ++--
 libgomp/configure      | 4 ++--
 libitm/configure       | 4 ++--
 libobjc/configure      | 2 +-
 libphobos/configure    | 2 +-
 libquadmath/configure  | 2 +-
 libsanitizer/configure | 4 ++--
 libssp/configure       | 2 +-
 libstdc++-v3/configure | 4 ++--
 libtool.m4             | 2 +-
 libvtv/configure       | 4 ++--
 lto-plugin/configure   | 2 +-
 zlib/configure         | 2 +-
 21 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/configure b/configure
index 907ebe71777..28f0913bdd4 100755
--- a/configure
+++ b/configure
@@ -3077,7 +3077,7 @@ case "${ENABLE_GOLD}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
       | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
-      | *-*-solaris2* | *-*-nto* | *-*-nacl*)
+      | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-haiku*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
diff --git a/configure.ac b/configure.ac
index 6a2e585a39a..5d25dc864c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,7 +349,7 @@ case "${ENABLE_GOLD}" in
       *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
       | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
       | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
-      | *-*-solaris2* | *-*-nto* | *-*-nacl*)
+      | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-haiku*)
         case "${target}" in
           *-*-linux*aout* | *-*-linux*oldld*)
             ;;
diff --git a/gcc/configure b/gcc/configure
index c58a99f5d40..e97433d8743 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -19068,7 +19068,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -22743,7 +22743,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libatomic/configure b/libatomic/configure
index 648f0dd7e52..75096735c61 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -10582,7 +10582,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libbacktrace/configure b/libbacktrace/configure
index 73611a3b994..f3ef3fc3f23 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -10759,7 +10759,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libcc1/configure b/libcc1/configure
index db9f6d6852d..edf03334f30 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -10019,7 +10019,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -14100,7 +14100,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libffi/configure b/libffi/configure
index d8f58eae0a0..a1ded4f617b 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -10814,7 +10814,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -14489,7 +14489,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libgfortran/configure b/libgfortran/configure
index 27434bf4ec6..7b408515498 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -11961,7 +11961,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15750,7 +15750,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libgm2/configure b/libgm2/configure
index bfc613dc19a..2d54302129c 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -11864,7 +11864,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15563,7 +15563,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libgomp/configure b/libgomp/configure
index 75c438eaccc..6d4b6e3850e 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -10596,7 +10596,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -14266,7 +14266,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libitm/configure b/libitm/configure
index 8e919417896..83ff24b73e8 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -11258,7 +11258,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -14933,7 +14933,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libobjc/configure b/libobjc/configure
index 2598099aa97..fd590e628ab 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -9996,7 +9996,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libphobos/configure b/libphobos/configure
index 7d3c062e97a..814cacc1120 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -10992,7 +10992,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libquadmath/configure b/libquadmath/configure
index bd0545a164a..3ddaa5159d9 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -10030,7 +10030,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libsanitizer/configure b/libsanitizer/configure
index 88f1a3ebfdf..82c4cf531de 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -11601,7 +11601,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15276,7 +15276,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libssp/configure b/libssp/configure
index ab356df0ea8..413f10fa6a2 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -10216,7 +10216,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 634f8595185..7a10779b9ff 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -11387,7 +11387,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15086,7 +15086,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libtool.m4 b/libtool.m4
index 79f9a7f3957..027d03c4cf1 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -2364,7 +2364,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/libvtv/configure b/libvtv/configure
index 03656cba8e7..55d4b698cee 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -11496,7 +11496,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -15171,7 +15171,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 34891ebb7f2..5473d138d23 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -11368,7 +11368,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
diff --git a/zlib/configure b/zlib/configure
index db58625c89a..e224f1c8220 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -9963,7 +9963,7 @@ haiku*)
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
-- 
2.41.0


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

* [PATCH 17/24] egrep in binutils
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (15 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 16/24] Add support for the haiku operating system Arsen Arsenović
@ 2023-08-07 10:32 ` Arsen Arsenović
  2023-08-07 17:52   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 18/24] PR27116, Spelling errors found by Debian style checker Arsen Arsenović
                   ` (7 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alan Modra

From: Alan Modra <amodra@gmail.com>

Apparently some distros have a nagging egrep that helpfully tells you
egrep is deprecated and to use "grep -E".  The nag message causes a ld
testsuite failure.  What's more the advice isn't that good.  The "-E"
flag may not be available with older versions of grep.

This patch fixes bare invocation of egrep within binutils, replacing
it with the autoconf $EGREP or with grep.

config/ChangeLog:

	* lib-ld.m4 (AC_LIB_PROG_LD_GNU): Require AC_PROG_EGREP and
	invoke $EGREP.
	(AC_LIB_PROG_LD): Likewise.

gcc/ChangeLog:

	* configure: Regenerate.

intl/ChangeLog:

	* configure: Regenerate.

libcpp/ChangeLog:

	* configure: Regenerate.

libgcc/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
---
 config/lib-ld.m4       | 8 +++++---
 gcc/configure          | 4 ++--
 intl/configure         | 4 ++--
 libcpp/configure       | 4 ++--
 libgcc/configure       | 2 +-
 libstdc++-v3/configure | 4 ++--
 6 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/config/lib-ld.m4 b/config/lib-ld.m4
index 11d0ce77342..73cf9571b57 100644
--- a/config/lib-ld.m4
+++ b/config/lib-ld.m4
@@ -12,9 +12,10 @@ dnl with libtool.m4.
 
 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
@@ -29,6 +30,7 @@ AC_DEFUN([AC_LIB_PROG_LD],
 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_EGREP])dnl
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
@@ -88,7 +90,7 @@ AC_CACHE_VAL(acl_cv_path_LD,
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
diff --git a/gcc/configure b/gcc/configure
index e97433d8743..cd9919e858d 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -11299,7 +11299,7 @@ else
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
@@ -11327,7 +11327,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
diff --git a/intl/configure b/intl/configure
index 79bb5831a47..42b2a26b5bf 100755
--- a/intl/configure
+++ b/intl/configure
@@ -5094,7 +5094,7 @@ else
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
@@ -5122,7 +5122,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
diff --git a/libcpp/configure b/libcpp/configure
index 1389ddab544..ed98f40a1c1 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -6811,7 +6811,7 @@ else
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
@@ -6839,7 +6839,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
diff --git a/libgcc/configure b/libgcc/configure
index be5d45f1755..1e727367ba3 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5032,7 +5032,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 7a10779b9ff..a545a5178dd 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -29124,7 +29124,7 @@ else
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | $EGREP '(GNU|with BFD)' > /dev/null; then
 	test "$with_gnu_ld" != no && break
       else
 	test "$with_gnu_ld" != yes && break
@@ -29152,7 +29152,7 @@ if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+if $LD -v 2>&1 </dev/null | $EGREP '(GNU|with BFD)' 1>&5; then
   acl_cv_prog_gnu_ld=yes
 else
   acl_cv_prog_gnu_ld=no
-- 
2.41.0


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

* [PATCH 18/24] PR27116, Spelling errors found by Debian style checker
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (16 preceding siblings ...)
  2023-08-07 10:32 ` [PATCH 17/24] egrep in binutils Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 17:52   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 19/24] Deprecate a.out support for NetBSD targets Arsen Arsenović
                   ` (6 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Alan Modra

From: Alan Modra <amodra@gmail.com>

config/ChangeLog:

	* override.m4: Correct comment grammar.
---
 config/override.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/override.m4 b/config/override.m4
index d3e815bb1b4..5a1bffe6018 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -32,7 +32,7 @@ m4_ifndef([_GCC_AUTOCONF_VERSION],
   [m4_define([_GCC_AUTOCONF_VERSION], [2.69])])
 
 dnl Test for the exact version when AC_INIT is expanded.
-dnl This allows to update the tree in steps (for testing)
+dnl This allows one to update the tree in steps (for testing)
 dnl by putting
 dnl   m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
 dnl in configure.ac before AC_INIT,
-- 
2.41.0


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

* [PATCH 19/24] Deprecate a.out support for NetBSD targets.
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (17 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 18/24] PR27116, Spelling errors found by Debian style checker Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 18:01   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works Arsen Arsenović
                   ` (5 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: John Ericson

From: John Ericson <git@JohnEricson.me>

As discussed previously, a.out support is now quite deprecated, and in
some cases removed, in both Binutils itself and NetBSD, so this legacy
default makes little sense. `netbsdelf*` and `netbsdaout*` still work
allowing the user to be explicit about there choice. Additionally, the
configure script warns about the change as Nick Clifton requested.

One possible concern was the status of NetBSD on NS32K, where only a.out
was supported. But per [1] NetBSD has removed support, and if it were to
come back, it would be with ELF. The binutils implementation is
therefore marked obsolete, per the instructions in the last message.

With that patch and this one applied, I have confirmed the following:

--target=i686-unknown-netbsd
--target=i686-unknown-netbsdelf
  builds completely

--target=i686-unknown-netbsdaout
  properly fails because target is deprecated.

--target=vax-unknown-netbsdaout builds completely except for gas, where
the target is deprecated.

[1]: https://mail-index.netbsd.org/tech-toolchain/2021/07/19/msg004025.html

config/ChangeLog:

	* picflag.m4: Simplify SHmedia NetBSD match by presuming ELF.

gcc/ChangeLog:

	* configure: Regenerate.

libada/ChangeLog:

	* configure: Regenerate.

libgcc/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.
---
 config/picflag.m4   | 4 +---
 gcc/configure       | 8 +++-----
 libada/configure    | 4 +---
 libgcc/configure    | 4 +---
 libiberty/configure | 4 +---
 5 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/config/picflag.m4 b/config/picflag.m4
index 0aefcf619bf..3f3ac744c96 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -63,9 +63,7 @@ case "${$2}" in
     sh-*-linux* | sh[[2346lbe]]*-*-linux*)
 	$1=-fpic
 	;;
-    # FIXME: Simplify to sh*-*-netbsd*?
-    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-      sh64-*-netbsd* | sh64l*-*-netbsd*)
+    sh*-*-netbsd*)
 	$1=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
diff --git a/gcc/configure b/gcc/configure
index cd9919e858d..e5e95e7c1c8 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -5480,9 +5480,7 @@ case "${target}" in
     sh-*-linux* | sh[2346lbe]*-*-linux*)
 	PICFLAG_FOR_TARGET=-fpic
 	;;
-    # FIXME: Simplify to sh*-*-netbsd*?
-    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-      sh64-*-netbsd* | sh64l*-*-netbsd*)
+    sh*-*-netbsd*)
 	PICFLAG_FOR_TARGET=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
@@ -19888,7 +19886,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19891 "configure"
+#line 19889 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19994,7 +19992,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19997 "configure"
+#line 19995 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libada/configure b/libada/configure
index 9c8b133d817..ac4dad3ad3b 100755
--- a/libada/configure
+++ b/libada/configure
@@ -3231,9 +3231,7 @@ case "${host}" in
     sh-*-linux* | sh[2346lbe]*-*-linux*)
 	PICFLAG=-fpic
 	;;
-    # FIXME: Simplify to sh*-*-netbsd*?
-    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-      sh64-*-netbsd* | sh64l*-*-netbsd*)
+    sh*-*-netbsd*)
 	PICFLAG=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
diff --git a/libgcc/configure b/libgcc/configure
index 1e727367ba3..cf149209652 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -2422,9 +2422,7 @@ case "${host}" in
     sh-*-linux* | sh[2346lbe]*-*-linux*)
 	PICFLAG=-fpic
 	;;
-    # FIXME: Simplify to sh*-*-netbsd*?
-    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-      sh64-*-netbsd* | sh64l*-*-netbsd*)
+    sh*-*-netbsd*)
 	PICFLAG=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
diff --git a/libiberty/configure b/libiberty/configure
index bdc860f1623..dd896270dc6 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -5368,9 +5368,7 @@ case "${host}" in
     sh-*-linux* | sh[2346lbe]*-*-linux*)
 	PICFLAG=-fpic
 	;;
-    # FIXME: Simplify to sh*-*-netbsd*?
-    sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-      sh64-*-netbsd* | sh64l*-*-netbsd*)
+    sh*-*-netbsd*)
 	PICFLAG=-fpic
 	;;
     # Default to -fPIC unless specified otherwise.
-- 
2.41.0


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

* [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (18 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 19/24] Deprecate a.out support for NetBSD targets Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 17:54   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 21/24] PKG_CHECK_MODULES: Properly check " Arsen Arsenović
                   ` (4 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: H.J. Lu

From: "H.J. Lu" <hjl.tools@gmail.com>

It is quite normal to have headers without library on multilib OSes.
Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
works.

config/ChangeLog:

	* pkg.m4 (PKG_CHECK_MODULES): Add AC_TRY_LINK to check if
	$pkg_cv_[]$1[]_LIBS works.
---
 config/pkg.m4 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/config/pkg.m4 b/config/pkg.m4
index 13a88901786..45587e97c8b 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -147,6 +147,12 @@ AC_MSG_CHECKING([for $2])
 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
+dnl Check whether $pkg_cv_[]$1[]_LIBS works.
+pkg_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
+AC_TRY_LINK([],[return 0;], [pkg_failed=no], [pkg_failed=yes])
+LDFLAGS=$pkg_save_LDFLAGS
+
 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 and $1[]_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.])
-- 
2.41.0


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

* [PATCH 21/24] PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (19 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 17:54   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 22/24] libtool.m4: augment symcode for Solaris 11 Arsen Arsenović
                   ` (3 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: H.J. Lu

From: "H.J. Lu" <hjl.tools@gmail.com>

There is no need to check $pkg_cv_[]$1[]_LIBS works if package check
failed.

config/ChangeLog:

	* pkg.m4 (PKG_CHECK_MODULES): Use AC_TRY_LINK only if
	$pkg_failed = no.
---
 config/pkg.m4 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/config/pkg.m4 b/config/pkg.m4
index 45587e97c8b..7ebf517cd6a 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -148,10 +148,12 @@ _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
 dnl Check whether $pkg_cv_[]$1[]_LIBS works.
-pkg_save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
-AC_TRY_LINK([],[return 0;], [pkg_failed=no], [pkg_failed=yes])
-LDFLAGS=$pkg_save_LDFLAGS
+if test $pkg_failed = no; then
+  pkg_save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
+  AC_TRY_LINK([],[], [], [pkg_failed=yes])
+  LDFLAGS=$pkg_save_LDFLAGS
+fi
 
 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 and $1[]_LIBS to avoid the need to call pkg-config.
-- 
2.41.0


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

* [PATCH 22/24] libtool.m4: augment symcode for Solaris 11
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (20 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 21/24] PKG_CHECK_MODULES: Properly check " Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 18:01   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 23/24] bfd: linker: merge .sframe sections Arsen Arsenović
                   ` (2 subsequent siblings)
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nick Alcock

From: Nick Alcock <nick.alcock@oracle.com>

This reports common symbols like GNU nm, via a type code of 'C'.

ChangeLog:

	* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
	Solaris 11.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
---
 gcc/configure          | 2 +-
 libatomic/configure    | 2 +-
 libbacktrace/configure | 2 +-
 libcc1/configure       | 2 +-
 libffi/configure       | 2 +-
 libgfortran/configure  | 2 +-
 libgm2/configure       | 2 +-
 libgomp/configure      | 2 +-
 libitm/configure       | 2 +-
 libobjc/configure      | 2 +-
 libphobos/configure    | 2 +-
 libquadmath/configure  | 2 +-
 libsanitizer/configure | 2 +-
 libssp/configure       | 2 +-
 libstdc++-v3/configure | 2 +-
 libtool.m4             | 2 +-
 libvtv/configure       | 2 +-
 lto-plugin/configure   | 2 +-
 zlib/configure         | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index e5e95e7c1c8..ea1ad6606a6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -15346,7 +15346,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libatomic/configure b/libatomic/configure
index 75096735c61..57f320753e1 100755
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -6593,7 +6593,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libbacktrace/configure b/libbacktrace/configure
index f3ef3fc3f23..c3e7b884e36 100755
--- a/libbacktrace/configure
+++ b/libbacktrace/configure
@@ -7038,7 +7038,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libcc1/configure b/libcc1/configure
index edf03334f30..1a63a0e4e1a 100755
--- a/libcc1/configure
+++ b/libcc1/configure
@@ -6299,7 +6299,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libffi/configure b/libffi/configure
index a1ded4f617b..9eac9c907bf 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -6825,7 +6825,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libgfortran/configure b/libgfortran/configure
index 7b408515498..cd176b04a14 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -8227,7 +8227,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libgm2/configure b/libgm2/configure
index 2d54302129c..f576681098f 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -8129,7 +8129,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libgomp/configure b/libgomp/configure
index 6d4b6e3850e..a12b30f1b0f 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -6607,7 +6607,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libitm/configure b/libitm/configure
index 83ff24b73e8..02e8de7896b 100755
--- a/libitm/configure
+++ b/libitm/configure
@@ -7268,7 +7268,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libobjc/configure b/libobjc/configure
index fd590e628ab..752f6fdfebd 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -5995,7 +5995,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libphobos/configure b/libphobos/configure
index 814cacc1120..b7276d95010 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -7272,7 +7272,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libquadmath/configure b/libquadmath/configure
index 3ddaa5159d9..0b145a644c3 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -6294,7 +6294,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libsanitizer/configure b/libsanitizer/configure
index 82c4cf531de..0805d254fe5 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -7881,7 +7881,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libssp/configure b/libssp/configure
index 413f10fa6a2..7f8b8fdf99d 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -6480,7 +6480,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index a545a5178dd..c4da56c3042 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -7523,7 +7523,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/libtool.m4 b/libtool.m4
index 027d03c4cf1..e36fdd3c0e2 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -3434,7 +3434,7 @@ osf*)
   symcode='[[BCDEGQRST]]'
   ;;
 solaris*)
-  symcode='[[BDRT]]'
+  symcode='[[BCDRT]]'
   ;;
 sco3.2v5*)
   symcode='[[DT]]'
diff --git a/libvtv/configure b/libvtv/configure
index 55d4b698cee..917557103e9 100755
--- a/libvtv/configure
+++ b/libvtv/configure
@@ -7776,7 +7776,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/lto-plugin/configure b/lto-plugin/configure
index 5473d138d23..37c44d04a0d 100755
--- a/lto-plugin/configure
+++ b/lto-plugin/configure
@@ -7647,7 +7647,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
diff --git a/zlib/configure b/zlib/configure
index e224f1c8220..273ac36647d 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -5960,7 +5960,7 @@ osf*)
   symcode='[BCDEGQRST]'
   ;;
 solaris*)
-  symcode='[BDRT]'
+  symcode='[BCDRT]'
   ;;
 sco3.2v5*)
   symcode='[DT]'
-- 
2.41.0


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

* [PATCH 23/24] bfd: linker: merge .sframe sections
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (21 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 22/24] libtool.m4: augment symcode for Solaris 11 Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 17:59   ` Jeff Law
  2023-08-07 10:33 ` [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe Arsen Arsenović
  2023-08-07 19:54 ` [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Eric Gallager
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Indu Bhagat

From: Indu Bhagat <indu.bhagat@oracle.com>

The linker merges all the input .sframe sections.  When merging, the
linker verifies that all the input .sframe sections have the same
abi/arch.

The linker uses libsframe library to perform key actions on the
.sframe sections - decode, read, and create output data.  This
implies buildsystem changes to make and install libsframe before
libbfd.

The linker places the output .sframe section in a new segment of its
own: PT_GNU_SFRAME.  A new segment is not added, however, if the
generated .sframe section is empty.

When a section is discarded from the final link, the corresponding
entries in the .sframe section for those functions are also deleted.

The linker sorts the SFrame FDEs on start address by default and sets
the SFRAME_F_FDE_SORTED flag in the .sframe section.

This patch also adds support for generation of SFrame unwind
information for the .plt* sections on x86_64.  SFrame unwind info is
generated for IBT enabled PLT, lazy/non-lazy PLT.

The existing linker option --no-ld-generated-unwind-info has been
adapted to include the control of whether .sframe unwind information
will be generated for the linker generated sections like PLT.

Changes to the linker script have been made as necessary.

ChangeLog:

	* Makefile.def: Add install dependency on libsframe for libbfd.
	* Makefile.in: Regenerated.
---
 Makefile.def |  4 ++++
 Makefile.in  | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Makefile.def b/Makefile.def
index 86d25f43762..0c6784b6da1 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -459,11 +459,14 @@ dependencies = { module=all-gdbsupport; on=all-gnulib; };
 dependencies = { module=all-gdbsupport; on=all-intl; };
 
 // Host modules specific to binutils.
+// build libsframe before bfd for encoder/decoder support for linking
+// SFrame sections
 dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
 dependencies = { module=configure-bfd; on=configure-intl; };
 dependencies = { module=all-bfd; on=all-libiberty; };
 dependencies = { module=all-bfd; on=all-intl; };
 dependencies = { module=all-bfd; on=all-zlib; };
+dependencies = { module=all-bfd; on=all-libsframe; };
 dependencies = { module=configure-opcodes; on=configure-libiberty; hard=true; };
 dependencies = { module=all-opcodes; on=all-libiberty; };
 
@@ -489,6 +492,7 @@ dependencies = { module=install-binutils; on=install-opcodes; };
 dependencies = { module=install-strip-binutils; on=install-strip-opcodes; };
 
 // Likewise for ld, libctf, and bfd.
+dependencies = { module=install-bfd; on=install-libsframe; };
 dependencies = { module=install-libctf; on=install-bfd; };
 dependencies = { module=install-ld; on=install-bfd; };
 dependencies = { module=install-ld; on=install-libctf; };
diff --git a/Makefile.in b/Makefile.in
index 214a2a15544..35a5d8c575d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -66354,6 +66354,16 @@ all-stagetrain-bfd: maybe-all-stagetrain-zlib
 all-stagefeedback-bfd: maybe-all-stagefeedback-zlib
 all-stageautoprofile-bfd: maybe-all-stageautoprofile-zlib
 all-stageautofeedback-bfd: maybe-all-stageautofeedback-zlib
+all-bfd: maybe-all-libsframe
+all-stage1-bfd: maybe-all-stage1-libsframe
+all-stage2-bfd: maybe-all-stage2-libsframe
+all-stage3-bfd: maybe-all-stage3-libsframe
+all-stage4-bfd: maybe-all-stage4-libsframe
+all-stageprofile-bfd: maybe-all-stageprofile-libsframe
+all-stagetrain-bfd: maybe-all-stagetrain-libsframe
+all-stagefeedback-bfd: maybe-all-stagefeedback-libsframe
+all-stageautoprofile-bfd: maybe-all-stageautoprofile-libsframe
+all-stageautofeedback-bfd: maybe-all-stageautofeedback-libsframe
 configure-opcodes: configure-libiberty
 configure-stage1-opcodes: configure-stage1-libiberty
 configure-stage2-opcodes: configure-stage2-libiberty
@@ -66486,6 +66496,7 @@ all-stageautoprofile-binutils: maybe-all-stageautoprofile-libsframe
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe
 install-binutils: maybe-install-opcodes
 install-strip-binutils: maybe-install-strip-opcodes
+install-bfd: maybe-install-libsframe
 install-libctf: maybe-install-bfd
 install-ld: maybe-install-bfd
 install-ld: maybe-install-libctf
-- 
2.41.0


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

* [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (22 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 23/24] bfd: linker: merge .sframe sections Arsen Arsenović
@ 2023-08-07 10:33 ` Arsen Arsenović
  2023-08-07 18:00   ` Jeff Law
  2023-08-07 19:54 ` [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Eric Gallager
  24 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 10:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Indu Bhagat

From: Indu Bhagat <indu.bhagat@oracle.com>

As noted in PR libsframe/30014 - FTBFS: install-strip fails because
bfdlib relinks and fails to find libsframe, the install time
dependencies of libbfd need to be updated.

ChangeLog:

	* Makefile.def: Reflect that libsframe needs to installed before
	libbfd.  Reorder a bit to better track libsframe dependencies.
	* Makefile.in: Regenerate.
---
 Makefile.def | 5 ++++-
 Makefile.in  | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 0c6784b6da1..870150183b9 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -492,7 +492,6 @@ dependencies = { module=install-binutils; on=install-opcodes; };
 dependencies = { module=install-strip-binutils; on=install-strip-opcodes; };
 
 // Likewise for ld, libctf, and bfd.
-dependencies = { module=install-bfd; on=install-libsframe; };
 dependencies = { module=install-libctf; on=install-bfd; };
 dependencies = { module=install-ld; on=install-bfd; };
 dependencies = { module=install-ld; on=install-libctf; };
@@ -500,6 +499,10 @@ dependencies = { module=install-strip-libctf; on=install-strip-bfd; };
 dependencies = { module=install-strip-ld; on=install-strip-bfd; };
 dependencies = { module=install-strip-ld; on=install-strip-libctf; };
 
+// libbfd depends on libsframe
+dependencies = { module=install-bfd; on=install-libsframe; };
+dependencies = { module=install-strip-bfd; on=install-strip-libsframe; };
+
 // libopcodes depends on libbfd
 dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; };
 dependencies = { module=install-opcodes; on=install-bfd; };
diff --git a/Makefile.in b/Makefile.in
index 35a5d8c575d..c97130a2338 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -66496,13 +66496,14 @@ all-stageautoprofile-binutils: maybe-all-stageautoprofile-libsframe
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe
 install-binutils: maybe-install-opcodes
 install-strip-binutils: maybe-install-strip-opcodes
-install-bfd: maybe-install-libsframe
 install-libctf: maybe-install-bfd
 install-ld: maybe-install-bfd
 install-ld: maybe-install-libctf
 install-strip-libctf: maybe-install-strip-bfd
 install-strip-ld: maybe-install-strip-bfd
 install-strip-ld: maybe-install-strip-libctf
+install-bfd: maybe-install-libsframe
+install-strip-bfd: maybe-install-strip-libsframe
 configure-opcodes: configure-bfd
 configure-stage1-opcodes: configure-stage1-bfd
 configure-stage2-opcodes: configure-stage2-bfd
-- 
2.41.0


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

* Re: [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS
  2023-08-07 10:32 ` [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
@ 2023-08-07 17:30   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:30 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> r14-2875-g1ed21e23d6d4da ("Use substituted GDCFLAGS") already
> implemented this change, but only on the generated file rather than in
> the template it is generated from.
> 
> ChangeLog:
> 
> 	* Makefile.tpl: Substitute @GDCFLAGS@ instead of using
> 	$(CFLAGS).
OK.
jeff

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

* Re: [PATCH 03/24] gcc-4.5 build fixes
  2023-08-07 10:32 ` [PATCH 03/24] gcc-4.5 build fixes Arsen Arsenović
@ 2023-08-07 17:31   ` Jeff Law
  2023-08-07 20:06   ` Eric Gallager
  1 sibling, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:31 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Alan Modra



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Alan Modra <amodra@gmail.com>
> 
> Trying to build binutils with an older gcc currently fails.  Working
> around these gcc bugs is not onerous so let's fix them.
> 
> include/ChangeLog:
> 
> 	* xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary
> 	forward declaration.
OK.  While gcc-4.8 is the minimum for GCC, as long as the pain is small 
I think we should allow earlier compilers if it helps gdb/binutils.

jeff

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

* Re: [PATCH 05/24] GCC: Check if AR works with --plugin and rc
  2023-08-07 10:32 ` [PATCH 05/24] GCC: Check if AR works with --plugin and rc Arsen Arsenović
@ 2023-08-07 17:41   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:41 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: H.J. Lu



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: "H.J. Lu" <hjl.tools@gmail.com>
> 
> AR from older binutils doesn't work with --plugin and rc:
> 
> [hjl@gnu-cfl-2 bin]$ touch foo.c
> [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
> [hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
> ./ar: no operation specified
> [hjl@gnu-cfl-2 bin]$ ./ar --version
> GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
> Copyright (C) 2018 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) any later version.
> This program has absolutely no warranty.
> [hjl@gnu-cfl-2 bin]$
> 
> Check if AR works with --plugin and rc before passing --plugin to AR and
> RANLIB.
> 
> ChangeLog:
> 
> 	* configure: Regenerated.
> 	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
> 	--plugin and rc before enabling --plugin.
> 
> config/ChangeLog:
> 
> 	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
> 	--plugin and rc before enabling --plugin.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libiberty/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 06/24] toplevel: Recover tilegx/tilepro targets
  2023-08-07 10:32 ` [PATCH 06/24] toplevel: Recover tilegx/tilepro targets Arsen Arsenović
@ 2023-08-07 17:42   ` Jeff Law
  2023-08-07 20:07     ` Eric Gallager
  0 siblings, 1 reply; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:42 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> These are still supported in Binutils.
> 
> ChangeLog:
> 
> 	* configure: Regenerate.
> 	* configure.ac: Recover tilegx/tilepro targets.
OK.  Good reminder that if we deprecate/remove something from GCC, we 
probably want to keep the toplevel configure bits for other projects 
that use the toplevel configure.

jeff

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

* Re: [PATCH 07/24] binutils, gdb: support zstd compressed debug sections
  2023-08-07 10:32 ` [PATCH 07/24] binutils, gdb: support zstd compressed debug sections Arsen Arsenović
@ 2023-08-07 17:43   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:43 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Fangrui Song



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Fangrui Song <maskray@google.com>
> 
> PR29397 PR29563: Add new configure option --with-zstd which defaults to
> auto.  If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support
> zstd compressed debug sections for most tools.
> 
> * bfd: for addr2line, objdump --dwarf, gdb, etc
> * gas: support --compress-debug-sections=zstd
> * ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
> * objcopy: support ELFCOMPRESS_ZSTD input for
>    --decompress-debug-sections and --compress-debug-sections=zstd
> * gdb: support ELFCOMPRESS_ZSTD input.  The bfd change references zstd
>    symbols, so gdb has to link against -lzstd in this patch.
> 
> If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error.  We
> can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this
> is too heavyweight, so don't do it for now.
> 
> ```
> % ld/ld-new a.o
> ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
> ...
> 
> % ld/ld-new a.o --compress-debug-sections=zstd
> ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support
> 
> % binutils/objcopy --compress-debug-sections=zstd a.o b.o
> binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support
> 
> % binutils/objcopy b.o --decompress-debug-sections
> binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
> ...
> ```
> 
> config/ChangeLog:
> 
> 	* zstd.m4: New file.
> 
> ChangeLog:
> 	* configure: Regenerate.
> 	* configure.ac: Add --with-zstd.
OK
jeff

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

* Re: [PATCH 08/24] configure: require libzstd >= 1.4.0
  2023-08-07 10:32 ` [PATCH 08/24] configure: require libzstd >= 1.4.0 Arsen Arsenović
@ 2023-08-07 17:43   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:43 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Christophe Lyon



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Christophe Lyon <christophe.lyon@arm.com>
> 
> gas uses ZSTD_compressStream2 which is only available with libzstd >=
> 1.4.0, leading to build errors when an older version is installed.
> 
> This patch updates the check libzstd presence to check its version is
>> = 1.4.0. However, since gas seems to be the only component requiring
> such a recent version this may imply that we disable ZSTD support for
> all components although some would still benefit from an older
> version.
> 
> I ran 'autoreconf -f' in all directories containing a configure.ac
> file, using vanilla autoconf-2.69 and automake-1.15.1. I noticed
> several errors from autoheader in readline, as well as warnings in
> intl, but they are unrelated to this patch.
> 
> This should fix some of the buildbots.
> 
> OK for trunk?
> 
> Thanks,
> 
> Christophe
> 
> config/ChangeLog:
> 
> 	* zstd.m4: Add minimum version requirement of 1.4.0.
OK.
jeff

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

* Re: [PATCH 10/24] gprofng: a new GNU profiler
  2023-08-07 10:32 ` [PATCH 10/24] gprofng: a new GNU profiler Arsen Arsenović
@ 2023-08-07 17:44   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:44 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Vladimir Mezentsev



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
> 
> ChangeLog:
> 
> 	* Makefile.def: Add gprofng module.
> 	* configure.ac: Add --enable-gprofng option.
> 	* Makefile.in: Regenerate.
> 	* configure: Regenerate.
> 
> include/ChangeLog:
> 
> 	* collectorAPI.h: New file.
> 	* libcollector.h: New file.
> 	* libfcollector.h: New file.
OK.
jeff

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

* Re: [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default
  2023-08-07 10:32 ` [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default Arsen Arsenović
@ 2023-08-07 17:45   ` Jeff Law
  2023-08-08 13:36     ` Luis Machado
  0 siblings, 1 reply; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:45 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Luis Machado



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Luis Machado <luis.machado@arm.com>
> 
> With a recent import of gnulib, code has been pulled that tests and enables
> 64-bit time_t by default on 32-bit hosts that support it.
> 
> Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
> doesn't do these checks.
> 
> As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
> have a mismatch between gdb's notion of time_t and bfd's notion of time_t.
> 
> This will lead to mismatches in the struct stat size, leading to memory
> corruption and crashes.
> 
> This patch disables the year 2038 check for now, which makes things work
> reliably again.
> 
> I'd consider this a temporary fix until we have proper bfd checks for the year
> 2038, if it makes sense.  64-bit hosts seems to be more common these days, so
> I'm not sure how important it is to have this support enabled and how soon
> we want to enable it.
> 
> Thoughts?
> 
> ChangeLog:
> 
> 	* configure.ac: Disable year2038 by default on 32-bit hosts.
> 	* configure: Regenerate.
OK.  Though I thought gnulib ended up reverting some of this work.

Jeff

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

* Re: [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile
  2023-08-07 10:32 ` [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile Arsen Arsenović
@ 2023-08-07 17:47   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:47 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Simon Marchi



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Simon Marchi <simon.marchi@efficios.com>
> 
> [Sending to binutils, gdb-patches and gcc-patches, since it touches the
> top-level Makefile/configure]
> 
> I have my debuginfod library installed in a non-standard location
> (/opt/debuginfod), which requires me to set
> PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config.  If I just set it during
> configure:
> 
>      $ PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config ./configure --with-debuginfod
>      $ make
> 
> or
> 
>      $ ./configure --with-debuginfod PKG_CONFIG_PATH=/opt/debuginfod/lib/pkg-config
>      $ make
> 
> Then PKG_CONFIG_PATH is only present (and ignored) during the top-level
> configure.  When running make (which runs gdb's and binutils'
> configure), PKG_CONFIG_PATH is not set, which results in their configure
> script not finding the library:
> 
>      checking for libdebuginfod >= 0.179... no
>      configure: error: "--with-debuginfod was given, but libdebuginfod is missing or unusable."
> 
> Change the top-level configure/Makefile system to capture the value
> passed when configuring the top-level and pass it down to
> subdirectories (similar to CFLAGS, LDFLAGS, etc).
> 
> I don't know much about the top-level build system, so I really don't
> know if I did this correctly.  The changes are:
> 
>   - Use AC_SUBST(PKG_CONFIG_PATH) in configure.ac, so that
>     @PKG_CONFIG_PATH@ gets replaced with the actual PKG_CONFIG_PATH value
>     in config files (i.e. Makefile)
>   - Add a PKG_CONFIG_PATH Makefile variable in Makefile.tpl, initialized
>     to @PKG_CONFIG_PATH@
>   - Add PKG_CONFIG_PATH to HOST_EXPORTS in Makefile.tpl, which are the
>     variables set when running the sub-configures
> 
> I initially added PKG_CONFIG_PATH to flags_to_pass, in Makefile.def, but
> I don't think it's needed.  AFAIU, this defines the flags to pass down
> when calling "make" in subdirectories.  We only need PKG_CONFIG_PATH to
> be passed down during configure.  After that, it's captured in
> gdb/config.status, so even if a "make" causes a re-configure later
> (because gdb/configure has changed, for example), the PKG_CONFIG_PATH
> value will be remembered.
> 
> Change-Id: I91138dfca41c43b05e53e445f62e4b27882536bf
> 
> ChangeLog:
> 
> 	* configure.ac: Add AC_SUBST(PKG_CONFIG_PATH).
> 	* configure: Re-generate.
> 	* Makefile.tpl (HOST_EXPORTS): Pass PKG_CONFIG_PATH.
> 	(PKG_CONFIG_PATH): New.
> 	* Makefile.in: Re-generate.
OK.
jeff

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

* Re: [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel
  2023-08-07 10:32 ` [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel Arsen Arsenović
@ 2023-08-07 17:50   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:50 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> The Binutils still support this target.
> 
> ChangeLog:
> 
> 	* configure.ac: Reinstate 32b PA-RISC HP-UX targets
> 	* configure: Regenerate.
OK.  Though I could fix this by removing SOM support in BFD? :-)

Though in reality it hasn't been a major source of maintenance effort 
through the decades since HP stopped supporting those platforms.

jeff

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

* Re: [PATCH 16/24] Add support for the haiku operating system
  2023-08-07 10:32 ` [PATCH 16/24] Add support for the haiku operating system Arsen Arsenović
@ 2023-08-07 17:51   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:51 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Alexander von Gluck IV



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Alexander von Gluck IV <kallisti5@unixzen.com>
> 
> These are the os support patches we have been grooming and maintaining
> for quite a few years over on git.haiku-os.org.  All of these
> architectures are working and most have been stable for quite some time.
> 
> ChangeLog:
> 
> 	* configure: Regenerate.
> 	* configure.ac: Add Haiku to list of ELF OSes
> 	* libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 17/24] egrep in binutils
  2023-08-07 10:32 ` [PATCH 17/24] egrep in binutils Arsen Arsenović
@ 2023-08-07 17:52   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:52 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Alan Modra



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Alan Modra <amodra@gmail.com>
> 
> Apparently some distros have a nagging egrep that helpfully tells you
> egrep is deprecated and to use "grep -E".  The nag message causes a ld
> testsuite failure.  What's more the advice isn't that good.  The "-E"
> flag may not be available with older versions of grep.
> 
> This patch fixes bare invocation of egrep within binutils, replacing
> it with the autoconf $EGREP or with grep.
> 
> config/ChangeLog:
> 
> 	* lib-ld.m4 (AC_LIB_PROG_LD_GNU): Require AC_PROG_EGREP and
> 	invoke $EGREP.
> 	(AC_LIB_PROG_LD): Likewise.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> intl/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcpp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
OK.  Yea, some distros nag.  Probably at least one of the Fedora 
releases does.

jeff

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

* Re: [PATCH 18/24] PR27116, Spelling errors found by Debian style checker
  2023-08-07 10:33 ` [PATCH 18/24] PR27116, Spelling errors found by Debian style checker Arsen Arsenović
@ 2023-08-07 17:52   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:52 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Alan Modra



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: Alan Modra <amodra@gmail.com>
> 
> config/ChangeLog:
> 
> 	* override.m4: Correct comment grammar.
OK
jeff

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

* Re: [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option
  2023-08-07 10:32 ` [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option Arsen Arsenović
@ 2023-08-07 17:53   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:53 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Martin Liska



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Martin Liska <mliska@suse.cz>
> 
> ChangeLog:
> 
> 	* configure.ac: Add --enable-default-compressed-debug-sections-algorithm.
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
  2023-08-07 10:33 ` [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works Arsen Arsenović
@ 2023-08-07 17:54   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:54 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: H.J. Lu



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: "H.J. Lu" <hjl.tools@gmail.com>
> 
> It is quite normal to have headers without library on multilib OSes.
> Add AC_TRY_LINK to PKG_CHECK_MODULES to check if $pkg_cv_[]$1[]_LIBS
> works.
> 
> config/ChangeLog:
> 
> 	* pkg.m4 (PKG_CHECK_MODULES): Add AC_TRY_LINK to check if
> 	$pkg_cv_[]$1[]_LIBS works.
OK.
jeff

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

* Re: [PATCH 21/24] PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works
  2023-08-07 10:33 ` [PATCH 21/24] PKG_CHECK_MODULES: Properly check " Arsen Arsenović
@ 2023-08-07 17:54   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:54 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: H.J. Lu



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: "H.J. Lu" <hjl.tools@gmail.com>
> 
> There is no need to check $pkg_cv_[]$1[]_LIBS works if package check
> failed.
> 
> config/ChangeLog:
> 
> 	* pkg.m4 (PKG_CHECK_MODULES): Use AC_TRY_LINK only if
> 	$pkg_failed = no.
OK.
jeff

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

* Re: [PATCH 23/24] bfd: linker: merge .sframe sections
  2023-08-07 10:33 ` [PATCH 23/24] bfd: linker: merge .sframe sections Arsen Arsenović
@ 2023-08-07 17:59   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 17:59 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Indu Bhagat



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: Indu Bhagat <indu.bhagat@oracle.com>
> 
> The linker merges all the input .sframe sections.  When merging, the
> linker verifies that all the input .sframe sections have the same
> abi/arch.
> 
> The linker uses libsframe library to perform key actions on the
> .sframe sections - decode, read, and create output data.  This
> implies buildsystem changes to make and install libsframe before
> libbfd.
> 
> The linker places the output .sframe section in a new segment of its
> own: PT_GNU_SFRAME.  A new segment is not added, however, if the
> generated .sframe section is empty.
> 
> When a section is discarded from the final link, the corresponding
> entries in the .sframe section for those functions are also deleted.
> 
> The linker sorts the SFrame FDEs on start address by default and sets
> the SFRAME_F_FDE_SORTED flag in the .sframe section.
> 
> This patch also adds support for generation of SFrame unwind
> information for the .plt* sections on x86_64.  SFrame unwind info is
> generated for IBT enabled PLT, lazy/non-lazy PLT.
> 
> The existing linker option --no-ld-generated-unwind-info has been
> adapted to include the control of whether .sframe unwind information
> will be generated for the linker generated sections like PLT.
> 
> Changes to the linker script have been made as necessary.
> 
> ChangeLog:
> 
> 	* Makefile.def: Add install dependency on libsframe for libbfd.
> 	* Makefile.in: Regenerated.
OK
jeff

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

* Re: [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe
  2023-08-07 10:33 ` [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe Arsen Arsenović
@ 2023-08-07 18:00   ` Jeff Law
  2023-08-07 21:08     ` Arsen Arsenović
  0 siblings, 1 reply; 60+ messages in thread
From: Jeff Law @ 2023-08-07 18:00 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Indu Bhagat



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: Indu Bhagat <indu.bhagat@oracle.com>
> 
> As noted in PR libsframe/30014 - FTBFS: install-strip fails because
> bfdlib relinks and fails to find libsframe, the install time
> dependencies of libbfd need to be updated.
> 
> ChangeLog:
> 
> 	* Makefile.def: Reflect that libsframe needs to installed before
> 	libbfd.  Reorder a bit to better track libsframe dependencies.
> 	* Makefile.in: Regenerate.
OK.

I know I skipped over a few.  I'll try to get those wrapped up shortly.

While I strongly dislike git submodules, this may be one of those 
occasions where their use might be justified.  Something to ponder 
because these shared toplevel files are painful to keep sync'd.

jeff

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

* Re: [PATCH 19/24] Deprecate a.out support for NetBSD targets.
  2023-08-07 10:33 ` [PATCH 19/24] Deprecate a.out support for NetBSD targets Arsen Arsenović
@ 2023-08-07 18:01   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 18:01 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: John Ericson



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: John Ericson <git@JohnEricson.me>
> 
> As discussed previously, a.out support is now quite deprecated, and in
> some cases removed, in both Binutils itself and NetBSD, so this legacy
> default makes little sense. `netbsdelf*` and `netbsdaout*` still work
> allowing the user to be explicit about there choice. Additionally, the
> configure script warns about the change as Nick Clifton requested.
> 
> One possible concern was the status of NetBSD on NS32K, where only a.out
> was supported. But per [1] NetBSD has removed support, and if it were to
> come back, it would be with ELF. The binutils implementation is
> therefore marked obsolete, per the instructions in the last message.
> 
> With that patch and this one applied, I have confirmed the following:
> 
> --target=i686-unknown-netbsd
> --target=i686-unknown-netbsdelf
>    builds completely
> 
> --target=i686-unknown-netbsdaout
>    properly fails because target is deprecated.
> 
> --target=vax-unknown-netbsdaout builds completely except for gas, where
> the target is deprecated.
> 
> [1]: https://mail-index.netbsd.org/tech-toolchain/2021/07/19/msg004025.html
> 
> config/ChangeLog:
> 
> 	* picflag.m4: Simplify SHmedia NetBSD match by presuming ELF.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libada/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libiberty/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 22/24] libtool.m4: augment symcode for Solaris 11
  2023-08-07 10:33 ` [PATCH 22/24] libtool.m4: augment symcode for Solaris 11 Arsen Arsenović
@ 2023-08-07 18:01   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 18:01 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Nick Alcock



On 8/7/23 04:33, Arsen Arsenović via Gcc-patches wrote:
> From: Nick Alcock <nick.alcock@oracle.com>
> 
> This reports common symbols like GNU nm, via a type code of 'C'.
> 
> ChangeLog:
> 
> 	* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
> 	Solaris 11.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
  2023-08-07 10:32 ` [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case Arsen Arsenović
@ 2023-08-07 19:12   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 19:12 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Nick Alcock



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Nick Alcock <nick.alcock@oracle.com>
> 
> My previous nm patch handled all cases but one -- if the user set NM in
> the environment to a path which contained an option, libtool's nm
> detection tries to run nm against a copy of nm with the options in it:
> e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the
> test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle".
> This is unlikely to be desirable: in this case we should run
> "/usr/bin/nm --blargle /usr/bin/nm".
> 
> Furthermore, as part of this nm has to detect when the passed-in $NM
> contains a path, and in that case avoid doing a path search itself.
> This too was thrown off if an option contained something that looked
> like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run
> "nm -B../prev-gcc nm" which rarely works well (and indeed it looks
> to see whether that nm exists, finds it doesn't, and wrongly concludes
> that nm -p or whatever does not work).
> 
> Fix all of these by clipping all options (defined as everything
> including and after the first " -") before deciding whether nm
> contains a path (but not using the clipped value for anything else),
> and then removing all options from the path-modified nm before
> looking to see whether that nm existed.
> 
> NM=my-nm now does a path search and runs e.g.
>    /usr/bin/my-nm -B /usr/bin/my-nm
> 
> NM=/usr/bin/my-nm now avoids a path search and runs e.g.
>    /usr/bin/my-nm -B /usr/bin/my-nm
> 
> NM="my-nm -p../wombat" now does a path search and runs e.g.
>    /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm
> 
> NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search:
>    ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm
> 
> This seems to be all combinations, including those used by GCC bootstrap
> (which, before this commit, fails to bootstrap when configured
> --with-build-config=bootstrap-lto, because the lto plugin is now using
> --export-symbols-regex, which requires libtool to find a working nm,
> while also using -B../prev-gcc to point at the lto plugin associated
> with the GCC just built.)
> 
> Regenerate all affected configure scripts.
> 
> ChangeLog:
> 
> 	* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
> 	options, including options containing paths.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 14/24] libtool.m4: fix nm BSD flag detection
  2023-08-07 10:32 ` [PATCH 14/24] libtool.m4: fix nm BSD flag detection Arsen Arsenović
@ 2023-08-07 19:13   ` Jeff Law
  2023-08-07 22:03     ` Nick Alcock
  0 siblings, 1 reply; 60+ messages in thread
From: Jeff Law @ 2023-08-07 19:13 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Nick Alcock



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Nick Alcock <nick.alcock@oracle.com>
> 
> Libtool needs to get BSD-format (or MS-format) output out of the system
> nm, so that it can scan generated object files for symbol names for
> -export-symbols-regex support.  Some nms need specific flags to turn on
> BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
> Unfortunately the code to do this has a pair of interlocking flaws:
> 
>   - it runs the test by doing an nm of /dev/null.  Some platforms
>     reasonably refuse to do an nm on a device file, but before now this
>     has only been worked around by assuming that the error message has a
>     specific textual form emitted by Tru64 nm, and that getting this
>     error means this is Tru64 nm and that nm -B would work to produce
>     BSD-format output, even though the test never actually got anything
>     but an error message out of nm -B.  This is fixable by nm'ing *nm
>     itself* (since we necessarily have a path to it).
> 
>   - the test is entirely skipped if NM is set in the environment, on the
>     grounds that the user has overridden the test: but the user cannot
>     reasonably be expected to know that libtool wants not only nm but
>     also flags forcing BSD-format output.  Worse yet, one such "user" is
>     the top-level Cygnus configure script, which neither tests for
>     nor specifies any BSD-format flags.  So platforms needing BSD-format
>     flags always fail to set them when run in a Cygnus tree, breaking
>     -export-symbols-regex on such platforms.  Libtool also needs to
>     augment $LD on some platforms, but this is done unconditionally,
>     augmenting whatever the user specified: the nm check should do the
>     same.
> 
>     One wrinkle: if the user has overridden $NM, a path might have been
>     provided: so we use the user-specified path if there was one, and
>     otherwise do the path search as usual.  (If the nm specified doesn't
>     work, this might lead to a few extra pointless path searches -- but
>     the test is going to fail anyway, so that's not a problem.)
> 
> (Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
> symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
> *that* is a symlink to /usr/bin/nm.)
> 
> ChangeLog:
> 
> 	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
> 	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
> 	errors from nms that refuse to work on non-regular files.  Remove
> 	other workarounds for this problem.  Strip out blank lines from the
> 	nm output.
> 
> fixincludes/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerate.
OK.  This is probably a prereq for the other NM patch I just ack'd.

jeff

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

* Re: [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB
  2023-08-07 10:32 ` [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB Arsen Arsenović
@ 2023-08-07 19:15   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 19:15 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: H.J. Lu



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: "H.J. Lu" <hjl.tools@gmail.com>
> 
> Sync with binutils for building binutils with LTO:
> 
> 50ad1254d50 GCC: Pass --plugin to AR and RANLIB
> 
> Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
> build.
> 
> ChangeLog:
> 
> 	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
> 	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
> 	* configure.ac: Include config/gcc-plugin.m4.
> 	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
> 	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
> 	RANLIB if possible.
> 	* Makefile.in: Regenerated.
> 	* configure: Likewise.
> 
> config/ChangeLog:
> 
> 	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.
> 
> libiberty/ChangeLog:
> 
> 	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
> 	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
> 	(configure_deps): Depend on ../config/gcc-plugin.m4.
> 	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
> 	RANLIB_PLUGIN_OPTION.
> 	* aclocal.m4: Regenerated.
> 	* configure: Likewise.
> 
> zlib/ChangeLog:
> 
> 	* configure: Regenerated.
> 
> gcc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libatomic/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libbacktrace/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libcc1/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libffi/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgfortran/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgm2/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libgomp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libitm/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libobjc/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libphobos/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libquadmath/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libsanitizer/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libssp/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> libvtv/ChangeLog:
> 
> 	* configure: Regenerate.
> 
> lto-plugin/ChangeLog:
> 
> 	* configure: Regenerate.
OK
jeff

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

* Re: [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess"
  2023-08-07 10:32 ` [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess" Arsen Arsenović
@ 2023-08-07 19:16   ` Jeff Law
  0 siblings, 0 replies; 60+ messages in thread
From: Jeff Law @ 2023-08-07 19:16 UTC (permalink / raw)
  To: Arsen Arsenović, gcc-patches; +Cc: Alan Modra



On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> From: Alan Modra <amodra@gmail.com>
> 
> Found when attempting to build binutils on sparc sunos-5.8 where
> sys/byteorder.h defines _BIG_ENDIAN but not any of the BYTE_ORDER
> variants.  This patch adds the extra tests to cope with the old
> machine, and tidies the header a little.
> 
> include/ChangeLog:
> 
> 	* plugin-api.h: When handling non-gcc or gcc < 4.6.0 include
> 	necessary header files before testing macros.  Make more use
> 	of #elif.  Test _LITTLE_ENDIAN and _BIG_ENDIAN in final tests.
OK
jeff

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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
                   ` (23 preceding siblings ...)
  2023-08-07 10:33 ` [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe Arsen Arsenović
@ 2023-08-07 19:54 ` Eric Gallager
  2023-08-07 23:03   ` Arsen Arsenović
  24 siblings, 1 reply; 60+ messages in thread
From: Eric Gallager @ 2023-08-07 19:54 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

On Mon, Aug 7, 2023 at 7:19 AM Arsen Arsenović via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hello,
>
> This patch set, combined with a sibling patch set sent on the binutils
> and GDB MLs, bring up the shared infrastructure between the two projects
> in sync again.
>
> It largely consists of cherry-picks from various people which have been
> reviewed and accepted on the binutils-gdb side, as well as a couple of
> patches for differences that seemed to get lost during the
> pick-and-regenerate process, though I've had to reformat quite a few
> commits so that they match what the changelog verifier expects.
>
> Some of these commits were previously applied and then reverted, namely
> "Check if AR works with --plugin and rc", but the reversion reason[1]
> seems to be no longer valid as of requiring Binutils 2.35 for LTO
> anyway.
>
> In addition, I'm not entirely certain that the handling of the removed
> targets I re-added is correct, nor what their status in binutils and gdb
> is, so feedback is welcome there.
>
> During this process, it appears that I overlooked passing -x to
> cherry-pick, so the paper trail got lost.  If needed, I can hack
> together some code to associate commits based on subjects with their
> pair in the other repository, and amend the commits with these
> references added.
>
> These patches ignore the intl/ directory, as I plan to follow up this
> patchset with one that can be cleanly applied to both trees which gets
> rid of the intl/ directory in favor of out-of-tree gettext (ISL, GMP, et
> al. style).
>
> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
>
> OK for master?
>
> Thanks in advance, have a lovely day.
>
> [1]: https://inbox.sourceware.org/gcc-patches/CAMe9rOqFSOSM5Sw5SBMiy20rdgRJkftUXdw=yKEXHvDMUtykdQ@mail.gmail.com/
>
> Alan Modra (4):
>   PR29961, plugin-api.h: "Could not detect architecture endianess"
>   gcc-4.5 build fixes
>   egrep in binutils
>   PR27116, Spelling errors found by Debian style checker
>
> Alexander von Gluck IV (1):
>   Add support for the haiku operating system
>
> Arsen Arsenović (3):
>   toplevel: Substitute GDCFLAGS instead of using CFLAGS
>   toplevel: Recover tilegx/tilepro targets
>   configure: reinstate 32b PA-RISC HP-UX target in toplevel
>
> Christophe Lyon (1):
>   configure: require libzstd >= 1.4.0
>
> Fangrui Song (1):
>   binutils, gdb: support zstd compressed debug sections
>
> H.J. Lu (4):
>   Sync with binutils: GCC: Pass --plugin to AR and RANLIB
>   GCC: Check if AR works with --plugin and rc
>   PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works
>   PKG_CHECK_MODULES: Properly check if $pkg_cv_[]$1[]_LIBS works
>
> Indu Bhagat (2):
>   bfd: linker: merge .sframe sections
>   toplevel: Makefile.def: add install-strip dependency on libsframe
>
> John Ericson (1):
>   Deprecate a.out support for NetBSD targets.
>
> Luis Machado (1):
>   Disable year 2038 support on 32-bit hosts by default
>
> Martin Liska (1):
>   add --enable-default-compressed-debug-sections-algorithm configure
>     option
>
> Nick Alcock (3):
>   libtool.m4: fix nm BSD flag detection
>   libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
>   libtool.m4: augment symcode for Solaris 11
>
> Simon Marchi (1):
>   Pass PKG_CONFIG_PATH down from top-level Makefile
>
> Vladimir Mezentsev (1):
>   gprofng: a new GNU profiler
>
>  Makefile.def               |  18 ++
>  Makefile.in                | 517 ++++++++++++++++++++++++++++++++++++-
>  Makefile.tpl               |  10 +-
>  config/gcc-plugin.m4       |  40 +++
>  config/lib-ld.m4           |   8 +-
>  config/override.m4         |   2 +-
>  config/picflag.m4          |   4 +-
>  config/pkg.m4              |   8 +
>  config/zstd.m4             |  23 ++
>  configure                  | 224 +++++++++++++++-
>  configure.ac               |  74 +++++-
>  fixincludes/configure      |   3 +-
>  gcc/configure              | 140 ++++++----
>  include/collectorAPI.h     |  73 ++++++
>  include/libcollector.h     |  89 +++++++
>  include/libfcollector.h    |  42 +++
>  include/plugin-api.h       |  49 ++--
>  include/xtensa-dynconfig.h |   2 -
>  intl/configure             |   4 +-
>  libada/configure           |   4 +-
>  libatomic/configure        | 130 ++++++----
>  libbacktrace/configure     | 130 ++++++----
>  libcc1/configure           | 132 ++++++----
>  libcpp/configure           |   4 +-
>  libffi/configure           | 132 ++++++----
>  libgcc/configure           |   6 +-
>  libgfortran/configure      | 132 ++++++----
>  libgm2/configure           | 132 ++++++----
>  libgomp/configure          | 132 ++++++----
>  libiberty/Makefile.in      |   5 +-
>  libiberty/aclocal.m4       |   1 +
>  libiberty/configure        | 144 ++++++++++-
>  libiberty/configure.ac     |  12 +
>  libitm/configure           | 132 ++++++----
>  libobjc/configure          | 130 ++++++----
>  libphobos/configure        | 130 ++++++----
>  libquadmath/configure      | 130 ++++++----
>  libsanitizer/configure     | 132 ++++++----
>  libssp/configure           | 130 ++++++----
>  libstdc++-v3/configure     | 148 +++++++----
>  libtool.m4                 | 130 ++++++----
>  libvtv/configure           | 132 ++++++----
>  lto-plugin/configure       | 130 ++++++----
>  zlib/configure             | 130 ++++++----
>  44 files changed, 2924 insertions(+), 956 deletions(-)
>  create mode 100644 config/zstd.m4
>  create mode 100644 include/collectorAPI.h
>  create mode 100644 include/libcollector.h
>  create mode 100644 include/libfcollector.h
>
> --
> 2.41.0
>

Hi, with the updates to libtool.m4 and pkg.m4, those files originally
come from upstream libtool and pkg-config, correct? Won't patching
GCC's local copies make re-syncing them with upstream
libtool/pkg-config more difficult, or have these patches already been
sent there, too? Also, when updating .m4 files, aren't you supposed to
increment the serial number that they have near the top, too?

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

* Re: [PATCH 03/24] gcc-4.5 build fixes
  2023-08-07 10:32 ` [PATCH 03/24] gcc-4.5 build fixes Arsen Arsenović
  2023-08-07 17:31   ` Jeff Law
@ 2023-08-07 20:06   ` Eric Gallager
  1 sibling, 0 replies; 60+ messages in thread
From: Eric Gallager @ 2023-08-07 20:06 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches, Alan Modra

On Mon, Aug 7, 2023 at 7:22 AM Arsen Arsenović via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Alan Modra <amodra@gmail.com>
>
> Trying to build binutils with an older gcc currently fails.  Working
> around these gcc bugs is not onerous so let's fix them.
>
> include/ChangeLog:
>
>         * xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary
>         forward declaration.
> ---
>  include/xtensa-dynconfig.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/include/xtensa-dynconfig.h b/include/xtensa-dynconfig.h
> index 48877ebb6b6..45d54dcd0e0 100644
> --- a/include/xtensa-dynconfig.h
> +++ b/include/xtensa-dynconfig.h
> @@ -121,8 +121,6 @@ struct xtensa_config_v4
>    int xchal_unaligned_store_hw;
>  };
>
> -typedef struct xtensa_isa_internal_struct xtensa_isa_internal;
> -
>  extern const void *xtensa_load_config (const char *name,
>                                        const void *no_plugin_def,
>                                        const void *no_name_def);
> --
> 2.41.0
>

Just to be clear: is it just gcc-4.5 where this fails, or gcc-4.5 and
all versions prior to it as well?

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

* Re: [PATCH 06/24] toplevel: Recover tilegx/tilepro targets
  2023-08-07 17:42   ` Jeff Law
@ 2023-08-07 20:07     ` Eric Gallager
  0 siblings, 0 replies; 60+ messages in thread
From: Eric Gallager @ 2023-08-07 20:07 UTC (permalink / raw)
  To: Jeff Law; +Cc: Arsen Arsenović, gcc-patches

On Mon, Aug 7, 2023 at 1:43 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
> On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
> > These are still supported in Binutils.
> >
> > ChangeLog:
> >
> >       * configure: Regenerate.
> >       * configure.ac: Recover tilegx/tilepro targets.
> OK.  Good reminder that if we deprecate/remove something from GCC, we
> probably want to keep the toplevel configure bits for other projects
> that use the toplevel configure.
>
> jeff

Maybe it's worth adding a comment in the script to remind people of this?

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

* Re: [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe
  2023-08-07 18:00   ` Jeff Law
@ 2023-08-07 21:08     ` Arsen Arsenović
  0 siblings, 0 replies; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 21:08 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Indu Bhagat

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


Jeff Law <jeffreyalaw@gmail.com> writes:

> OK.
>
> I know I skipped over a few.  I'll try to get those wrapped up shortly.

Thanks, I've pushed all of those (since I received all the reviews).

> While I strongly dislike git submodules, this may be one of those occasions
> where their use might be justified.  Something to ponder because these shared
> toplevel files are painful to keep sync'd.

I'm not sure how viable this is in the toplevel directory.  The inverse
is quite possible: the shared build system contains all the other
directories as modules, but that's undesirable for other reasons, I
presume.

I'll see if there's some solution.

> jeff


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

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

* Re: [PATCH 14/24] libtool.m4: fix nm BSD flag detection
  2023-08-07 19:13   ` Jeff Law
@ 2023-08-07 22:03     ` Nick Alcock
  0 siblings, 0 replies; 60+ messages in thread
From: Nick Alcock @ 2023-08-07 22:03 UTC (permalink / raw)
  To: Jeff Law; +Cc: Arsen Arsenović, gcc-patches

On 7 Aug 2023, Jeff Law uttered the following:

> On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
>> From: Nick Alcock <nick.alcock@oracle.com>
>> Libtool needs to get BSD-format (or MS-format) output out of the system
>> nm, so that it can scan generated object files for symbol names for
>> -export-symbols-regex support.  Some nms need specific flags to turn on
>> BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
>> Unfortunately the code to do this has a pair of interlocking flaws:
[...]
>> zlib/ChangeLog:
>> 	* configure: Regenerate.
> OK.  This is probably a prereq for the other NM patch I just ack'd.

It is.

-- 
NULL && (void)

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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-07 19:54 ` [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Eric Gallager
@ 2023-08-07 23:03   ` Arsen Arsenović
  2023-08-08 19:41     ` Joseph Myers
  0 siblings, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-07 23:03 UTC (permalink / raw)
  To: Eric Gallager; +Cc: gcc-patches

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


Eric Gallager <egall@gwmail.gwu.edu> writes:

> Hi, with the updates to libtool.m4 and pkg.m4, those files originally
> come from upstream libtool and pkg-config, correct? Won't patching
> GCC's local copies make re-syncing them with upstream
> libtool/pkg-config more difficult, or have these patches already been
> sent there, too? Also, when updating .m4 files, aren't you supposed to
> increment the serial number that they have near the top, too?

Yes.  Libtool was forked over a decade ago.  My next project is syncing
upstream and us back up.  Unsure about pkg.m4.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

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

* Re: [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default
  2023-08-07 17:45   ` Jeff Law
@ 2023-08-08 13:36     ` Luis Machado
  0 siblings, 0 replies; 60+ messages in thread
From: Luis Machado @ 2023-08-08 13:36 UTC (permalink / raw)
  To: Jeff Law, Arsen Arsenović, gcc-patches

On 8/7/23 18:45, Jeff Law wrote:
> 
> 
> On 8/7/23 04:32, Arsen Arsenović via Gcc-patches wrote:
>> From: Luis Machado <luis.machado@arm.com>
>>
>> With a recent import of gnulib, code has been pulled that tests and enables
>> 64-bit time_t by default on 32-bit hosts that support it.
>>
>> Although gdb can use the gnulib support, bfd doesn't use gnulib and currently
>> doesn't do these checks.
>>
>> As a consequence, if we have a 32-bit host that supports 64-bit time_t, we'll
>> have a mismatch between gdb's notion of time_t and bfd's notion of time_t.
>>
>> This will lead to mismatches in the struct stat size, leading to memory
>> corruption and crashes.
>>
>> This patch disables the year 2038 check for now, which makes things work
>> reliably again.
>>
>> I'd consider this a temporary fix until we have proper bfd checks for the year
>> 2038, if it makes sense.  64-bit hosts seems to be more common these days, so
>> I'm not sure how important it is to have this support enabled and how soon
>> we want to enable it.
>>
>> Thoughts?
>>
>> ChangeLog:
>>
>>     * configure.ac: Disable year2038 by default on 32-bit hosts.
>>     * configure: Regenerate.
> OK.  Though I thought gnulib ended up reverting some of this work.
> 
> Jeff

I sent this a little while ago. It may be possible that things have changed in gnulib since then.

This was mostly addressing issues building binutils-gdb with a 32-bit hosts and enabling all targets.

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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-07 23:03   ` Arsen Arsenović
@ 2023-08-08 19:41     ` Joseph Myers
  2023-08-08 22:26       ` Iain Sandoe
  2023-08-08 23:10       ` Arsen Arsenović
  0 siblings, 2 replies; 60+ messages in thread
From: Joseph Myers @ 2023-08-08 19:41 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Eric Gallager, gcc-patches

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

On Tue, 8 Aug 2023, Arsen Arsenović via Gcc-patches wrote:

> Yes.  Libtool was forked over a decade ago.  My next project is syncing
> upstream and us back up.  Unsure about pkg.m4.

Note as per previous discussions that libtool commit 
3334f7ed5851ef1e96b052f2984c4acdbf39e20c will need reverting in GCC when 
updating libtool because of incompatible usage of --with-sysroot.  
Reportedly libtool is based on upstream commit 
2c9c38d8a12eb0a2ce7fe9c3862523026c3d5622 (with *many* local changes, some 
of which may not be present upstream).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-08 19:41     ` Joseph Myers
@ 2023-08-08 22:26       ` Iain Sandoe
  2023-08-08 23:10       ` Arsen Arsenović
  1 sibling, 0 replies; 60+ messages in thread
From: Iain Sandoe @ 2023-08-08 22:26 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Arsen Arsenović, GCC Patches

Hi Joseph

> On 8 Aug 2023, at 20:41, Joseph Myers <joseph@codesourcery.com> wrote:
> 
> On Tue, 8 Aug 2023, Arsen Arsenović via Gcc-patches wrote:
> 
>> Yes.  Libtool was forked over a decade ago.  My next project is syncing
>> upstream and us back up.  Unsure about pkg.m4.
> 
> Note as per previous discussions that libtool commit 
> 3334f7ed5851ef1e96b052f2984c4acdbf39e20c will need reverting in GCC when 
> updating libtool because of incompatible usage of --with-sysroot.

Can you identify the consequence(s) of the difference?

(At present Darwin relies on configuring —with-sysroot to reference the system SDKs, since
 there are no longer any headers installed in / on Darwin hosts)

FWIW, we (FX and I) had started collating some of the Darwin libtool changes, (FX has posted one
upstream aready IIRC) since we also want to land the necessary support for @rpath.

> Reportedly libtool is based on upstream commit 
> 2c9c38d8a12eb0a2ce7fe9c3862523026c3d5622

I wonder if this will help track divergence.

> (with *many* local changes, some of which may not be present upstream).

maybe  s/some/most/ ? .. 

The other issue is that we might have changes that make sense local to GCC, but are not
really applicable more widely,

Iain


> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com


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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-08 19:41     ` Joseph Myers
  2023-08-08 22:26       ` Iain Sandoe
@ 2023-08-08 23:10       ` Arsen Arsenović
  2023-08-09 20:29         ` Joseph Myers
  1 sibling, 1 reply; 60+ messages in thread
From: Arsen Arsenović @ 2023-08-08 23:10 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Eric Gallager, gcc-patches

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


Joseph Myers <joseph@codesourcery.com> writes:

> On Tue, 8 Aug 2023, Arsen Arsenović via Gcc-patches wrote:
>
>> Yes.  Libtool was forked over a decade ago.  My next project is syncing
>> upstream and us back up.  Unsure about pkg.m4.
>
> Note as per previous discussions that libtool commit 
> 3334f7ed5851ef1e96b052f2984c4acdbf39e20c will need reverting in GCC when 
> updating libtool because of incompatible usage of --with-sysroot.

I wanted to, somehow, coalesce the two back together, so that both are
available.  Presumably, this means adding an option to libtool to accept
host-sysroot or such, but I haven't done too much looking into this.

Is my interpretation of the issue correct?  (i.e. GCC uses sysroot to
mean *target* sysroot rather than host sysroot)

> Reportedly libtool is based on upstream commit 
> 2c9c38d8a12eb0a2ce7fe9c3862523026c3d5622 (with *many* local changes, some 
> of which may not be present upstream).

Thanks, sharing that base will save me a good amount of time.

Have a lovely night.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

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

* Re: [PATCH 00/24] Sync shared build infrastructure with binutils-gdb
  2023-08-08 23:10       ` Arsen Arsenović
@ 2023-08-09 20:29         ` Joseph Myers
  0 siblings, 0 replies; 60+ messages in thread
From: Joseph Myers @ 2023-08-09 20:29 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Eric Gallager, gcc-patches

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

On Wed, 9 Aug 2023, Arsen Arsenović via Gcc-patches wrote:

> Joseph Myers <joseph@codesourcery.com> writes:
> 
> > On Tue, 8 Aug 2023, Arsen Arsenović via Gcc-patches wrote:
> >
> >> Yes.  Libtool was forked over a decade ago.  My next project is syncing
> >> upstream and us back up.  Unsure about pkg.m4.
> >
> > Note as per previous discussions that libtool commit 
> > 3334f7ed5851ef1e96b052f2984c4acdbf39e20c will need reverting in GCC when 
> > updating libtool because of incompatible usage of --with-sysroot.
> 
> I wanted to, somehow, coalesce the two back together, so that both are
> available.  Presumably, this means adding an option to libtool to accept
> host-sysroot or such, but I haven't done too much looking into this.
> 
> Is my interpretation of the issue correct?  (i.e. GCC uses sysroot to
> mean *target* sysroot rather than host sysroot)

GCC's sysroot is a sysroot containing target headers and libraries, yes.  
Also note:

* The --with-sysroot directory is the directory that would be used by GCC 
if installed in the configured --prefix (relocated if GCC ends up running 
from a different prefix).  At build time, --with-build-sysroot takes 
precedence.

* The --with-sysroot directory (and likewise the --with-build-sysroot 
directory or any directory specified with --sysroot= passed to GCC 
programs) may sometimes contain multiple sysroots in subdirectories; that 
directory gets combined with a suffix from SYSROOT_SUFFIX_SPEC to 
determine the actual subdirectory for the current multilib, within which 
there are subdirectories such as usr/include or usr/lib.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2023-08-09 20:29 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 10:32 [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Arsen Arsenović
2023-08-07 10:32 ` [PATCH 01/24] toplevel: Substitute GDCFLAGS instead of using CFLAGS Arsen Arsenović
2023-08-07 17:30   ` Jeff Law
2023-08-07 10:32 ` [PATCH 02/24] PR29961, plugin-api.h: "Could not detect architecture endianess" Arsen Arsenović
2023-08-07 19:16   ` Jeff Law
2023-08-07 10:32 ` [PATCH 03/24] gcc-4.5 build fixes Arsen Arsenović
2023-08-07 17:31   ` Jeff Law
2023-08-07 20:06   ` Eric Gallager
2023-08-07 10:32 ` [PATCH 04/24] Sync with binutils: GCC: Pass --plugin to AR and RANLIB Arsen Arsenović
2023-08-07 19:15   ` Jeff Law
2023-08-07 10:32 ` [PATCH 05/24] GCC: Check if AR works with --plugin and rc Arsen Arsenović
2023-08-07 17:41   ` Jeff Law
2023-08-07 10:32 ` [PATCH 06/24] toplevel: Recover tilegx/tilepro targets Arsen Arsenović
2023-08-07 17:42   ` Jeff Law
2023-08-07 20:07     ` Eric Gallager
2023-08-07 10:32 ` [PATCH 07/24] binutils, gdb: support zstd compressed debug sections Arsen Arsenović
2023-08-07 17:43   ` Jeff Law
2023-08-07 10:32 ` [PATCH 08/24] configure: require libzstd >= 1.4.0 Arsen Arsenović
2023-08-07 17:43   ` Jeff Law
2023-08-07 10:32 ` [PATCH 09/24] add --enable-default-compressed-debug-sections-algorithm configure option Arsen Arsenović
2023-08-07 17:53   ` Jeff Law
2023-08-07 10:32 ` [PATCH 10/24] gprofng: a new GNU profiler Arsen Arsenović
2023-08-07 17:44   ` Jeff Law
2023-08-07 10:32 ` [PATCH 11/24] Disable year 2038 support on 32-bit hosts by default Arsen Arsenović
2023-08-07 17:45   ` Jeff Law
2023-08-08 13:36     ` Luis Machado
2023-08-07 10:32 ` [PATCH 12/24] Pass PKG_CONFIG_PATH down from top-level Makefile Arsen Arsenović
2023-08-07 17:47   ` Jeff Law
2023-08-07 10:32 ` [PATCH 13/24] configure: reinstate 32b PA-RISC HP-UX target in toplevel Arsen Arsenović
2023-08-07 17:50   ` Jeff Law
2023-08-07 10:32 ` [PATCH 14/24] libtool.m4: fix nm BSD flag detection Arsen Arsenović
2023-08-07 19:13   ` Jeff Law
2023-08-07 22:03     ` Nick Alcock
2023-08-07 10:32 ` [PATCH 15/24] libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case Arsen Arsenović
2023-08-07 19:12   ` Jeff Law
2023-08-07 10:32 ` [PATCH 16/24] Add support for the haiku operating system Arsen Arsenović
2023-08-07 17:51   ` Jeff Law
2023-08-07 10:32 ` [PATCH 17/24] egrep in binutils Arsen Arsenović
2023-08-07 17:52   ` Jeff Law
2023-08-07 10:33 ` [PATCH 18/24] PR27116, Spelling errors found by Debian style checker Arsen Arsenović
2023-08-07 17:52   ` Jeff Law
2023-08-07 10:33 ` [PATCH 19/24] Deprecate a.out support for NetBSD targets Arsen Arsenović
2023-08-07 18:01   ` Jeff Law
2023-08-07 10:33 ` [PATCH 20/24] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works Arsen Arsenović
2023-08-07 17:54   ` Jeff Law
2023-08-07 10:33 ` [PATCH 21/24] PKG_CHECK_MODULES: Properly check " Arsen Arsenović
2023-08-07 17:54   ` Jeff Law
2023-08-07 10:33 ` [PATCH 22/24] libtool.m4: augment symcode for Solaris 11 Arsen Arsenović
2023-08-07 18:01   ` Jeff Law
2023-08-07 10:33 ` [PATCH 23/24] bfd: linker: merge .sframe sections Arsen Arsenović
2023-08-07 17:59   ` Jeff Law
2023-08-07 10:33 ` [PATCH 24/24] toplevel: Makefile.def: add install-strip dependency on libsframe Arsen Arsenović
2023-08-07 18:00   ` Jeff Law
2023-08-07 21:08     ` Arsen Arsenović
2023-08-07 19:54 ` [PATCH 00/24] Sync shared build infrastructure with binutils-gdb Eric Gallager
2023-08-07 23:03   ` Arsen Arsenović
2023-08-08 19:41     ` Joseph Myers
2023-08-08 22:26       ` Iain Sandoe
2023-08-08 23:10       ` Arsen Arsenović
2023-08-09 20:29         ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).