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

login
register
mail settings
Submitter Ian Taylor
Date Jan. 12, 2011, 11:06 p.m.
Message ID <mcrr5chu3h4.fsf@google.com>
Download mbox | patch
Permalink /patch/78623/
State New
Headers show

Comments

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.

Ian

Patch

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 @@ 
 GOLIBS=
 export GC GL GOLIBS
 
+NM=${NM:-nm}
+
 # 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.
 	pattern='Test([^a-z].*)?'
-	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