Re: libgo patch committed: Update to Go1.16beta1 release
On Sat, Jan 2, 2021 at 6:14 AM Matthias Klose wrote: > > On 1/2/21 12:11 AM, Ian Lance Taylor wrote: > > On Thu, Dec 31, 2020 at 7:40 AM Matthias Klose wrote: > >> > >> On 12/31/20 12:14 AM, Ian Lance Taylor via Gcc-patches wrote: > >>> I've committed a patch to update libgo to the Go 1.16beta1 release. > >>> > >>> This patch does not include support for the new //go:embed directive > >>> that will be available in Go 1.16.1 (https://golang.org/issue/41191) > >>> Support for that requires compiler changes, which will come later. > >>> > >>> As usual with these big updates, I have not included the complete > >>> changes in this e-mail message, only changes that are gccgo-specific. > >>> > >>> Testing this requires some changes to gotools. > >>> > >>> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > >>> to mainline. > >> > >> also breaks the s390x 32bit multilib build (s390). > >> > >> ../../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to > >> undefined name 'doinit' > >> 123 | doinit() > >> | ^ > > > > The problems building the internal/cpu and golang.org/x/sys/cpu > > packages on less common architectures should be fixed by this patch. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > > to mainline. > > still ftbfs on power*, tested with a multilib build on powerpc64-linux-gnu. > patch attached, didn't check on aix. > > ../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined > name 'doinit' > 123 | doinit() > | ^ > > > ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:26:26: error: reference > to undefined name 'isSet' >26 | PPC64.IsPOWER9 = isSet(HWCap2, hwcap2_ARCH_3_00) > | ^ > ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:27:25: error: reference > to undefined name 'isSet' >27 | PPC64.HasDARN = isSet(HWCap2, hwcap2_DARN) > | ^ > ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:28:24: error: reference > to undefined name 'isSet' >28 | PPC64.HasSCV = isSet(HWCap2, hwcap2_SCV) > |^ This patch cleans up internal/cpu some more, including bringing in some files from the source repo. It should fix these problems. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu and powerpc64-unknown-linux-gnu. Committed to mainline. Ian 9c56d98e6b7f38ee3fc0993a2baa6de1224ef1f1 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f4c99756d25..c80f1cc1425 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -2b5bdd22b7ec2fc13ae0f644c781f64c1a209500 +5b075d039a20f32b9c2711ca67a3e52fba74f957 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/internal/cpu/cpu_arm.go b/libgo/go/internal/cpu/cpu_arm.go index 7324e7b8151..06962cfc518 100644 --- a/libgo/go/internal/cpu/cpu_arm.go +++ b/libgo/go/internal/cpu/cpu_arm.go @@ -4,6 +4,8 @@ package cpu +// const CacheLinePadSize = 32 + // arm doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2. // These are initialized by archauxv() and should not be changed after they are // initialized. diff --git a/libgo/go/internal/cpu/cpu_mips.go b/libgo/go/internal/cpu/cpu_mips.go new file mode 100644 index 000..48755b6d1ae --- /dev/null +++ b/libgo/go/internal/cpu/cpu_mips.go @@ -0,0 +1,10 @@ +// Copyright 2017 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 CacheLinePadSize = 32 + +func doinit() { +} diff --git a/libgo/go/internal/cpu/cpu_mips64x.go b/libgo/go/internal/cpu/cpu_mips64x.go index af10a5071ea..58fbd3db93d 100644 --- a/libgo/go/internal/cpu/cpu_mips64x.go +++ b/libgo/go/internal/cpu/cpu_mips64x.go @@ -6,6 +6,8 @@ package cpu +// const CacheLinePadSize = 32 + // This is initialized by archauxv and should not be changed after it is // initialized. var HWCap uint diff --git a/libgo/go/internal/cpu/cpu_mipsle.go b/libgo/go/internal/cpu/cpu_mipsle.go new file mode 100644 index 000..48755b6d1ae --- /dev/null +++ b/libgo/go/internal/cpu/cpu_mipsle.go @@ -0,0 +1,10 @@ +// Copyright 2017 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 CacheLinePadSize = 32 + +func doinit() { +} diff --git a/libgo/go/internal/cpu/cpu_no_name.go b/libgo/go/internal/cpu/cpu_no_name.go index ce1c37a3c7c..f028a92c935 100644 --- a/libgo/go/internal/cpu/cpu_no_name.go +++ b/libgo/go/internal/cpu/cpu_no_name.go @@ -4,6 +4,7 @@ // +build !386 // +build !amd64 +// +build !amd64p32 package cpu diff --git a/libgo/go/internal/cpu/cpu_other.go b/libgo/go/internal/cpu/cpu_other.go index d0f1f2e2150..ba3c42ad569
Re: libgo patch committed: Update to Go1.16beta1 release
On 1/2/21 12:11 AM, Ian Lance Taylor wrote: > On Thu, Dec 31, 2020 at 7:40 AM Matthias Klose wrote: >> >> On 12/31/20 12:14 AM, Ian Lance Taylor via Gcc-patches wrote: >>> I've committed a patch to update libgo to the Go 1.16beta1 release. >>> >>> This patch does not include support for the new //go:embed directive >>> that will be available in Go 1.16.1 (https://golang.org/issue/41191) >>> Support for that requires compiler changes, which will come later. >>> >>> As usual with these big updates, I have not included the complete >>> changes in this e-mail message, only changes that are gccgo-specific. >>> >>> Testing this requires some changes to gotools. >>> >>> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed >>> to mainline. >> >> also breaks the s390x 32bit multilib build (s390). >> >> ../../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to >> undefined name 'doinit' >> 123 | doinit() >> | ^ > > The problems building the internal/cpu and golang.org/x/sys/cpu > packages on less common architectures should be fixed by this patch. > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline. still ftbfs on power*, tested with a multilib build on powerpc64-linux-gnu. patch attached, didn't check on aix. ../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined name 'doinit' 123 | doinit() | ^ ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:26:26: error: reference to undefined name 'isSet' 26 | PPC64.IsPOWER9 = isSet(HWCap2, hwcap2_ARCH_3_00) | ^ ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:27:25: error: reference to undefined name 'isSet' 27 | PPC64.HasDARN = isSet(HWCap2, hwcap2_DARN) | ^ ../../../src/libgo/go/internal/cpu/cpu_ppc64x_linux.go:28:24: error: reference to undefined name 'isSet' 28 | PPC64.HasSCV = isSet(HWCap2, hwcap2_SCV) |^ Matthias --- a/libgo/go/internal/cpu/cpu_ppc64x_aix.go +++ b/libgo/go/internal/cpu/cpu_ppc64x_aix.go @@ -12,10 +12,14 @@ const ( _IMPL_POWER9 = 0x2 ) -func osinit() { +func doinit() { impl := getsystemcfg(_SC_IMPL) PPC64.IsPOWER9 = isSet(impl, _IMPL_POWER9) } +func isSet(hwc uint, value uint) bool { +return hwc != 0 +} + // getsystemcfg is defined in runtime/os2_aix.go func getsystemcfg(label uint) uint --- a/libgo/go/internal/cpu/cpu_ppc64x_linux.go +++ b/libgo/go/internal/cpu/cpu_ppc64x_linux.go @@ -22,8 +22,12 @@ const ( hwcap2_SCV = 0x0010 ) -func osinit() { +func doinit() { PPC64.IsPOWER9 = isSet(HWCap2, hwcap2_ARCH_3_00) PPC64.HasDARN = isSet(HWCap2, hwcap2_DARN) PPC64.HasSCV = isSet(HWCap2, hwcap2_SCV) } + +func isSet(hwc uint, value uint) bool { +return hwc != 0 +}
Re: libgo patch committed: Update to Go1.16beta1 release
On Fri, Jan 1, 2021 at 3:15 PM Ian Lance Taylor via Gcc-patches wrote: > > As far as I know all the build problems introduced by the update to > Go1.16beta1 are now fixed. > > Please let me know if I missed anything. > You missed this one for x32: diff --git a/libgo/go/internal/cpu/cpu_no_name.go b/libgo/go/internal/cpu/cpu_no_name.go index ce1c37a3c7c..f028a92c935 100644 --- a/libgo/go/internal/cpu/cpu_no_name.go +++ b/libgo/go/internal/cpu/cpu_no_name.go @@ -4,6 +4,7 @@ // +build !386 // +build !amd64 +// +build !amd64p32 package cpu -- H.J.
Re: libgo patch committed: Update to Go1.16beta1 release
As far as I know all the build problems introduced by the update to Go1.16beta1 are now fixed. Please let me know if I missed anything. Sorry for the difficulties, it's hard to test on so many systems. Ian On Fri, Jan 1, 2021 at 3:14 PM Ian Lance Taylor wrote: > > On Fri, Jan 1, 2021 at 1:32 AM Andreas Schwab wrote: > > > > --- a/libgo/go/internal/cpu/cpu_gccgo.c > > +++ b/libgo/go/internal/cpu/cpu_gccgo.c > > @@ -200,3 +200,29 @@ struct queryResult kdsaQuery() { > > } > > > > #endif /* defined(__s390x__) */ > > + > > +#ifdef __aarch64__ > > + > > +uint64_t getisar0(void) > > + __asm__(GOSYM_PREFIX "internal_1cpu.getisar0") > > + __attribute__((no_split_stack)); > > + > > +uint64_t getisar0() { > > + uint64_t isar0; > > + > > + __asm__("mrs %0,id_aa64isar0_el1" : "=r"(isar0)); > > + return isar0; > > +} > > + > > +uint64_t getMIDR(void) > > + __asm__(GOSYM_PREFIX "internal_1cpu.getMIDR") > > + __attribute__((no_split_stack)); > > + > > +uint64_t getMIDR() { > > + uint64_t MIDR; > > + > > + __asm__("mrs %0,midr_el1" : "=r"(MIDR)); > > + return MIDR; > > +} > > + > > +#endif /* defined(__aarch64__) */ > > > Thanks! > > Committed to mainline. > > Ian
Re: libgo patch committed: Update to Go1.16beta1 release
On Fri, Jan 1, 2021 at 1:32 AM Andreas Schwab wrote: > > --- a/libgo/go/internal/cpu/cpu_gccgo.c > +++ b/libgo/go/internal/cpu/cpu_gccgo.c > @@ -200,3 +200,29 @@ struct queryResult kdsaQuery() { > } > > #endif /* defined(__s390x__) */ > + > +#ifdef __aarch64__ > + > +uint64_t getisar0(void) > + __asm__(GOSYM_PREFIX "internal_1cpu.getisar0") > + __attribute__((no_split_stack)); > + > +uint64_t getisar0() { > + uint64_t isar0; > + > + __asm__("mrs %0,id_aa64isar0_el1" : "=r"(isar0)); > + return isar0; > +} > + > +uint64_t getMIDR(void) > + __asm__(GOSYM_PREFIX "internal_1cpu.getMIDR") > + __attribute__((no_split_stack)); > + > +uint64_t getMIDR() { > + uint64_t MIDR; > + > + __asm__("mrs %0,midr_el1" : "=r"(MIDR)); > + return MIDR; > +} > + > +#endif /* defined(__aarch64__) */ Thanks! Committed to mainline. Ian
Re: libgo patch committed: Update to Go1.16beta1 release
On Thu, Dec 31, 2020 at 11:48 AM Rainer Orth wrote: > > > I've committed a patch to update libgo to the Go 1.16beta1 release. > > > > This patch does not include support for the new //go:embed directive > > that will be available in Go 1.16.1 (https://golang.org/issue/41191) > > Support for that requires compiler changes, which will come later. > > > > As usual with these big updates, I have not included the complete > > changes in this e-mail message, only changes that are gccgo-specific. > > > > Testing this requires some changes to gotools. > > > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > > to mainline. > > this broke Solaris bootstrap: > > * On i386-pc-solaris2.11: > > /vol/gcc/src/hg/master/local/libgo/go/runtime/os_gccgo.go:43:12: error: > reference to undefined name 'startupRandomData' >43 | if startupRandomData != nil { > |^ > /vol/gcc/src/hg/master/local/libgo/go/runtime/os_gccgo.go:44:30: error: > reference to undefined name 'startupRandomData' >44 | n := copy(r, startupRandomData) > | ^ > > startupRandomData is only defined in go/runtime/os_linux.go and relies > on AT_RANDOM in the aux vector which is Linux-only AFAICT. For the > moment, I've just commented that part of the code since it tries > /dev/urandom next. This problem should be fixed by this patch. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 0b9ef8be40b8ec530e46779a694e3b115b8e685d diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 6039cbc15f5..e51285c7214 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -6857530fb1662c05a3ce754df2bd9fa5acd3a35b +fa161cb71880cf80ef53fb4bf35dba8ee01af648 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/runtime/os_linux.go b/libgo/go/runtime/os_linux.go index 0eebdfa8004..627b6d6d43c 100644 --- a/libgo/go/runtime/os_linux.go +++ b/libgo/go/runtime/os_linux.go @@ -178,10 +178,6 @@ func sysargs(argc int32, argv **byte) { sysauxv(buf[:]) } -// startupRandomData holds random bytes initialized at startup. These come from -// the ELF AT_RANDOM auxiliary vector. -var startupRandomData []byte - func sysauxv(auxv []uintptr) int { var i int for ; auxv[i] != _AT_NULL; i += 2 { diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go index 2e550151245..023dac38ec2 100644 --- a/libgo/go/runtime/runtime2.go +++ b/libgo/go/runtime/runtime2.go @@ -885,6 +885,10 @@ type forcegcstate struct { idle uint32 } +// startupRandomData holds random bytes initialized at startup. These come from +// the ELF AT_RANDOM auxiliary vector. +var startupRandomData []byte + // extendRandom extends the random numbers in r[:n] to the whole slice r. // Treats n<0 as n==0. func extendRandom(r []byte, n int) {
Re: libgo patch committed: Update to Go1.16beta1 release
On Thu, Dec 31, 2020 at 7:40 AM Matthias Klose wrote: > > On 12/31/20 12:14 AM, Ian Lance Taylor via Gcc-patches wrote: > > I've committed a patch to update libgo to the Go 1.16beta1 release. > > > > This patch does not include support for the new //go:embed directive > > that will be available in Go 1.16.1 (https://golang.org/issue/41191) > > Support for that requires compiler changes, which will come later. > > > > As usual with these big updates, I have not included the complete > > changes in this e-mail message, only changes that are gccgo-specific. > > > > Testing this requires some changes to gotools. > > > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > > to mainline. > > also breaks the s390x 32bit multilib build (s390). > > ../../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to > undefined name 'doinit' > 123 | doinit() > | ^ The problems building the internal/cpu and golang.org/x/sys/cpu packages on less common architectures should be fixed by this patch. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 47fbf21eab3fd5bdda530149d9c956a29e587e36 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index fc5ef4498dd..6039cbc15f5 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -47bdc8bb36f16f9d1dec72df5dd6b45d7b0b0725 +6857530fb1662c05a3ce754df2bd9fa5acd3a35b The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_other.go b/libgo/go/golang.org/x/sys/cpu/cpu_other.go new file mode 100644 index 000..d8bb8119f3f --- /dev/null +++ b/libgo/go/golang.org/x/sys/cpu/cpu_other.go @@ -0,0 +1,23 @@ +// Copyright 2020 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 !386 +// +build !amd64 +// +build !amd64p32 +// +build !arm +// +build !arm64 +// +build !mips +// +build !mipsle +// +build !mips64 +// +build !mips64le +// +build !ppc64 +// +build !ppc64le +// +build !riscv +// +build !riscv64 +// +build !s390x +// +build !wasm + +package cpu + +func initOptions() {} diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_other_arch.go b/libgo/go/golang.org/x/sys/cpu/cpu_other_arch.go new file mode 100644 index 000..aef0a82a8ef --- /dev/null +++ b/libgo/go/golang.org/x/sys/cpu/cpu_other_arch.go @@ -0,0 +1,20 @@ +// Copyright 2020 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 !aix +// +build !linux +// +build !zos + +// +build !386 +// +build !amd64 +// +build !amd64p32 +// +build !arm +// +build !arm64 +// +build !mips64 +// +build !mips64le +// +build !wasm + +package cpu + +func archInit() {} diff --git a/libgo/go/golang.org/x/sys/cpu/cpu_riscv.go b/libgo/go/golang.org/x/sys/cpu/cpu_riscv.go index 891cb98b455..e229457fa38 100644 --- a/libgo/go/golang.org/x/sys/cpu/cpu_riscv.go +++ b/libgo/go/golang.org/x/sys/cpu/cpu_riscv.go @@ -5,3 +5,5 @@ // +build riscv package cpu + +func initOptions() {} diff --git a/libgo/go/internal/cpu/cpu_amd64p32.go b/libgo/go/internal/cpu/cpu_amd64p32.go new file mode 100644 index 000..a6cff4f096e --- /dev/null +++ b/libgo/go/internal/cpu/cpu_amd64p32.go @@ -0,0 +1,7 @@ +// Copyright 2020 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 GOARCH = "amd64p32" diff --git a/libgo/go/internal/cpu/cpu_other.go b/libgo/go/internal/cpu/cpu_other.go new file mode 100644 index 000..d0f1f2e2150 --- /dev/null +++ b/libgo/go/internal/cpu/cpu_other.go @@ -0,0 +1,21 @@ +// Copyright 2020 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 !386 +// +build !amd64 +// +build !amd64p32 +// +build !arm +// +build !arm64 +// +build !mips64 +// +build !mips64le +// +build !ppc +// +build !ppc64 +// +build !ppc64le +// +build !riscv64 +// +build !s390x + +package cpu + +func doinit() { +} diff --git a/libgo/go/internal/cpu/cpu_ppc64x_aix.go b/libgo/go/internal/cpu/cpu_ppc64x_aix.go index b840b823bae..a932684baf2 100644 --- a/libgo/go/internal/cpu/cpu_ppc64x_aix.go +++ b/libgo/go/internal/cpu/cpu_ppc64x_aix.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 ppc64 ppc64le +// +build ppc ppc64 ppc64le package cpu diff --git a/libgo/go/internal/cpu/cpu_ppc64x_linux.go b/libgo/go/internal/cpu/cpu_ppc64x_linux.go index 73b191436df..068a799781a 100644 --- a/libgo/go/internal/cpu/cpu_ppc64x_linux.go +++ b/libgo/go/internal/cpu/cpu_ppc64x_linux.go @@ -2,7 +2,7 @@ // Use of this source code is governed by
Re: libgo patch committed: Update to Go1.16beta1 release
../../../../libgo/go/golang.org/x/sys/cpu/cpu.go:200:9: error: reference to undefined name ‘initOptions’ 200 | initOptions() | ^ make[2]: *** [golang.org/x/sys/cpu.lo] Error 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: libgo patch committed: Update to Go1.16beta1 release
../../../libgo/go/internal/cpu/cpu_ppcx.go:13:5: error: redefinition of 'HWCap' 13 | var HWCap uint | ^ ../../../libgo/go/internal/cpu/cpu_ppc64x_linux.go:12:5: note: previous definition of 'HWCap' was here 12 | var HWCap uint | ^ ../../../libgo/go/internal/cpu/cpu_ppcx.go:14:5: error: redefinition of 'HWCap2' 14 | var HWCap2 uint | ^ ../../../libgo/go/internal/cpu/cpu_ppc64x_linux.go:13:5: note: previous definition of 'HWCap2' was here 13 | var HWCap2 uint | ^ make[4]: *** [internal/cpu.lo] Error 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: libgo patch committed: Update to Go1.16beta1 release
On 12/31/20 12:14 AM, Ian Lance Taylor via Gcc-patches wrote: > I've committed a patch to update libgo to the Go 1.16beta1 release. > > This patch does not include support for the new //go:embed directive > that will be available in Go 1.16.1 (https://golang.org/issue/41191) > Support for that requires compiler changes, which will come later. > > As usual with these big updates, I have not included the complete > changes in this e-mail message, only changes that are gccgo-specific. > > Testing this requires some changes to gotools. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline. ../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined name 'doinit' 123 | doinit() | ^ also on sparc64, and most likely on the 32bit multilib. Until now I didn't find any build which is surviving this patch. Let's hope that 2021 gets a better ... Matthias
Re: libgo patch committed: Update to Go1.16beta1 release
--- a/libgo/go/internal/cpu/cpu_gccgo.c +++ b/libgo/go/internal/cpu/cpu_gccgo.c @@ -200,3 +200,29 @@ struct queryResult kdsaQuery() { } #endif /* defined(__s390x__) */ + +#ifdef __aarch64__ + +uint64_t getisar0(void) + __asm__(GOSYM_PREFIX "internal_1cpu.getisar0") + __attribute__((no_split_stack)); + +uint64_t getisar0() { + uint64_t isar0; + + __asm__("mrs %0,id_aa64isar0_el1" : "=r"(isar0)); + return isar0; +} + +uint64_t getMIDR(void) + __asm__(GOSYM_PREFIX "internal_1cpu.getMIDR") + __attribute__((no_split_stack)); + +uint64_t getMIDR() { + uint64_t MIDR; + + __asm__("mrs %0,midr_el1" : "=r"(MIDR)); + return MIDR; +} + +#endif /* defined(__aarch64__) */ -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: libgo patch committed: Update to Go1.16beta1 release
On aarch64: /usr/aarch64-suse-linux/bin/ld: ../aarch64-suse-linux/libgo/.libs/libgo.so: undefined reference to `internal_1cpu.getMIDR' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:831: test2json] Error 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: libgo patch committed: Update to Go1.16beta1 release
Hi Ian, > I've committed a patch to update libgo to the Go 1.16beta1 release. > > This patch does not include support for the new //go:embed directive > that will be available in Go 1.16.1 (https://golang.org/issue/41191) > Support for that requires compiler changes, which will come later. > > As usual with these big updates, I have not included the complete > changes in this e-mail message, only changes that are gccgo-specific. > > Testing this requires some changes to gotools. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline. this broke Solaris bootstrap: * On i386-pc-solaris2.11: /vol/gcc/src/hg/master/local/libgo/go/runtime/os_gccgo.go:43:12: error: reference to undefined name 'startupRandomData' 43 | if startupRandomData != nil { |^ /vol/gcc/src/hg/master/local/libgo/go/runtime/os_gccgo.go:44:30: error: reference to undefined name 'startupRandomData' 44 | n := copy(r, startupRandomData) | ^ startupRandomData is only defined in go/runtime/os_linux.go and relies on AT_RANDOM in the aux vector which is Linux-only AFAICT. For the moment, I've just commented that part of the code since it tries /dev/urandom next. One could also use getentropy instead. * sparc-sun-solaris2.11 is worse: /vol/gcc/src/hg/master/local/libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined name 'doinit' 123 | doinit() | ^ /vol/gcc/src/hg/master/local/libgo/go/golang.org/x/sys/cpu/cpu.go:199:9: error: reference to undefined name ‘archInit’ 199 | archInit() | ^ /vol/gcc/src/hg/master/local/libgo/go/golang.org/x/sys/cpu/cpu.go:200:9: error: reference to undefined name ‘initOptions’ 200 | initOptions() | ^ I've used dummy implementations to get along for now. Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: libgo patch committed: Update to Go1.16beta1 release
On 12/31/20 12:14 AM, Ian Lance Taylor via Gcc-patches wrote: > I've committed a patch to update libgo to the Go 1.16beta1 release. > > This patch does not include support for the new //go:embed directive > that will be available in Go 1.16.1 (https://golang.org/issue/41191) > Support for that requires compiler changes, which will come later. > > As usual with these big updates, I have not included the complete > changes in this e-mail message, only changes that are gccgo-specific. > > Testing this requires some changes to gotools. > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > to mainline. also breaks the s390x 32bit multilib build (s390). ../../../../src/libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined name 'doinit' 123 | doinit() | ^
Re: libgo patch committed: Update to Go1.16beta1 release
On Dez 31 2020, Andreas Schwab wrote: > I'm getting this error in ia64: > > ../../../libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined > name 'doinit' > 123 | doinit() > | ^ > make[4]: *** [internal/cpu.lo] Error 1 ../../../libgo/go/golang.org/x/sys/cpu/cpu.go:200:9: error: reference to undefined name ‘initOptions’ 200 | initOptions() | ^ make[4]: *** [golang.org/x/sys/cpu.lo] Error 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: libgo patch committed: Update to Go1.16beta1 release
On 12/31/20 11:36 AM, Matthias Klose wrote: > On 12/31/20 11:12 AM, Andreas Schwab wrote: >> I'm getting this error in ia64: >> >> ../../../libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined >> name 'doinit' >> 123 | doinit() >> | ^ >> make[4]: *** [internal/cpu.lo] Error 1 >> >> Andreas. >> > > also on x32, or with the x32 multilib target. fixed for x32 with the attached patch Matthias --- a/libgo/go/internal/cpu/cpu_no_name.go +++ b/libgo/go/internal/cpu/cpu_no_name.go @@ -4,6 +4,7 @@ // +build !386 // +build !amd64 +// +build !amd64p32 package cpu --- a/libgo/go/internal/cpu/cpu_x86.go +++ b/libgo/go/internal/cpu/cpu_x86.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 +// +build 386 amd64 amd64p32 package cpu @@ -56,7 +56,7 @@ func doinit() { {Name: "ssse3", Feature: }, // These capabilities should always be enabled on amd64: - {Name: "sse2", Feature: , Required: GOARCH == "amd64"}, + {Name: "sse2", Feature: , Required: GOARCH == "amd64" || GOARCH == "amd64p32"}, } maxID, _, _, _ := cpuid(0, 0) --- /dev/null +++ b/libgo/go/internal/cpu/cpu_amd64p32.go @@ -0,0 +1,7 @@ +// Copyright 2020 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 GOARCH = "amd64p32"
Re: libgo patch committed: Update to Go1.16beta1 release
On 12/31/20 11:12 AM, Andreas Schwab wrote: > I'm getting this error in ia64: > > ../../../libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined > name 'doinit' > 123 | doinit() > | ^ > make[4]: *** [internal/cpu.lo] Error 1 > > Andreas. > also on x32, or with the x32 multilib target.
Re: libgo patch committed: Update to Go1.16beta1 release
I'm getting this error in ia64: ../../../libgo/go/internal/cpu/cpu.go:123:9: error: reference to undefined name 'doinit' 123 | doinit() | ^ make[4]: *** [internal/cpu.lo] Error 1 Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
libgo patch committed: Update to Go1.16beta1 release
I've committed a patch to update libgo to the Go 1.16beta1 release. This patch does not include support for the new //go:embed directive that will be available in Go 1.16.1 (https://golang.org/issue/41191) Support for that requires compiler changes, which will come later. As usual with these big updates, I have not included the complete changes in this e-mail message, only changes that are gccgo-specific. Testing this requires some changes to gotools. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian * Makefile.am (check-runtime): Don't create check-runtime-dir. (mostlyclean-local): Don't remove check-runtime-dir. (check-go-tool, check-vet): Copy in go.mod and modules.txt. (check-cgo-test, check-carchive-test): Add go.mod file. * Makefile.in: Regenerate. 0c4cf80ab72765e5e1984f7d228822b945541915 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 1e461f06e95..fc5ef4498dd 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -d67579759e1769c08148304b2d378ec0b05637d6 +47bdc8bb36f16f9d1dec72df5dd6b45d7b0b0725 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gotools/Makefile.am b/gotools/Makefile.am index 1b8702e98bb..3bbccb96c28 100644 --- a/gotools/Makefile.am +++ b/gotools/Makefile.am @@ -101,7 +101,7 @@ MOSTLYCLEANFILES = \ mostlyclean-local: if test -d check-go-dir; then chmod -R u+w check-go-dir; fi - rm -rf check-go-dir check-runtime-dir cgo-test-dir carchive-test-dir \ + rm -rf check-go-dir cgo-test-dir carchive-test-dir \ check-vet-dir gocache-test if NATIVE @@ -210,6 +210,11 @@ check-go-tool: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc if test -d check-go-dir; then chmod -R u+w check-go-dir; fi rm -rf check-go-dir cmd_go-testlog $(MKDIR_P) check-go-dir/src/cmd/go + cp $(libgosrcdir)/go.mod check-go-dir/src/ + cp $(cmdsrcdir)/go.mod check-go-dir/src/cmd/ + $(MKDIR_P) check-go-dir/src/vendor check-go-dir/src/cmd/vendor + cp $(libgosrcdir)/vendor/modules.txt check-go-dir/src/vendor/ + cp $(libgosrcdir)/cmd/vendor/modules.txt check-go-dir/src/cmd/vendor/ cp $(cmdsrcdir)/go/*.go check-go-dir/src/cmd/go/ cp -r $(cmdsrcdir)/go/internal check-go-dir/src/cmd/go/ cp $(libgodir)/zdefaultcc.go check-go-dir/src/cmd/go/internal/cfg/ @@ -234,8 +239,7 @@ check-go-tool: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc # but the runtime tests use the go tool heavily, so testing # here too will catch more problems. check-runtime: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc - rm -rf check-runtime-dir runtime-testlog - $(MKDIR_P) check-runtime-dir + rm -f runtime-testlog @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \ LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ export LD_LIBRARY_PATH; \ @@ -256,6 +260,7 @@ check-runtime: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc check-cgo-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc rm -rf cgo-test-dir cgo-testlog $(MKDIR_P) cgo-test-dir/misc/cgo + echo 'module misc' > cgo-test-dir/misc/go.mod cp -r $(libgomiscdir)/cgo/test cgo-test-dir/misc/cgo/ @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \ echo "cd cgo-test-dir/misc/cgo/test && $(ECHO_ENV) GOTRACEBACK=2 $(abs_builddir)/go$(EXEEXT) test -test.short -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > cgo-testlog @@ -270,6 +275,7 @@ check-cgo-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc check-carchive-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc rm -rf carchive-test-dir carchive-testlog $(MKDIR_P) carchive-test-dir/misc/cgo + echo 'module misc' > carchive-test-dir/misc/go.mod cp -r $(libgomiscdir)/cgo/testcarchive carchive-test-dir/misc/cgo/ @abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \ echo "cd carchive-test-dir/misc/cgo/testcarchive && $(ECHO_ENV) LIBRARY_PATH=`echo $${abs_libgodir}/.libs` $(abs_builddir)/go$(EXEEXT) test -test.timeout=$(GOTOOLS_TEST_TIMEOUT)s -test.v" > carchive-testlog @@ -283,6 +289,11 @@ check-carchive-test: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check check-vet: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc rm -rf check-vet-dir cmd_vet-testlog $(MKDIR_P) check-vet-dir/src/cmd/internal check-vet-dir/src/cmd/vendor/golang.org/x + cp $(libgosrcdir)/go.mod check-vet-dir/src/ + cp $(cmdsrcdir)/go.mod check-vet-dir/src/cmd/ + $(MKDIR_P) check-vet-dir/src/vendor check-vet-dir/src/cmd/vendor + cp $(libgosrcdir)/vendor/modules.txt check-vet-dir/src/vendor/ + cp $(libgosrcdir)/cmd/vendor/modules.txt