libgo patch committed: Use right nm, use -p rather than -s

Message ID
State New
Headers show

Commit Message

Ian Taylor Jan. 12, 2011, 11:06 p.m.
This patch to libgo changes the gotest testing script to pick up NM from
the environment so that it runs the right nm program, and to use the -p
option rather than the -s option.  Using -s was a mistake copied from
the original gotest script, which used the 6nm program.  The -p option
is the one intended when using GNU nm, and has the fortunate side effect
that it should cause the right thing to happen with Solaris nm.  This
patch was based on one by Rainer Orth.  Bootstrapped and ran libgo
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.



diff -r 12a47f0928b3 libgo/testsuite/gotest
--- a/libgo/testsuite/gotest	Wed Jan 12 13:54:48 2011 -0800
+++ b/libgo/testsuite/gotest	Wed Jan 12 15:03:28 2011 -0800
@@ -19,6 +19,8 @@ 
 export GC GL GOLIBS
 # srcdir is where the source files are found.  basedir is where the
 # source file paths are relative to.
 # gofiles are the test files.  pkgfiles are the source files.
@@ -272,7 +274,7 @@ 
 	# the grep -v eliminates methods and other special names
 	# that have multiple dots.
-	tests=$(nm -s _gotest_.o $xofile | egrep ' T .*\.'$pattern'$' | grep -v '\..*\..*\.' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
+	tests=$($NM -p _gotest_.o $xofile | egrep ' T .*\.'$pattern'$' | grep -v '\..*\..*\.' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
 	if [ "x$tests" = x ]; then
 		echo 'gotest: warning: no tests matching '$pattern in _gotest_.o $xofile 1>&2
 		exit 2