acadia-newlib/newlib/libc/sys/linux/linuxthreads
Nick Alcock 5ab7dd14e1 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
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	PR libctf/27967
	* 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.
2022-01-12 08:49:10 -05:00
..
bits 2005-10-26 Shaun Jackman <sjackman@gmail.com> 2005-10-26 22:16:34 +00:00
machine libtool.m4: fix nm BSD flag detection 2022-01-12 08:49:10 -05:00
LICENSE
Makefile.am newlib: fix silent build in a few subdirs 2022-01-05 20:38:25 -05:00
Makefile.in newlib: fix silent build in a few subdirs 2022-01-05 20:38:25 -05:00
aclocal.m4 newlib: regen aclocal.m4 after autoconf update 2022-01-12 07:01:18 -05:00
attr.c 2007-12-19 Jeff Johnston <jjohnstn@redhat.com> 2007-12-19 22:27:00 +00:00
barrier.c
bp-sym.h
cancel.c
condvar.c
config.h 2006-03-17 Jeff Johnston <jjohnstn@redhat.com> 2006-03-17 22:27:37 +00:00
configure libtool.m4: fix nm BSD flag detection 2022-01-12 08:49:10 -05:00
configure.ac libgloss/newlib: rename configure.in to configure.ac 2021-09-13 10:14:37 -04:00
defs.awk
ecmutex.c
events.c
getcpuclockid.c
getreent.c
internals.h headers: properly decorate attributes 2014-08-01 15:44:51 +00:00
join.c
joinrace.c 2007-12-19 Jeff Johnston <jjohnstn@redhat.com> 2007-12-19 22:27:00 +00:00
kernel-features.h
libc-internal.h
libc-symbols.h headers: properly decorate attributes 2014-08-01 15:44:51 +00:00
linuxthreads.texi
lockfile.c
manager.c 2007-12-19 Jeff Johnston <jjohnstn@redhat.com> 2007-12-19 22:27:00 +00:00
mq_notify.c
mutex.c
no-tsd.c
oldsemaphore.c
posix-timer.h
prio.c
proc_service.h
pt-machine.c
ptclock_gettime.c
ptclock_settime.c
ptfork.c
pthread.c
ptlongjmp.c
queue.h
reent.c
reqsyscalls.c
restart.h
rwlock.c
semaphore.c
semaphore.h
shlib-compat.h
signals.c
specific.c
spinlock.c 008-09-08 Jeff Johnston <jjohnstn@redhat.com> 2008-09-08 22:25:14 +00:00
spinlock.h
sysctl.c
td_init.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_log.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_symbol_list.c
td_ta_clear_event.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_delete.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_enable_stats.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_event_addr.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_event_getmsg.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_get_nthreads.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_get_ph.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_get_stats.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_map_id2thr.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_map_lwp2thr.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_new.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_reset_stats.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_set_event.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_setconcurrency.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_thr_iter.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_ta_tsd_iter.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_clear_event.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_dbresume.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_dbsuspend.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_event_enable.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_event_getmsg.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_get_info.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_getfpregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_getgregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_getxregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_getxregsize.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_set_event.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_setfpregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_setgregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_setprio.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_setsigpending.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_setxregs.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_sigsetmask.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_tsd.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
td_thr_validate.c 2003-11-06 Jeff Johnston <jjohnstn@redhat.com> 2003-11-06 22:58:52 +00:00
testrtsig.h
thread_db.h
thread_dbP.h
timer_create.c 2013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com> 2013-11-25 13:46:23 +00:00
timer_delete.c
timer_getoverr.c
timer_gettime.c
timer_routines.c
timer_settime.c 2013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com> 2013-11-25 13:46:23 +00:00
tst-cancel.c
tst-context.c
tststack.c
unload.c
weaks.c
wrapsyscall.c