Re: libgo patch committed: Change build procedure to use build tags

2016-09-23 Thread Ian Lance Taylor
On Sun, Sep 4, 2016 at 7:51 AM, Matthias Klose  wrote:
> On 07.08.2016 17:18, Matthias Klose wrote:
>> On 07.08.2016 14:14, Andreas Schwab wrote:
>>> That breaks ia64:
>>>
>>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:29:5: error: 
>>> reference to undefined name 'randomTrap'
>>>   if randomTrap == 0 {
>>>  ^
>>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:38:34: error: 
>>> reference to undefined name 'randomTrap'
>>>   r1, _, errno := syscall.Syscall(randomTrap,
>>>   ^
>>> make[4]: *** [internal/syscall/unix.lo] Error 1
>>
>> same on s390x.
>
> same on mips, mipsel, mips64el and sparc64.

Sorry, I somehow misunderstood this message.  This patch should fix
it.  Bootstrapped on x86_64-pc-linux-gnu, which proves little.
Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 240453)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-57bf3f21005c4508003f65207282c057e3526ec0
+28b79f1d5a3a8924329128999a21d0693e08a603
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/internal/syscall/unix/getrandom_linux_mips64x.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_mips64x.go   (revision 
240053)
+++ libgo/go/internal/syscall/unix/getrandom_linux_mips64x.go   (working copy)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build mips64 mips64le
+// +build mips64 mips64le mipsn64 mipso64
 
 package unix
 
Index: libgo/go/internal/syscall/unix/getrandom_linux_mipsn32.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_mipsn32.go   (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_mipsn32.go   (working copy)
@@ -0,0 +1,11 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build mipsn32
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 6317
Index: libgo/go/internal/syscall/unix/getrandom_linux_mipso32.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_mipso32.go   (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_mipso32.go   (working copy)
@@ -0,0 +1,11 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build mipso32
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 4353
Index: libgo/go/internal/syscall/unix/getrandom_linux_sparc.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_sparc.go (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_sparc.go (working copy)
@@ -0,0 +1,11 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build sparc sparc64
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 347


Re: libgo patch committed: Change build procedure to use build tags

2016-09-04 Thread Matthias Klose
On 07.08.2016 17:18, Matthias Klose wrote:
> On 07.08.2016 14:14, Andreas Schwab wrote:
>> That breaks ia64:
>>
>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:29:5: error: 
>> reference to undefined name 'randomTrap'
>>   if randomTrap == 0 {
>>  ^
>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:38:34: error: 
>> reference to undefined name 'randomTrap'
>>   r1, _, errno := syscall.Syscall(randomTrap,
>>   ^
>> make[4]: *** [internal/syscall/unix.lo] Error 1
> 
> same on s390x.

same on mips, mipsel, mips64el and sparc64.

Matthias



Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Ian Lance Taylor
On Fri, Aug 12, 2016 at 6:56 AM, Rainer Orth
 wrote:
> Hi Ian,
>
 this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
 bootstrap, however: in both cases, the 64-bit build of os.lo fails like 
 this:

 /vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
 undefined name 'libc_readdir_r'
i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
 ^

 Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
 nor dir_regfile.go (which is needed here) is included in the
 compilation.
>>>
>>> Sorry, I don't know what I messed up in my testing.  I committed the
>>> appended patch, which should fix the problem.
>>
>> I had found a different one to the same effect, but running match.sh
>> with yours looked right, too.
>
> here's another issue found during wider testing: on Solaris 10 with
> /bin/ksh as CONFIG_SHELL, the build aborts like this:
>
> objcopy: 'bufio.o': No such file
> Makefile:5072: recipe for target 'bufio.gox' failed
> make[4]: *** [bufio.gox] Error 1
>
> It turns out that no bufio.o is created indeed:
>
> /vol/gcc/src/hg/trunk/local/libgo/../install-sh -c -d .; files=`echo  | sed 
> -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; /bin/ksh ./libtool --tag GO 
> --mode=compile /var/gcc/regression/trunk/10-gcc/build/./gcc/gccgo 
> -B/var/gcc/regression/trunk/10-gcc/build/./gcc/ 
> -B/vol/gcc/i386-pc-solaris2.10/bin/ -B/vol/gcc/i386-pc-solaris2.10/lib/ 
> -isystem /vol/gcc/i386-pc-solaris2.10/include -isystem 
> /vol/gcc/i386-pc-solaris2.10/sys-include -minline-all-stringops  -g -O2 
> -I . -c -fgo-pkgpath=`echo bufio.lo | sed -e 's/.lo$//' -e 's/-go$//'` -o 
> bufio.lo $files
>
> The list of input files, output from the likes of
>
> /bin/ksh /vol/gcc/src/hg/trunk/local/libgo/match.sh --goarch=386 
> --goos=solaris --srcdir=/vol/gcc/src/hg/trunk/local/libgo/go/bufio 
> --extrafiles=""
>
> is empty.  Running match.sh with /bin/ksh -x reveals
>
> + set -e
> + unset LANG
>
> where the script aborts.  It turns out that /bin/ksh errors out on an
> unset of a variable that isn't set.
>
> Maybe one could explicitly set LANG=C here, or use the `portable unset'
> used in configure?

That is a shell portability problem I was not aware of.  I took your
LANG=C suggestion.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 239442)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-d51890dc96a2a33484623728bdc8ac258645e9cc
+24e0c4c98e0614b1892316aca787f1c564f2d269
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/match.sh
===
--- libgo/match.sh  (revision 239225)
+++ libgo/match.sh  (working copy)
@@ -10,10 +10,10 @@
 
 set -e
 
-unset LANG
+LANG=C
 LC_ALL=C
 LC_CTYPE=C
-export LC_ALL LC_CTYPE
+export LANG LC_ALL LC_CTYPE
 
 srcdir=""
 goarch=""
Index: libgo/testsuite/gotest
===
--- libgo/testsuite/gotest  (revision 239256)
+++ libgo/testsuite/gotest  (working copy)
@@ -10,9 +10,10 @@
 
 # Makes egrep,grep work better in general if we put them
 # in ordinary C mode instead of what the current language is.
-unset LANG
-export LC_ALL=C
-export LC_CTYPE=C
+LANG=C
+LC_ALL=C
+LC_CTYPE=C
+export LANG LC_ALL LC_CTYPE
 
 GC=${GC:-gccgo}
 GL=${GL:-${GC-gccgo}}


Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Ian Lance Taylor
On Fri, Aug 12, 2016 at 4:19 AM, Andreas Krebbel
 wrote:
> On 08/06/2016 02:36 AM, Ian Lance Taylor wrote:
>> Go packages use build tags (see the section on Build Constraints at
>> https://golang.org/pkg/go/build/) to select which files to build on
>> specific systems.
>>
>> Previously the libgo Makefile explicitly listed the set of files to
>> compile for each package.  For packages that use build tags, this
>> required a lot of awkward automake conditionals in the Makefile.
>>
>> This patch changes the build to look at the build tags in the files.
>> The new shell script libgo/match.sh does the matching.  This required
>> adjusting a lot of build tags, and removing some files that are never
>> used.  I verified that the exact same sets of files are compiled on
>> x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
>> (building for both 32-bit and 64-bit).
>>
>> Writing match.sh revealed some bugs in the build tag handling that
>> already exists, in a slightly different form, in the gotest shell
>> script.  This patch fixes those problems as well.
>>
>> The old code used automake conditionals to handle systems that were
>> missing strerror_r and wait4.  Rather than deal with those in Go,
>> those functions are now implemented in runtime/go-nosys.c when
>> necessary, so the Go code can simply assume that they exist.
>>
>> The os testsuite looked for dir_unix.go, which was never built for
>> gccgo and has now been removed.  I changed the testsuite to look for
>> dir.go instead.
>>
>> Note that if you have an existing build directory, you will have to
>> remove all the .dep files in TARGET/libgo after updating to this
>> patch.  There isn't anything that will force them to update
>> automatically.
>>
>> Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
>> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
>>
>> Ian
>
> This appears to break libgo build on s390x:
>
> libtool: compile:  /home3/andreas/clean/gcc-7.0.0-64-clean-build/./gcc/gccgo
> -B/home3/andreas/clean/gcc-7.0.0-64-clean-build/./gcc/
> -B/home3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/bin/ 
> -B/h
> ome3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/lib/ 
> -isystem
> /home3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/include 
> -isystem
> /home3/andreas/clean/gcc-7.0.0-64-clean-instal
> l/s390x-ibm-linux-gnu/sys-include -O2 -g -I . -c -fgo-pkgpath=hash/crc32
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32.go
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go 
> /home3/andreas/c
> lean/../gcc/libgo/go/hash/crc32/crc32_s390x.go  -fPIC -o hash/.libs/crc32.o
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_s390x.go:56:1: error: 
> redefinition of
> ‘updateCastagnoli’
>  func updateCastagnoli(crc uint32, p []byte) uint32 {
>  ^
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go:12:1: note: 
> previous definition of
> ‘updateCastagnoli’ was here
>  func updateCastagnoli(crc uint32, p []byte) uint32 {
>  ^
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_s390x.go:81:1: error: 
> redefinition of ‘updateIEEE’
>  func updateIEEE(crc uint32, p []byte) uint32 {
>  ^
> /home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go:20:1: note: 
> previous definition of
> ‘updateIEEE’ was here
>  func updateIEEE(crc uint32, p []byte) uint32 {
>  ^
> make[4]: *** [hash/crc32.lo] Error 1
> make[4]: *** Waiting for unfinished jobs
>
>
> Adding more "build ignore"s does fix the build for me.

Thanks for the patch.  Committed.   (FYI, you shouldn't make changes
directly to libgo in the GCC repository--the files there are copied
from a separate repository.  See libgo/README.)


> However, I'm wondering why we have to disable the asm tuned files for gccgo? 
> For s390 I really would
> like to enable them since they make a huge difference.

I would like to enable them also.  They are not enabled today because
the assembler code is written in the syntax accepted by
https://golang.org/cmd/asm.  The files in question are

https://tip.golang.org/src/crypto/aes/asm_s390x.s
https://tip.golang.org/src/hash/crc32/crc32_s390x.s

If someone could rewrite those into gas syntax, we could use them in gccgo.


> The same is probably also required in ./hash/crc32/crc32_amd64p32.go
> I could add this as well.

It is not needed there, because GOARCH will never match amd64p32.
That is only used for NaCL, which gccgo does not support.

Ian


Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Ian Lance Taylor
On Fri, Aug 12, 2016 at 2:15 AM, Rainer Orth
 wrote:
>
>>> this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
>>> bootstrap, however: in both cases, the 64-bit build of os.lo fails like 
>>> this:
>>>
>>> /vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
>>> undefined name 'libc_readdir_r'
>>>i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
>>> ^
>>>
>>> Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
>>> nor dir_regfile.go (which is needed here) is included in the
>>> compilation.
>>
>> Sorry, I don't know what I messed up in my testing.  I committed the
>> appended patch, which should fix the problem.
>
> I had found a different one to the same effect, but running match.sh
> with yours looked right, too.
>
> There's now one new failure, 32 and 64-bit, sparc and x86:
>
> +FAIL: syscall
>
> libgo.log shows
>
> libcalls.go:825:1: error: redefinition of 'Getpgid'
>  func Getpgid(pid int) (pgid int, err error) {
>  ^
> exec_solaris_test.go:22:1: note: previous definition of 'Getpgid' was here
>  func Getpgid(pid int) (pgid int, err error) {
>  ^
> libcalls.go:843:1: error: redefinition of 'Getpgrp'
>  func Getpgrp() (pid int) {
>  ^
> exec_solaris_test.go:31:1: note: previous definition of 'Getpgrp' was here
>  func Getpgrp() (pgrp int) {
>  ^
> exec_solaris_test.go:14:3: error: libc_Getpgid is not a function; 
> //go:linkname is only supported for functions
>  //go:linkname libc_Getpgid libc_Getpgid
>^
> exec_solaris_test.go:15:3: error: libc_Getpgrp is not a function; 
> //go:linkname is only supported for functions
>  //go:linkname libc_Getpgrp libc_Getpgrp
>^
> exec_solaris_test.go:23:15: error: reference to undefined name 'sysvicall6'
>   r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(_Getpgid)), 1, 
> uintptr(pid), 0, 0, 0, 0, 0)
>^
> exec_solaris_test.go:32:14: error: reference to undefined name 'sysvicall6'
>   r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(_Getpgrp)), 0, 0, 0, 0, 
> 0, 0, 0)
>   ^
> exec_solaris_test.go:37:13: error: reference to undefined name 'ioctl'
>  var Ioctl = ioctl
>  ^
> exec_solaris_test.go:19:15: error: use of undefined type 'libcFunc'
>   libc_Getpgrp libcFunc
>^
>
> I've no idea what exec_solaris_test.go is about: e.g.I couldn't find any
> other reference to sysvicall6 elsewhere in the gcc tree.

The file syscall/exec_solaris_test.go is verifying that the somewhat
unusual way that Solaris support is implemented in the gc toolchain
works correctly.  It is meaningless and unnecessary for gccgo.  I
removed it.  Patch bootstrapped and tested on x86_64-pc-linux-gnu,
which I admit means nothing.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 239393)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-fe1e77f843220503f1f8d5ea7dd5e307580e1d38
+cf91720c650f2cdbd8153a5a5f048793cfab3966
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/syscall/exec_solaris_test.go
===
--- libgo/go/syscall/exec_solaris_test.go   (revision 238653)
+++ libgo/go/syscall/exec_solaris_test.go   (working copy)
@@ -1,37 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package syscall
-
-import "unsafe"
-
-//go:cgo_import_dynamic libc_Getpgid getpgid "libc.so"
-//go:cgo_import_dynamic libc_Getpgrp getpgrp "libc.so"
-
-//go:linkname libc_Getpgid libc_Getpgid
-//go:linkname libc_Getpgrp libc_Getpgrp
-
-var (
-   libc_Getpgid,
-   libc_Getpgrp libcFunc
-)
-
-func Getpgid(pid int) (pgid int, err error) {
-   r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(_Getpgid)), 1, 
uintptr(pid), 0, 0, 0, 0, 0)
-   pgid = int(r0)
-   if e1 != 0 {
-   err = e1
-   }
-   return
-}
-
-func Getpgrp() (pgrp int) {
-   r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(_Getpgrp)), 0, 0, 0, 
0, 0, 0, 0)
-   pgrp = int(r0)
-   return
-}
-
-var Ioctl = ioctl


Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Rainer Orth
Hi Ian,

>>> this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
>>> bootstrap, however: in both cases, the 64-bit build of os.lo fails like 
>>> this:
>>>
>>> /vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
>>> undefined name 'libc_readdir_r'
>>>i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
>>> ^
>>>
>>> Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
>>> nor dir_regfile.go (which is needed here) is included in the
>>> compilation.
>>
>> Sorry, I don't know what I messed up in my testing.  I committed the
>> appended patch, which should fix the problem.
>
> I had found a different one to the same effect, but running match.sh
> with yours looked right, too.

here's another issue found during wider testing: on Solaris 10 with
/bin/ksh as CONFIG_SHELL, the build aborts like this:

objcopy: 'bufio.o': No such file
Makefile:5072: recipe for target 'bufio.gox' failed
make[4]: *** [bufio.gox] Error 1

It turns out that no bufio.o is created indeed:

/vol/gcc/src/hg/trunk/local/libgo/../install-sh -c -d .; files=`echo  | sed -e 
's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; /bin/ksh ./libtool --tag GO 
--mode=compile /var/gcc/regression/trunk/10-gcc/build/./gcc/gccgo 
-B/var/gcc/regression/trunk/10-gcc/build/./gcc/ 
-B/vol/gcc/i386-pc-solaris2.10/bin/ -B/vol/gcc/i386-pc-solaris2.10/lib/ 
-isystem /vol/gcc/i386-pc-solaris2.10/include -isystem 
/vol/gcc/i386-pc-solaris2.10/sys-include -minline-all-stringops  -g -O2 -I 
. -c -fgo-pkgpath=`echo bufio.lo | sed -e 's/.lo$//' -e 's/-go$//'` -o bufio.lo 
$files

The list of input files, output from the likes of

/bin/ksh /vol/gcc/src/hg/trunk/local/libgo/match.sh --goarch=386 --goos=solaris 
--srcdir=/vol/gcc/src/hg/trunk/local/libgo/go/bufio --extrafiles=""

is empty.  Running match.sh with /bin/ksh -x reveals

+ set -e
+ unset LANG

where the script aborts.  It turns out that /bin/ksh errors out on an
unset of a variable that isn't set.

Maybe one could explicitly set LANG=C here, or use the `portable unset'
used in configure?

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Andreas Krebbel
On 08/06/2016 02:36 AM, Ian Lance Taylor wrote:
> Go packages use build tags (see the section on Build Constraints at
> https://golang.org/pkg/go/build/) to select which files to build on
> specific systems.
> 
> Previously the libgo Makefile explicitly listed the set of files to
> compile for each package.  For packages that use build tags, this
> required a lot of awkward automake conditionals in the Makefile.
> 
> This patch changes the build to look at the build tags in the files.
> The new shell script libgo/match.sh does the matching.  This required
> adjusting a lot of build tags, and removing some files that are never
> used.  I verified that the exact same sets of files are compiled on
> x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
> (building for both 32-bit and 64-bit).
> 
> Writing match.sh revealed some bugs in the build tag handling that
> already exists, in a slightly different form, in the gotest shell
> script.  This patch fixes those problems as well.
> 
> The old code used automake conditionals to handle systems that were
> missing strerror_r and wait4.  Rather than deal with those in Go,
> those functions are now implemented in runtime/go-nosys.c when
> necessary, so the Go code can simply assume that they exist.
> 
> The os testsuite looked for dir_unix.go, which was never built for
> gccgo and has now been removed.  I changed the testsuite to look for
> dir.go instead.
> 
> Note that if you have an existing build directory, you will have to
> remove all the .dep files in TARGET/libgo after updating to this
> patch.  There isn't anything that will force them to update
> automatically.
> 
> Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
> 
> Ian

This appears to break libgo build on s390x:

libtool: compile:  /home3/andreas/clean/gcc-7.0.0-64-clean-build/./gcc/gccgo
-B/home3/andreas/clean/gcc-7.0.0-64-clean-build/./gcc/
-B/home3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/bin/ -B/h
ome3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/lib/ -isystem
/home3/andreas/clean/gcc-7.0.0-64-clean-install/s390x-ibm-linux-gnu/include 
-isystem
/home3/andreas/clean/gcc-7.0.0-64-clean-instal
l/s390x-ibm-linux-gnu/sys-include -O2 -g -I . -c -fgo-pkgpath=hash/crc32
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32.go
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go 
/home3/andreas/c
lean/../gcc/libgo/go/hash/crc32/crc32_s390x.go  -fPIC -o hash/.libs/crc32.o
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_s390x.go:56:1: error: 
redefinition of
‘updateCastagnoli’
 func updateCastagnoli(crc uint32, p []byte) uint32 {
 ^
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go:12:1: note: 
previous definition of
‘updateCastagnoli’ was here
 func updateCastagnoli(crc uint32, p []byte) uint32 {
 ^
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_s390x.go:81:1: error: 
redefinition of ‘updateIEEE’
 func updateIEEE(crc uint32, p []byte) uint32 {
 ^
/home3/andreas/clean/../gcc/libgo/go/hash/crc32/crc32_generic.go:20:1: note: 
previous definition of
‘updateIEEE’ was here
 func updateIEEE(crc uint32, p []byte) uint32 {
 ^
make[4]: *** [hash/crc32.lo] Error 1
make[4]: *** Waiting for unfinished jobs


Adding more "build ignore"s does fix the build for me.

However, I'm wondering why we have to disable the asm tuned files for gccgo? 
For s390 I really would
like to enable them since they make a huge difference.

The same is probably also required in ./hash/crc32/crc32_amd64p32.go
I could add this as well.

Ok to apply?

diff --git a/libgo/go/crypto/aes/cbc_s390x.go b/libgo/go/crypto/aes/cbc_s390x.go
index 427b30b..8346b5e 100644
--- a/libgo/go/crypto/aes/cbc_s390x.go
+++ b/libgo/go/crypto/aes/cbc_s390x.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.

+// +build ignore
+
 package aes

 import (
diff --git a/libgo/go/crypto/aes/ctr_s390x.go b/libgo/go/crypto/aes/ctr_s390x.go
index 94dea5c..ae09dba 100644
--- a/libgo/go/crypto/aes/ctr_s390x.go
+++ b/libgo/go/crypto/aes/ctr_s390x.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.

+// +build ignore
+
 package aes

 import (
diff --git a/libgo/go/hash/crc32/crc32_s390x.go 
b/libgo/go/hash/crc32/crc32_s390x.go
index 2f20690..b8a5808 100644
--- a/libgo/go/hash/crc32/crc32_s390x.go
+++ b/libgo/go/hash/crc32/crc32_s390x.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.

+// +build ignore
+
 package crc32

 import (



Re: libgo patch committed: Change build procedure to use build tags

2016-08-12 Thread Rainer Orth
Hi Ian,

>> this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
>> bootstrap, however: in both cases, the 64-bit build of os.lo fails like this:
>>
>> /vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
>> undefined name 'libc_readdir_r'
>>i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
>> ^
>>
>> Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
>> nor dir_regfile.go (which is needed here) is included in the
>> compilation.
>
> Sorry, I don't know what I messed up in my testing.  I committed the
> appended patch, which should fix the problem.

I had found a different one to the same effect, but running match.sh
with yours looked right, too.

There's now one new failure, 32 and 64-bit, sparc and x86:

+FAIL: syscall

libgo.log shows

libcalls.go:825:1: error: redefinition of 'Getpgid'
 func Getpgid(pid int) (pgid int, err error) {
 ^
exec_solaris_test.go:22:1: note: previous definition of 'Getpgid' was here
 func Getpgid(pid int) (pgid int, err error) {
 ^
libcalls.go:843:1: error: redefinition of 'Getpgrp'
 func Getpgrp() (pid int) {
 ^
exec_solaris_test.go:31:1: note: previous definition of 'Getpgrp' was here
 func Getpgrp() (pgrp int) {
 ^
exec_solaris_test.go:14:3: error: libc_Getpgid is not a function; //go:linkname 
is only supported for functions
 //go:linkname libc_Getpgid libc_Getpgid
   ^
exec_solaris_test.go:15:3: error: libc_Getpgrp is not a function; //go:linkname 
is only supported for functions
 //go:linkname libc_Getpgrp libc_Getpgrp
   ^
exec_solaris_test.go:23:15: error: reference to undefined name 'sysvicall6'
  r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(_Getpgid)), 1, 
uintptr(pid), 0, 0, 0, 0, 0)
   ^
exec_solaris_test.go:32:14: error: reference to undefined name 'sysvicall6'
  r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(_Getpgrp)), 0, 0, 0, 0, 0, 
0, 0)
  ^
exec_solaris_test.go:37:13: error: reference to undefined name 'ioctl'
 var Ioctl = ioctl
 ^
exec_solaris_test.go:19:15: error: use of undefined type 'libcFunc'
  libc_Getpgrp libcFunc
   ^

I've no idea what exec_solaris_test.go is about: e.g.I couldn't find any
other reference to sysvicall6 elsewhere in the gcc tree.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: libgo patch committed: Change build procedure to use build tags

2016-08-11 Thread Ian Lance Taylor
On Thu, Aug 11, 2016 at 8:15 AM, Rainer Orth
 wrote:
>
>> Go packages use build tags (see the section on Build Constraints at
>> https://golang.org/pkg/go/build/) to select which files to build on
>> specific systems.
>>
>> Previously the libgo Makefile explicitly listed the set of files to
>> compile for each package.  For packages that use build tags, this
>> required a lot of awkward automake conditionals in the Makefile.
>>
>> This patch changes the build to look at the build tags in the files.
>> The new shell script libgo/match.sh does the matching.  This required
>> adjusting a lot of build tags, and removing some files that are never
>> used.  I verified that the exact same sets of files are compiled on
>> x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
>> (building for both 32-bit and 64-bit).
>>
>> Writing match.sh revealed some bugs in the build tag handling that
>> already exists, in a slightly different form, in the gotest shell
>> script.  This patch fixes those problems as well.
>>
>> The old code used automake conditionals to handle systems that were
>> missing strerror_r and wait4.  Rather than deal with those in Go,
>> those functions are now implemented in runtime/go-nosys.c when
>> necessary, so the Go code can simply assume that they exist.
>>
>> The os testsuite looked for dir_unix.go, which was never built for
>> gccgo and has now been removed.  I changed the testsuite to look for
>> dir.go instead.
>>
>> Note that if you have an existing build directory, you will have to
>> remove all the .dep files in TARGET/libgo after updating to this
>> patch.  There isn't anything that will force them to update
>> automatically.
>>
>> Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
>> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
>
> this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
> bootstrap, however: in both cases, the 64-bit build of os.lo fails like this:
>
> /vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
> undefined name 'libc_readdir_r'
>i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
> ^
>
> Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
> nor dir_regfile.go (which is needed here) is included in the
> compilation.

Sorry, I don't know what I messed up in my testing.  I committed the
appended patch, which should fix the problem.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 239332)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-5e05b7bc947231b4d5a8327bf63e2fa648e51dc7
+fe1e77f843220503f1f8d5ea7dd5e307580e1d38
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/os/dir_regfile.go
===
--- libgo/go/os/dir_regfile.go  (revision 239189)
+++ libgo/go/os/dir_regfile.go  (working copy)
@@ -6,8 +6,8 @@
 // license that can be found in the LICENSE file.
 
 // +build !linux
-// +build !solaris,386
-// +build !solaris,sparc
+// +build !solaris !386
+// +build !solaris !sparc
 
 package os
 


Re: libgo patch committed: Change build procedure to use build tags

2016-08-11 Thread Rainer Orth
Hi Ian,

> Go packages use build tags (see the section on Build Constraints at
> https://golang.org/pkg/go/build/) to select which files to build on
> specific systems.
>
> Previously the libgo Makefile explicitly listed the set of files to
> compile for each package.  For packages that use build tags, this
> required a lot of awkward automake conditionals in the Makefile.
>
> This patch changes the build to look at the build tags in the files.
> The new shell script libgo/match.sh does the matching.  This required
> adjusting a lot of build tags, and removing some files that are never
> used.  I verified that the exact same sets of files are compiled on
> x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
> (building for both 32-bit and 64-bit).
>
> Writing match.sh revealed some bugs in the build tag handling that
> already exists, in a slightly different form, in the gotest shell
> script.  This patch fixes those problems as well.
>
> The old code used automake conditionals to handle systems that were
> missing strerror_r and wait4.  Rather than deal with those in Go,
> those functions are now implemented in runtime/go-nosys.c when
> necessary, so the Go code can simply assume that they exist.
>
> The os testsuite looked for dir_unix.go, which was never built for
> gccgo and has now been removed.  I changed the testsuite to look for
> dir.go instead.
>
> Note that if you have an existing build directory, you will have to
> remove all the .dep files in TARGET/libgo after updating to this
> patch.  There isn't anything that will force them to update
> automatically.
>
> Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

this patch broke i386-pc-solaris2.12 and sparc-sun-solaris2.12
bootstrap, however: in both cases, the 64-bit build of os.lo fails like this:

/vol/gcc/src/hg/trunk/local/libgo/go/os/dir.go:82:8: error: reference to 
undefined name 'libc_readdir_r'
   i := libc_readdir_r(file.dirinfo.dir, entryDirent, pr)
^

Neither dir_largefile.go (which is correctly omitted, being 32-bit only)
nor dir_regfile.go (which is needed here) is included in the
compilation.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: libgo patch committed: Change build procedure to use build tags

2016-08-09 Thread Lynn A. Boger
libgo test results in gcc-testresults for ppc64le & ppc64 are back to 
what they were before the change.


Thanks.

On 08/08/2016 03:34 PM, Ian Lance Taylor wrote:

On Mon, Aug 8, 2016 at 11:14 AM, Lynn A. Boger
 wrote:

The libgo tests on ppc64le and ppc64 have all been failing in
gcc-testresults since this change went in and continues to fail after the
recent fixes for failures on other platforms.

Built myself and got the same failures.  I set keep=true in gotest to save
the test dirs.  Just running a single package:

make bufio/check
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not
found
Keeping gotest9734
FAIL: bufio
Makefile:3645: recipe for target 'bufio/check' failed
make: *** [bufio/check] Error 1
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ ls
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ file
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go: ASCII text

I found the problem.  I always configure with a relative srcdir.  You
are using an absolute srcdir.  The recent changes to use build tags
changed the libgo Makefile so that when invoked with with an absolute
srcdir it would pass absolute path names to the gotest script.  That
never worked.  This patch makes it work, and should fix your problem.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu with a
relative srcdir and an absolute srcdir.  Committed to mainline.

Ian




Re: libgo patch committed: Change build procedure to use build tags

2016-08-08 Thread Ian Lance Taylor
On Mon, Aug 8, 2016 at 11:14 AM, Lynn A. Boger
 wrote:
> The libgo tests on ppc64le and ppc64 have all been failing in
> gcc-testresults since this change went in and continues to fail after the
> recent fixes for failures on other platforms.
>
> Built myself and got the same failures.  I set keep=true in gotest to save
> the test dirs.  Just running a single package:
>
> make bufio/check
> file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not
> found
> Keeping gotest9734
> FAIL: bufio
> Makefile:3645: recipe for target 'bufio/check' failed
> make: *** [bufio/check] Error 1
> boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ ls
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ file
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go: ASCII text

I found the problem.  I always configure with a relative srcdir.  You
are using an absolute srcdir.  The recent changes to use build tags
changed the libgo Makefile so that when invoked with with an absolute
srcdir it would pass absolute path names to the gotest script.  That
never worked.  This patch makes it work, and should fix your problem.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu with a
relative srcdir and an absolute srcdir.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 239252)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-5e4c16d4fea39835e16f17c3d2b2e85f5c81d815
+2c88d4871558f0451a0ad152a7052dcfaecb254f
 
 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 239225)
+++ libgo/testsuite/gotest  (working copy)
@@ -217,18 +217,27 @@ x)
;;
*)
for f in $pkgfiles; do
-   if test -f $basedir/$f; then
-   b=`basename $f`
-   rm -f $b
-   cp $basedir/$f $b
-   elif test -f ../../$f; then
-   b=`basename $f`
-   rm -f $b
-   cp ../../$f $b
-   else
-   echo "file $f not found" 1>&2
-   exit 1
-   fi
+case $f in
+/*)
+b=`basename $f`
+rm -f $b
+cp $f $b
+;;
+*)
+   if test -f $basedir/$f; then
+ b=`basename $f`
+ rm -f $b
+ cp $basedir/$f $b
+   elif test -f ../../$f; then
+ b=`basename $f`
+ rm -f $b
+ cp ../../$f $b
+   else
+ echo "file $f not found" 1>&2
+ exit 1
+   fi
+;;
+esac
done
for f in `cd $srcdir; ls *_test.go`; do
rm -f $f
@@ -252,18 +261,27 @@ x)
;;
*)
for f in $pkgfiles; do
-   if test -f $basedir/$f; then
-   b=`basename $f`
-   rm -f $b
-   cp $basedir/$f $b
-   elif test -f ../../$f; then
-   b=`basename $f`
-   rm -f $b
-   cp ../../$f $b
-   else
-   echo "file $f not found" 1>&2
-   exit 1
-   fi
+case $f in
+/*)
+b=`basename $f`
+rm -f $b
+cp $f $b
+;;
+*)
+   if test -f $basedir/$f; then
+ b=`basename $f`
+ rm -f $b
+ cp $basedir/$f $b
+   elif test -f ../../$f; then
+ b=`basename $f`
+ rm -f $b
+ cp ../../$f $b
+   else
+ echo "file $f not found" 1>&2
+ exit 1
+   fi
+;;
+esac
done
;;
esac


Re: libgo patch committed: Change build procedure to use build tags

2016-08-08 Thread Lynn A. Boger
Sorry if I was unclear.  Failures started happening with r239189, and it 
continues to fail in the most recent commit, so none of the later 
changes fixed the problem.


Only happens on trunk, ppc64le & ppc64 (m32 also).  I did my build on a 
different machine from the gcc-testresults build just to be sure there 
wasn't something flaky with the system.


On 08/08/2016 01:26 PM, Ian Lance Taylor wrote:

On Mon, Aug 8, 2016 at 11:14 AM, Lynn A. Boger
 wrote:

The libgo tests on ppc64le and ppc64 have all been failing in
gcc-testresults since this change went in and continues to fail after the
recent fixes for failures on other platforms.

Built myself and got the same failures.  I set keep=true in gotest to save
the test dirs.  Just running a single package:

make bufio/check
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not
found
Keeping gotest9734
FAIL: bufio
Makefile:3645: recipe for target 'bufio/check' failed
make: *** [bufio/check] Error 1
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ ls
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ file
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go: ASCII text

I do not know what would cause that and I'm not seeing it.  I don't
see how it could be related to the most recent patch (SVN revision
239225); was your build working before that patch and failing
afterward?

There is another report of the same problem on IRC so it's not just you.

Ian






Re: libgo patch committed: Change build procedure to use build tags

2016-08-08 Thread Ian Lance Taylor
On Mon, Aug 8, 2016 at 11:14 AM, Lynn A. Boger
 wrote:
>
> The libgo tests on ppc64le and ppc64 have all been failing in
> gcc-testresults since this change went in and continues to fail after the
> recent fixes for failures on other platforms.
>
> Built myself and got the same failures.  I set keep=true in gotest to save
> the test dirs.  Just running a single package:
>
> make bufio/check
> file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not
> found
> Keeping gotest9734
> FAIL: bufio
> Makefile:3645: recipe for target 'bufio/check' failed
> make: *** [bufio/check] Error 1
> boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ ls
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ file
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
> /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go: ASCII text

I do not know what would cause that and I'm not seeing it.  I don't
see how it could be related to the most recent patch (SVN revision
239225); was your build working before that patch and failing
afterward?

There is another report of the same problem on IRC so it's not just you.

Ian


Re: libgo patch committed: Change build procedure to use build tags

2016-08-08 Thread Lynn A. Boger
The libgo tests on ppc64le and ppc64 have all been failing in 
gcc-testresults since this change went in and continues to fail after 
the recent fixes for failures on other platforms.


Built myself and got the same failures.  I set keep=true in gotest to 
save the test dirs.  Just running a single package:


make bufio/check
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not 
found

Keeping gotest9734
FAIL: bufio
Makefile:3645: recipe for target 'bufio/check' failed
make: *** [bufio/check] Error 1
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ ls 
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go

/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go
boger@willow3:~/gccgo.work/trunk/bld/powerpc64le-linux/libgo$ file 
/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go

/home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go: ASCII text

The gotest saved test directory contains the go file they are looking for.

ls ./powerpc64le-linux/libgo/gotest9734/test/bufio.go
./powerpc64le-linux/libgo/gotest9734/test/bufio.go

Likewise for all when doing make check-target-libgo

=== libgo tests ===

file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bufio/bufio.go not 
found

Keeping gotest10016
FAIL: bufio
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/bytes/buffer.go 
not found

Keeping gotest10106
FAIL: bytes
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/context/context.go 
not found

Keeping gotest10166
FAIL: context
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/errors/errors.go 
not found

Keeping gotest10226
FAIL: errors
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/expvar/expvar.go 
not found

Keeping gotest10286
FAIL: expvar
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/flag/flag.go not found
Keeping gotest10346
FAIL: flag
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/fmt/doc.go not found
Keeping gotest10436
FAIL: fmt
file /home/boger/gccgo.work/trunk/bld/../src/libgo/go/html/entity.go not 
found

Keeping gotest10506
FAIL: html
.

On 08/05/2016 07:36 PM, Ian Lance Taylor wrote:

Go packages use build tags (see the section on Build Constraints at
https://golang.org/pkg/go/build/) to select which files to build on
specific systems.

Previously the libgo Makefile explicitly listed the set of files to
compile for each package.  For packages that use build tags, this
required a lot of awkward automake conditionals in the Makefile.

This patch changes the build to look at the build tags in the files.
The new shell script libgo/match.sh does the matching.  This required
adjusting a lot of build tags, and removing some files that are never
used.  I verified that the exact same sets of files are compiled on
x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
(building for both 32-bit and 64-bit).

Writing match.sh revealed some bugs in the build tag handling that
already exists, in a slightly different form, in the gotest shell
script.  This patch fixes those problems as well.

The old code used automake conditionals to handle systems that were
missing strerror_r and wait4.  Rather than deal with those in Go,
those functions are now implemented in runtime/go-nosys.c when
necessary, so the Go code can simply assume that they exist.

The os testsuite looked for dir_unix.go, which was never built for
gccgo and has now been removed.  I changed the testsuite to look for
dir.go instead.

Note that if you have an existing build directory, you will have to
remove all the .dep files in TARGET/libgo after updating to this
patch.  There isn't anything that will force them to update
automatically.

Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian




Re: libgo patch committed: Change build procedure to use build tags

2016-08-07 Thread Ian Lance Taylor
On Sun, Aug 7, 2016 at 8:18 AM, Matthias Klose  wrote:
> On 07.08.2016 14:14, Andreas Schwab wrote:
>> That breaks ia64:
>>
>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:29:5: error: 
>> reference to undefined name 'randomTrap'
>>   if randomTrap == 0 {
>>  ^
>> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:38:34: error: 
>> reference to undefined name 'randomTrap'
>>   r1, _, errno := syscall.Syscall(randomTrap,
>>   ^
>> make[4]: *** [internal/syscall/unix.lo] Error 1
>
> same on s390x.

Thanks for the reports.  This patch should fix these problems, and
also fix the build for Alpha GNU/Linux.  Bootstrapped on
x86_64-pc-linux-gnu and verified that the ia64, s390, and alpha should
pick the right files.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 239210)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-b50a0c3fa975186f934b76e25dae42eb65148d67
+ff3e3dd6c09aaefdf13cce99a5beff47a095
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/configure.ac
===
--- libgo/configure.ac  (revision 238743)
+++ libgo/configure.ac  (working copy)
@@ -191,6 +191,7 @@ is_386=no
 is_alpha=no
 is_arm=no
 is_arm64=no
+is_ia64=no
 is_m68k=no
 mips_abi=unknown
 is_ppc=no
@@ -229,6 +230,10 @@ changequote([,])dnl
   GOARCH=amd64
 fi
 ;;
+  ia64-*-*)
+is_ia64=yes
+GOARCH=ia64
+;;
   m68k*-*-*)
 is_m68k=yes
 GOARCH=m68k
@@ -311,6 +316,7 @@ AM_CONDITIONAL(LIBGO_IS_386, test $is_38
 AM_CONDITIONAL(LIBGO_IS_ALPHA, test $is_alpha = yes)
 AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes)
 AM_CONDITIONAL(LIBGO_IS_ARM64, test $is_arm64 = yes)
+AM_CONDITIONAL(LIBGO_IS_IA64, test $is_ia64 = yes)
 AM_CONDITIONAL(LIBGO_IS_M68K, test $is_m68k = yes)
 AM_CONDITIONAL(LIBGO_IS_MIPS, test $mips_abi != unknown)
 AM_CONDITIONAL(LIBGO_IS_MIPSO32, test $mips_abi = o32)
Index: libgo/go/internal/syscall/unix/getrandom_linux_alpha.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_alpha.go (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_alpha.go (working copy)
@@ -0,0 +1,9 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 511
Index: libgo/go/internal/syscall/unix/getrandom_linux_ia64.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_ia64.go  (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_ia64.go  (working copy)
@@ -0,0 +1,9 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 1339
Index: libgo/go/internal/syscall/unix/getrandom_linux_s390.go
===
--- libgo/go/internal/syscall/unix/getrandom_linux_s390.go  (revision 0)
+++ libgo/go/internal/syscall/unix/getrandom_linux_s390.go  (working copy)
@@ -0,0 +1,9 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package unix
+
+// Linux getrandom system call number.
+// See GetRandom in getrandom_linux.go.
+const randomTrap uintptr = 349
Index: libgo/match.sh
===
--- libgo/match.sh  (revision 239189)
+++ libgo/match.sh  (working copy)
@@ -116,7 +116,7 @@ for f in $gofiles; do
android | darwin | dragonfly | freebsd | linux | nacl | netbsd | 
openbsd | plan9 | solaris | windows)
tag1=nonmatchingtag
;;
-   386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | m68k | 
ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | 
mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64)
+   386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | 
m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | 
mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | 
sparc | sparc64)
tag1=nonmatchingtag
;;
 esac
@@ -128,7 +128,7 @@ for f in $gofiles; do
android | darwin | dragonfly | freebsd | linux | nacl | netbsd | 
openbsd | plan9 | solaris | 

Re: libgo patch committed: Change build procedure to use build tags

2016-08-07 Thread Matthias Klose
On 07.08.2016 14:14, Andreas Schwab wrote:
> That breaks ia64:
> 
> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:29:5: error: 
> reference to undefined name 'randomTrap'
>   if randomTrap == 0 {
>  ^
> ../../../libgo/go/internal/syscall/unix/getrandom_linux.go:38:34: error: 
> reference to undefined name 'randomTrap'
>   r1, _, errno := syscall.Syscall(randomTrap,
>   ^
> make[4]: *** [internal/syscall/unix.lo] Error 1

same on s390x.



Re: libgo patch committed: Change build procedure to use build tags

2016-08-07 Thread Andreas Schwab
That breaks ia64:

../../../libgo/go/internal/syscall/unix/getrandom_linux.go:29:5: error: 
reference to undefined name 'randomTrap'
  if randomTrap == 0 {
 ^
../../../libgo/go/internal/syscall/unix/getrandom_linux.go:38:34: error: 
reference to undefined name 'randomTrap'
  r1, _, errno := syscall.Syscall(randomTrap,
  ^
make[4]: *** [internal/syscall/unix.lo] Error 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


libgo patch committed: Change build procedure to use build tags

2016-08-05 Thread Ian Lance Taylor
Go packages use build tags (see the section on Build Constraints at
https://golang.org/pkg/go/build/) to select which files to build on
specific systems.

Previously the libgo Makefile explicitly listed the set of files to
compile for each package.  For packages that use build tags, this
required a lot of awkward automake conditionals in the Makefile.

This patch changes the build to look at the build tags in the files.
The new shell script libgo/match.sh does the matching.  This required
adjusting a lot of build tags, and removing some files that are never
used.  I verified that the exact same sets of files are compiled on
x86_64-pc-linux-gnu.  I also tested the build on i386-sun-solaris
(building for both 32-bit and 64-bit).

Writing match.sh revealed some bugs in the build tag handling that
already exists, in a slightly different form, in the gotest shell
script.  This patch fixes those problems as well.

The old code used automake conditionals to handle systems that were
missing strerror_r and wait4.  Rather than deal with those in Go,
those functions are now implemented in runtime/go-nosys.c when
necessary, so the Go code can simply assume that they exist.

The os testsuite looked for dir_unix.go, which was never built for
gccgo and has now been removed.  I changed the testsuite to look for
dir.go instead.

Note that if you have an existing build directory, you will have to
remove all the .dep files in TARGET/libgo after updating to this
patch.  There isn't anything that will force them to update
automatically.

Bootstrapped on x86_64-pc-linux-gnu and i386-sun-solaris.  Ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian


patch.txt.bz2
Description: BZip2 compressed data