浏览代码

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>
Tobias Klauser 6 年之前
父节点
当前提交
b4e8571b14
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 1 0
      cpu/cpu_linux_ppc64x.go
  2. 12 0
      cpu/cpu_other_ppc64x.go

+ 1 - 0
cpu/cpu_ppc64x.go → 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

+ 12 - 0
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() {}