This libgo patch passes -v to nm in the gotest script. That has no effect on GNU nm (it's overridden by the -p option), and will tell Solaris nm to sort by value. With luck that will make the functions apear in the order in which they appear in the source file, which is what some of the tests expect. It would be better if the tests were not order dependent, but they are what they are. This is for PR go/48020. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r a7ab61d1e5a1 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Wed Mar 09 14:10:38 2011 -0800 +++ b/libgo/testsuite/gotest Wed Mar 09 16:45:16 2011 -0800 @@ -274,7 +274,9 @@ # the grep -v eliminates methods and other special names # that have multiple dots. pattern='Test([^a-z].*)?' - tests=$($NM -p _gotest_.o $xofile | egrep ' T .*\.'$pattern'$' | grep -v '\..*\..*\.' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/') + # The -p option tells GNU nm not to sort. + # The -v option tells Solaris nm to sort by value. + tests=$($NM -p -v _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