On Thu, Jul 28, 2016 at 2:29 AM, Uros Bizjak <ubiz...@gmail.com> wrote: > >> I have committed a patch to update libgo to the 1.7rc3 release >> candidate. This is very close to the upcoming 1.7 release. As usual >> with libgo updates, the patch is too large to include in this e-mail >> message. I've appended the changes to the gccgo-specific directories. > > There is an issue with > > libgo/go/crypto/sha1/issue15617_test.go. > > The test crypto/sha1 fails on alpha-linux-gnu with: > > --- FAIL: TestOutOfBoundsRead (0.00s) > panic: invalid argument [recovered] > panic: invalid argument > ... > > since the test hard-codes 4k pages, but alpha uses 8k pages. > > It looks that the second line of build directives in the test: > > // +build amd64 > // +build linux darwin > > overwrites the first one, so the test runs also on non-amd64 > architecture linux OS. I have confirmed this by removing the second > build directive, and crypto/sha1 test then passed, since > issue15617_test.go was not linked into the final executable.
Thanks. Looking into this revealed some problems with the handling of multiple +build lines. Not only was the shell script not anding them together as required, it wasn't even distinguishing them since the shell drops newlines in backquoted data. Fixed with the appended patch, now committed to mainline. Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 239095) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -0fb416a7bed076bdfef168480789bb2994a58de3 +3096ac81185edacbf800783f0f803d1c419dccdd The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/testsuite/gotest =================================================================== --- libgo/testsuite/gotest (revision 238653) +++ libgo/testsuite/gotest (working copy) @@ -313,56 +313,60 @@ x) esac if test x$tag1 != xnonmatchingtag -a x$tag2 != xnonmatchingtag; then - taglines=`sed '/^package /q' < $f | fgrep '// +build '` - if test "$taglines" = ""; then - omatch=true - else - omatch=false - fi - for tags in $taglines; do - match=false - for tag in $tags; do - reverse=false - case $tag in - "!"*) - reverse=true - tag=`echo $tag | sed -e 's/^!//'` - ;; - esac - - case $tag in - "//" | "+build") - ;; - $goos | $goarch | cgo) - match=true - ;; - *,*) - match=true - for ctag in `echo $tag | sed -e 's/,/ /g'`; do - case $ctag in - $goos | $goarch | cgo) - ;; - *) - match=false - ;; - esac - done - ;; - esac + tags=`sed '/^package /q' < $f | fgrep '// +build '` + omatch=true + first=true + match=false + for tag in $tags; do + reverse=false + case $tag in + "!"*) + reverse=true + tag=`echo $tag | sed -e 's/^!//'` + ;; + esac - if test "$reverse" = true; then - if test "$match" = true; then + case $tag in + "//") + ;; + "+build") + if test "$first" = "true"; then + first=false + elif test "$match" = "false"; then + omatch=false + fi + match=false + ;; + $goos | $goarch | cgo) + match=true + ;; + *,*) + match=true + for ctag in `echo $tag | sed -e 's/,/ /g'`; do + case $ctag in + $goos | $goarch | cgo) + ;; + *) match=false - else - match=true - fi + ;; + esac + done + ;; + esac + + if test "$reverse" = true; then + if test "$match" = true; then + match=false + else + match=true fi - done - if test "$match" = "true"; then - omatch=true fi done + if test "$match" = "false" -a "$first" = "false"; then + omatch=false + fi + if test "$omatch" = "true"; then gofiles="$gofiles $f" fi