This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgo patch committed: Use right nm, use -p rather than -s
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Wed, 12 Jan 2011 15:06:15 -0800
- Subject: libgo patch committed: Use right nm, use -p rather than -s
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
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