libgo patch committed: Update to Go1.16beta1 release

Ian Lance Taylor iant@golang.org
Fri Jan 1 23:11:26 GMT 2021


On Thu, Dec 31, 2020 at 7:40 AM Matthias Klose <doko@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.

Ian
-------------- next part --------------
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 00000000000..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 00000000000..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 00000000000..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 00000000000..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 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_ppcx.go b/libgo/go/internal/cpu/cpu_ppcx.go
deleted file mode 100644
index 56ff87524ee..00000000000
--- a/libgo/go/internal/cpu/cpu_ppcx.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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
-
-// ppc64x 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.
-// On aix/ppc64, these values are initialized early in the runtime in runtime/os_aix.go.
-var HWCap uint
-var HWCap2 uint
-
-// HWCAP/HWCAP2 bits. These are exposed by the kernel.
-const (
-	// ISA Level
-	PPC_FEATURE2_ARCH_2_07 = 0x80000000
-	PPC_FEATURE2_ARCH_3_00 = 0x00800000
-
-	// CPU features
-	PPC_FEATURE2_DARN = 0x00200000
-	PPC_FEATURE2_SCV  = 0x00100000
-)
-
-func doinit() {
-	options = []option{
-		{Name: "darn", Feature: &PPC64.HasDARN},
-		{Name: "scv", Feature: &PPC64.HasSCV},
-		{Name: "power9", Feature: &PPC64.IsPOWER9},
-		{Name: "power8", Feature: &PPC64.IsPOWER8},
-	}
-
-	// HWCAP2 feature bits
-	PPC64.IsPOWER8 = isSet(HWCap2, PPC_FEATURE2_ARCH_2_07)
-	PPC64.IsPOWER9 = isSet(HWCap2, PPC_FEATURE2_ARCH_3_00)
-	PPC64.HasDARN = isSet(HWCap2, PPC_FEATURE2_DARN)
-	PPC64.HasSCV = isSet(HWCap2, PPC_FEATURE2_SCV)
-}
-
-func isSet(hwc uint, value uint) bool {
-	return hwc&value != 0
-}
diff --git a/libgo/go/internal/cpu/cpu_x86.go b/libgo/go/internal/cpu/cpu_x86.go
index 62853a1aebd..9aa5c3acd42 100644
--- 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: &X86.HasSSSE3},
 
 		// These capabilities should always be enabled on amd64:
-		{Name: "sse2", Feature: &X86.HasSSE2, Required: GOARCH == "amd64"},
+		{Name: "sse2", Feature: &X86.HasSSE2, Required: GOARCH == "amd64" || GOARCH == "amd64p32"},
 	}
 
 	maxID, _, _, _ := cpuid(0, 0)


More information about the Gcc-patches mailing list