This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Update to 1.11 release
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Ian Lance Taylor <iant at golang dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, gofrontend-dev at googlegroups dot com
- Date: Tue, 25 Sep 2018 15:05:14 +0200
- Subject: Re: libgo patch committed: Update to 1.11 release
- References: <CAOyqgcUgXMYAkVQco8dcmEChazODizFkZwUiH01jPEpnWNvS3w@mail.gmail.com>
Hi Ian,
> I've committed a patch to update libgo to the 1.11 release. As usual
> for these updates, the patch is too large to attach to this e-mail
> message. I've attached some of the more relevant directories. This
> update required some minor patches to the gotools directory and the Go
> testsuite, also included here. Bootstrapped and ran Go testsuite on
> x86_64-pc-linux-gnu. Committed to mainline.
this patch broke Solaris badly, too.
On Solaris 11/SPARC:
*
/vol/gcc/src/hg/trunk/local/libgo/go/internal/cpu/cpu.go:21:16: error: reference to undefined name 'CacheLineSize'
21 | _ [CacheLineSize]byte
| ^
and many more. I've introduced cpu_sparc.go and cpu_sparc64.go to
define the constant. However, the value is just an initial guess; I've
not yet checked if it's correct for all SPARC implementations.
*
/vol/gcc/src/hg/trunk/local/libgo/go/internal/bytealg/indexbyte_native.go:10:1: error: redefinition of 'IndexByte'
10 | func IndexByte(b []byte, c byte) int
| ^
/vol/gcc/src/hg/trunk/local/libgo/go/internal/bytealg/indexbyte_generic.go:12:1: note: previous definition of 'IndexByte' was here
12 | func IndexByte(b []byte, c byte) int {
| ^
/vol/gcc/src/hg/trunk/local/libgo/go/internal/bytealg/indexbyte_native.go:13:1: error: redefinition of 'IndexByteString'
13 | func IndexByteString(s string, c byte) int
| ^
/vol/gcc/src/hg/trunk/local/libgo/go/internal/bytealg/indexbyte_generic.go:21:1: note: previous definition of 'IndexByteString' was here
21 | func IndexByteString(s string, c byte) int {
| ^
Fixed by adding sparc build tags to indexbyte_{generic, native}.go.
It seems +ignore_for_gccgo in the former is itself ignored.
On both Solaris 11/SPARC and x86:
*
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/runtime1.go:75:2: error: reference to undefined name 'sysargs'
75 | sysargs(c, v)
| ^
sysargs is defined in go/runtime/auxv_none.go, go/runtime/os_linux.go
in the gcc tree.
The former excluded on solaris. I've removed the build tag in
auxv_none.go as hack, but auxv exists on Solaris, too! I happened to
find an implementation in upstream src/runtime/os3_solaris.go. But
what the heck is os{,2,3}_solaris.go!?
*
/vol/gcc/src/hg/trunk/local/libgo/go/runtime/traceback_gccgo.go:151:14: error: reference to undefined name 'nanotime'
151 | waitfor = (nanotime() - gp.waitsince) / 60e9
| ^
and many many more instances. Again, I found an implementation in
upstream src/runtime/os3_solaris.go, but that isn't usable since it
uses syscall directly.
So I'm currently stuck on the missing nanotime.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
# HG changeset patch
# Parent 8c2483dc7f68b764358ca7626f07fedeb1792a07
Fix go 1.11 libgo on Solaris
diff --git a/libgo/go/internal/bytealg/indexbyte_generic.go b/libgo/go/internal/bytealg/indexbyte_generic.go
--- a/libgo/go/internal/bytealg/indexbyte_generic.go
+++ b/libgo/go/internal/bytealg/indexbyte_generic.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// +ignore_for_gccgo
-// +build !386,!amd64,!amd64p32,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!mips64,!mips64le,!wasm
+// +build !386,!amd64,!amd64p32,!s390x,!arm,!arm64,!ppc64,!ppc64le,!mips,!mipsle,!mips64,!mips64le,!wasm,!sparc,!sparc64
package bytealg
diff --git a/libgo/go/internal/bytealg/indexbyte_native.go b/libgo/go/internal/bytealg/indexbyte_native.go
--- a/libgo/go/internal/bytealg/indexbyte_native.go
+++ b/libgo/go/internal/bytealg/indexbyte_native.go
@@ -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 386 amd64 amd64p32 s390x arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le wasm
+// -build 386 amd64 amd64p32 s390x arm arm64 ppc64 ppc64le mips mipsle mips64 mips64le wasm sparc sparc64
package bytealg
diff --git a/libgo/go/internal/cpu/cpu_sparc.go b/libgo/go/internal/cpu/cpu_sparc.go
new file mode 100644
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_sparc.go
@@ -0,0 +1,7 @@
+// Copyright 2018 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 cpu
+
+const CacheLineSize = 64
diff --git a/libgo/go/internal/cpu/cpu_sparc64.go b/libgo/go/internal/cpu/cpu_sparc64.go
new file mode 100644
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_sparc64.go
@@ -0,0 +1,7 @@
+// Copyright 2018 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 cpu
+
+const CacheLineSize = 64
diff --git a/libgo/go/runtime/auxv_none.go b/libgo/go/runtime/auxv_none.go
--- a/libgo/go/runtime/auxv_none.go
+++ b/libgo/go/runtime/auxv_none.go
@@ -7,7 +7,6 @@
// +build !dragonfly
// +build !freebsd
// +build !netbsd
-// +build !solaris
package runtime