[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] RFA: Use cross nm in NPTL tests



One of the NPTL tests runs nm and looks for the symbols needed for
cancellation support.  For cross-testing, I need to make sure the test
uses the appropriate nm.  How does this look to people?

2007-01-30  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	Use the host nm in NPTL tests.
	* aclocal.m4 (LIBC_PROG_BINUTILS): Find path to 'nm', too.
        * configure: Regenerated.
	* config.make.in: Accept 'nm' path from configure script.
	* nptl/Makefile (tst-cancel-wrappers.out): Pass 'nm' path to test
	script.
	* nptl/tst-cancel-wrappers.sh: Use the 'nm' given in arguments.

Index: aclocal.m4
===================================================================
--- aclocal.m4	(revision 161054)
+++ aclocal.m4	(working copy)
@@ -97,6 +97,8 @@
 LD=`$CC -print-prog-name=ld`
 AR=`$CC -print-prog-name=ar`
 AC_SUBST(AR)
+NM=`$CC -print-prog-name=nm`
+AC_SUBST(NM)
 OBJDUMP=`$CC -print-prog-name=objdump`
 AC_SUBST(OBJDUMP)
 
Index: config.make.in
===================================================================
--- config.make.in	(revision 161054)
+++ config.make.in	(working copy)
@@ -102,6 +102,7 @@
 CFLAGS = @CFLAGS@
 ASFLAGS-config = @ASFLAGS_config@
 AR = @AR@
+NM = @NM@
 RANLIB = @RANLIB@
 MAKEINFO = @MAKEINFO@
 AS = $(CC) -c
Index: nptl/Makefile
===================================================================
--- nptl/Makefile	(revision 161054)
+++ nptl/Makefile	(working copy)
@@ -592,16 +592,17 @@
 LDFLAGS-pthread.so += -e __nptl_main
 endif
 
-ifeq (no,$(cross-compiling))
+# ifeq (no,$(cross-compiling))
 ifeq (yes,$(build-shared))
 tests: $(objpfx)tst-cancel-wrappers.out
 $(objpfx)tst-cancel-wrappers.out: tst-cancel-wrappers.sh
-	$(SHELL) $< $(common-objpfx)libc_pic.a \
+	$(SHELL) $< '$(NM)' \
+		    $(common-objpfx)libc_pic.a \
 		    $(common-objpfx)libc.a \
 		    $(objpfx)libpthread_pic.a \
 		    $(objpfx)libpthread.a > $@
 endif
-endif
+# endif
 
 tst-exec4-ARGS = $(built-program-cmd)
 
Index: nptl/tst-cancel-wrappers.sh
===================================================================
--- nptl/tst-cancel-wrappers.sh	(revision 161054)
+++ nptl/tst-cancel-wrappers.sh	(working copy)
@@ -19,8 +19,9 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 # 02111-1307 USA.
 
+nm="$1"; shift
 while [ $# -gt 0 ]; do
-  ( nm -P $1; echo 'end[end]:' ) | gawk ' BEGIN {
+  ( $nm -P $1; echo 'end[end]:' ) | gawk ' BEGIN {
 C["accept"]=1
 C["close"]=1
 C["connect"]=1