gcc/libsanitizer
Nick Alcock ab42297456
libtool.m4: fix nm BSD flag detection
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.
2023-08-07 22:59:39 +02:00
..
asan libsanitizer: Apply local patches 2023-04-30 09:38:32 +02:00
builtins libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
hwasan libsanitizer: link hwasan against lsan library 2023-04-30 21:31:49 +02:00
include libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
interception libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
libbacktrace
lsan libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
sanitizer_common libsanitizer: Fix SPARC stacktraces 2023-08-07 11:29:02 +02:00
tsan libsanitizer: Apply local patches 2023-04-30 09:38:32 +02:00
ubsan libsanitizer: Apply local patches 2023-04-30 09:38:32 +02:00
acinclude.m4
aclocal.m4
ChangeLog Daily bump. 2023-05-01 00:16:44 +00:00
config.h.in
configure libtool.m4: fix nm BSD flag detection 2023-08-07 22:59:39 +02:00
configure.ac libsanitizer/mips: always build with largefile support 2023-01-31 10:00:44 +08:00
configure.tgt libsanitizer, darwin: Unsupport Darwin >= 22 for now. 2023-04-18 07:27:48 +01:00
HOWTO_MERGE
libsanitizer.spec.in
LICENSE.TXT
LOCAL_PATCHES libsanitizer: update LOCAL_PATCHES revision 2023-04-30 09:56:46 +02:00
Makefile.am
Makefile.in
MERGE libsanitizer: merge from upstream (87e6e490e79384a5) 2023-04-30 09:38:14 +02:00
merge.sh
README.gcc

AddressSanitizer and ThreadSanitizer (https://github.com/google/sanitizers) are
projects initially developed by Google Inc.

Both tools consist of a compiler module and a run-time library.
The sources of the run-time library for these projects are hosted at
https://github.com/llvm/llvm-project in the following directories:
  compiler-rt/include/sanitizer
  compiler-rt/lib/sanitizer_common
  compiler-rt/lib/interception
  compiler-rt/lib/asan
  compiler-rt/lib/tsan
  compiler-rt/lib/lsan
  compiler-rt/lib/ubsan
  compiler-rt/lib/hwasan

Trivial and urgent fixes (portability, build fixes, etc.) may go directly to the
GCC tree.  All non-trivial changes, functionality improvements, etc. should go
through the upstream tree first and then be merged back to the GCC tree.
The merges from upstream should be done with the aid of the merge.sh script;
it will also update the file MERGE to contain the upstream revision
we merged with.