From b354f8bf4d9e3ed38f0fd66d9dc82e9b9bb040c3 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 6 Mar 2019 16:31:30 -0500 Subject: [PATCH] cpu: define cacheLineSize and doinit for WASM This fixes a build break when compiling this package with GOOS=js / GOARCH=wasm. Updates golang/go#30241 Change-Id: I0b35aa50a69370ed0d83c522e12ce7613c4c3ec4 Reviewed-on: https://go-review.googlesource.com/c/sys/+/165749 Reviewed-by: Brad Fitzpatrick --- cpu/cpu_wasm.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cpu/cpu_wasm.go diff --git a/cpu/cpu_wasm.go b/cpu/cpu_wasm.go new file mode 100644 index 00000000..108d9e69 --- /dev/null +++ b/cpu/cpu_wasm.go @@ -0,0 +1,13 @@ +// 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. + +package cpu + +// We're compiling the cpu package for an unknown (software-abstracted) CPU. +// Make CacheLinePad an empty struct and hope that the usual struct alignment +// rules are good enough. + +const cacheLineSize = 0 + +func doinit() {}