binutils-gdb/libctf
Nick Alcock caf606c90d 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.

	* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
	options, including options containing paths.
2022-03-25 12:02:35 +00:00
..
doc libctf: delete unused libctf_TEXINFOS 2022-02-11 04:20:49 -05:00
testsuite Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
.gitignore
aclocal.m4 Implement a workaround for GNU mak jobserver 2021-01-12 05:45:44 -08:00
ChangeLog Add markers for 2.38 branch 2022-01-22 12:08:55 +00:00
ChangeLog-2020 libctf: fix old ChangeLog typo 2021-01-05 14:53:40 +00:00
config.h.in
configure libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2022-03-25 12:02:35 +00:00
configure.ac Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-archive.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-create.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-decl.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-decls.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-dedup.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-dump.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-endian.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-error.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-hash.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-impl.h libctf: add LIBCTF_WRITE_FOREIGN_ENDIAN debugging option 2022-03-23 13:48:32 +00:00
ctf-inlines.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-intl.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-labels.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-link.c include, libctf, ld: extend variable section to contain functions too 2022-03-23 13:48:32 +00:00
ctf-lookup.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-open-bfd.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-open.c libctf: add LIBCTF_WRITE_FOREIGN_ENDIAN debugging option 2022-03-23 13:48:32 +00:00
ctf-qsort_r.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-serialize.c libctf: add LIBCTF_WRITE_FOREIGN_ENDIAN debugging option 2022-03-23 13:48:32 +00:00
ctf-sha1.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-sha1.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-string.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-subr.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-types.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
ctf-util.c Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
elf.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
libctf.ver Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
Makefile.am Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
Makefile.in libctf: delete unused libctf_TEXINFOS 2022-02-11 04:20:49 -05:00
NEWS include, libctf, ld: extend variable section to contain functions too 2022-03-23 13:48:32 +00:00
swap.h Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30