gcc/libatomic
Nick Alcock f330710912
libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
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.
2023-08-07 22:59:39 +02:00
..
config libatomic: Fix SEQ_CST 128-bit atomic load [PR108891] 2023-03-24 16:51:26 +00:00
testsuite Remove stale Autoconf checks for Perl 2023-06-02 09:51:14 +02:00
.gitignore
acinclude.m4 Add mold detection for libs. 2022-01-31 09:46:44 +01:00
aclocal.m4 Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
auto-config.h.in Makefile.am (ARCH_AARCH64_LINUX): Add IFUNC_OPTIONS and libatomic_la_LIBADD. 2017-12-05 00:49:09 +00:00
cas_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
ChangeLog Daily bump. 2023-06-11 00:17:37 +00:00
configure libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
configure.ac Remove stale Autoconf checks for Perl 2023-06-02 09:51:14 +02:00
configure.tgt libatomic: x86_64: Always try ifunc 2023-06-10 21:43:56 +08:00
exch_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
fadd_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
fand_n.c
fence.c Update copyright years. 2023-01-16 11:52:17 +01:00
fenv.c Update copyright years. 2023-01-16 11:52:17 +01:00
fior_n.c
flag.c Update copyright years. 2023-01-16 11:52:17 +01:00
fnand_n.c
fop_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
fsub_n.c
fxor_n.c
gcas.c Update copyright years. 2023-01-16 11:52:17 +01:00
gexch.c Update copyright years. 2023-01-16 11:52:17 +01:00
glfree.c Update copyright years. 2023-01-16 11:52:17 +01:00
gload.c Update copyright years. 2023-01-16 11:52:17 +01:00
gstore.c Update copyright years. 2023-01-16 11:52:17 +01:00
host-config.h Update copyright years. 2023-01-16 11:52:17 +01:00
init.c
libatomic_i.h Update copyright years. 2023-01-16 11:52:17 +01:00
libatomic.map
load_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
Makefile.am Update copyright years. 2023-01-16 11:52:17 +01:00
Makefile.in Remove stale Autoconf checks for Perl 2023-06-02 09:51:14 +02:00
store_n.c Update copyright years. 2023-01-16 11:52:17 +01:00
tas_n.c Update copyright years. 2023-01-16 11:52:17 +01:00