On Sat, Jan 2, 2021 at 6:14 AM Matthias Klose <d...@ubuntu.com> wrote: > > On 1/2/21 12:11 AM, Ian Lance Taylor wrote: > > On Thu, Dec 31, 2020 at 7:40 AM Matthias Klose <d...@ubuntu.com> 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 00000000000..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 00000000000..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 100644 --- a/libgo/go/internal/cpu/cpu_other.go +++ b/libgo/go/internal/cpu/cpu_other.go @@ -7,6 +7,8 @@ // +build !amd64p32 // +build !arm // +build !arm64 +// +build !mips +// +build !mipsle // +build !mips64 // +build !mips64le // +build !ppc @@ -14,6 +16,7 @@ // +build !ppc64le // +build !riscv64 // +build !s390x +// +build !wasm package cpu diff --git a/libgo/go/internal/cpu/cpu_ppc64x.go b/libgo/go/internal/cpu/cpu_ppc64x.go new file mode 100644 index 00000000000..0a48f6a0a06 --- /dev/null +++ b/libgo/go/internal/cpu/cpu_ppc64x.go @@ -0,0 +1,23 @@ +// 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. + +// +build ppc ppc64 ppc64le + +package cpu + +// const CacheLinePadSize = 128 + +func doinit() { + options = []option{ + {Name: "darn", Feature: &PPC64.HasDARN}, + {Name: "scv", Feature: &PPC64.HasSCV}, + {Name: "power9", Feature: &PPC64.IsPOWER9}, + } + + osinit() +} + +func isSet(hwc uint, value uint) bool { + return hwc&value != 0 +} diff --git a/libgo/go/internal/cpu/cpu_wasm.go b/libgo/go/internal/cpu/cpu_wasm.go new file mode 100644 index 00000000000..c9ab4ca4eec --- /dev/null +++ b/libgo/go/internal/cpu/cpu_wasm.go @@ -0,0 +1,10 @@ +// 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 CacheLinePadSize = 64 + +func doinit() { +} diff --git a/libgo/go/internal/cpu/cpu_x86.go b/libgo/go/internal/cpu/cpu_x86.go index 9aa5c3acd42..338d90992c5 100644 --- a/libgo/go/internal/cpu/cpu_x86.go +++ b/libgo/go/internal/cpu/cpu_x86.go @@ -6,6 +6,8 @@ package cpu +// const CacheLinePadSize = 64 + // cpuid is implemented in cpu_x86.s. func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)