From 68ac2ad1e1f16e65d9d1318d6827edf8487578d0 Mon Sep 17 00:00:00 2001 From: Anton Gyllenberg Date: Thu, 27 Sep 2018 12:51:18 -0700 Subject: netstack: make go:linkname work for all architectures The //go:linkname directive requires the presence of assembly files in the package. Even an empty file will do. There was an empty assembly file commit_arm64.s, but that is limited to GOARCH=arm64. Renaming to empty.s will remove the unnecessary build constraint and allow building netstack for other architectures than amd64 and arm64. Without this, building directly with go (not bazel) for e.g., GOARCH=arm gives: sleep/sleep_unsafe.go:88:6: missing function body sleep/sleep_unsafe.go:91:6: missing function body Change-Id: I29d1d13e1ff31506a174d4595b8cd57fa58bf52b PiperOrigin-RevId: 214820299 --- pkg/sleep/empty.s | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkg/sleep/empty.s (limited to 'pkg/sleep/empty.s') diff --git a/pkg/sleep/empty.s b/pkg/sleep/empty.s new file mode 100644 index 000000000..8aca31bee --- /dev/null +++ b/pkg/sleep/empty.s @@ -0,0 +1,15 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Empty assembly file so empty func definitions work. -- cgit v1.2.3