GCC modified for the FreeChainXenon project
Find a file
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
c++tools Daily bump. 2023-06-23 00:16:38 +00:00
config configure: require libzstd >= 1.4.0 2023-08-07 22:59:37 +02:00
contrib Daily bump. 2023-07-14 00:16:43 +00:00
fixincludes libtool.m4: fix nm BSD flag detection 2023-08-07 22:59:39 +02:00
gcc libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
gnattools Daily bump. 2023-04-26 00:17:46 +00:00
gotools Daily bump. 2022-08-31 00:16:45 +00:00
include gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
INSTALL
intl Daily bump. 2023-06-16 00:17:18 +00:00
libada Update copyright years. 2023-01-16 11:52:17 +01:00
libatomic libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libbacktrace libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libcc1 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libcody Daily bump. 2023-06-16 00:17:18 +00:00
libcpp Daily bump. 2023-07-20 00:17:53 +00:00
libdecnumber Daily bump. 2023-06-16 00:17:18 +00:00
libffi libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libgcc Daily bump. 2023-07-24 00:16:51 +00:00
libgfortran libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libgm2 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libgo cmd/go: don't collect package CGOLDFLAGS when using gccgo 2023-07-20 12:29:11 -07:00
libgomp libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libiberty GCC: Check if AR works with --plugin and rc 2023-08-07 22:59:37 +02:00
libitm libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libobjc libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libphobos libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libquadmath libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libsanitizer libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libssp libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libstdc++-v3 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
libvtv libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
lto-plugin libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
maintainer-scripts Daily bump. 2023-07-08 00:16:53 +00:00
zlib libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
.dir-locals.el
.gitattributes
.gitignore .gitignore: do not ignore config.h 2022-07-19 17:07:04 +03:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-08-03 00:17:10 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub config.sub: change mode to 755. 2021-12-21 09:10:57 +01:00
configure configure: reinstate 32b PA-RISC HP-UX target in toplevel 2023-08-07 22:59:39 +02:00
configure.ac configure: reinstate 32b PA-RISC HP-UX target in toplevel 2023-08-07 22:59:39 +02:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2023-08-07 22:59:39 +02:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself as a BPF port reviewer 2023-08-07 10:26:38 -07:00
Makefile.def gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
Makefile.in Pass PKG_CONFIG_PATH down from top-level Makefile 2023-08-07 22:59:38 +02:00
Makefile.tpl Pass PKG_CONFIG_PATH down from top-level Makefile 2023-08-07 22:59:38 +02:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.