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 <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser
2019-02-15 11:12:20 +01:00
committed by Tobias Klauser
parent 629670e5ac
commit b4e8571b14
2 changed files with 13 additions and 0 deletions

View File

@@ -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

12
cpu/cpu_other_ppc64x.go Normal file
View File

@@ -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() {}