From b4e8571b14e03cc164df06f72b640ebce3899579 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 15 Feb 2019 11:12:20 +0100 Subject: [PATCH] cpu: fix build for GOARCH=ppc64{,le} on GOOS!=linux The current implementation for ppc64{,le} only supports linux (through HWCaps read from /proc/self/auxv) and fails to build e.g. on aix/ppc64. Change-Id: I5e1efe75c781fd08bc7bbe797df88295726ba62b Reviewed-on: https://go-review.googlesource.com/c/162798 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- cpu/{cpu_ppc64x.go => cpu_linux_ppc64x.go} | 1 + cpu/cpu_other_ppc64x.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) rename cpu/{cpu_ppc64x.go => cpu_linux_ppc64x.go} (98%) create mode 100644 cpu/cpu_other_ppc64x.go diff --git a/cpu/cpu_ppc64x.go b/cpu/cpu_linux_ppc64x.go similarity index 98% rename from cpu/cpu_ppc64x.go rename to cpu/cpu_linux_ppc64x.go index a971b012..6c8d975d 100644 --- a/cpu/cpu_ppc64x.go +++ b/cpu/cpu_linux_ppc64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build linux // +build ppc64 ppc64le package cpu diff --git a/cpu/cpu_other_ppc64x.go b/cpu/cpu_other_ppc64x.go new file mode 100644 index 00000000..3053b4b9 --- /dev/null +++ b/cpu/cpu_other_ppc64x.go @@ -0,0 +1,12 @@ +// Copyright 2019 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 !linux +// +build ppc64 ppc64le + +package cpu + +const cacheLineSize = 128 + +func doinit() {}