summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ring0/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/platform/ring0/BUILD')
-rw-r--r--pkg/sentry/platform/ring0/BUILD33
1 files changed, 20 insertions, 13 deletions
diff --git a/pkg/sentry/platform/ring0/BUILD b/pkg/sentry/platform/ring0/BUILD
index 8ed6c7652..939a0033a 100644
--- a/pkg/sentry/platform/ring0/BUILD
+++ b/pkg/sentry/platform/ring0/BUILD
@@ -1,17 +1,16 @@
load("//tools/go_stateify:defs.bzl", "go_library")
+load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance")
package(licenses = ["notice"])
-load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance")
-
go_template(
name = "defs",
- srcs = [
- "defs.go",
- "defs_amd64.go",
- "offsets_amd64.go",
- "x86.go",
- ],
+ srcs = select(
+ {
+ "@bazel_tools//src/conditions:linux_aarch64": ["defs.go", "defs_arm64.go", "offsets_arm64.go", "aarch64.go",],
+ "//conditions:default": ["defs.go", "defs_amd64.go", "offsets_amd64.go", "x86.go",],
+ },
+ ),
visibility = [":__subpackages__"],
)
@@ -23,10 +22,15 @@ go_template_instance(
)
genrule(
- name = "entry_impl_amd64",
- srcs = ["entry_amd64.s"],
- outs = ["entry_impl_amd64.s"],
- cmd = "(echo -e '// build +amd64\\n' && $(location //pkg/sentry/platform/ring0/gen_offsets) && cat $(SRCS)) > $@",
+ name = "entry_impl",
+ srcs = ["entry_amd64.s", "entry_arm64.s"],
+ outs = ["entry_impl.s"],
+ cmd = select(
+ {
+ "@bazel_tools//src/conditions:linux_aarch64": "(echo -e '// build +arm64\\n' && $(location //pkg/sentry/platform/ring0/gen_offsets) && cat $(location entry_arm64.s)) > $@",
+ "//conditions:default": "(echo -e '// build +amd64\\n' && $(location //pkg/sentry/platform/ring0/gen_offsets) && cat $(location entry_amd64.s)) > $@",
+ },
+ ),
tools = ["//pkg/sentry/platform/ring0/gen_offsets"],
)
@@ -35,12 +39,15 @@ go_library(
srcs = [
"defs_impl.go",
"entry_amd64.go",
- "entry_impl_amd64.s",
+ "entry_arm64.go",
+ "entry_impl.s",
"kernel.go",
"kernel_amd64.go",
+ "kernel_arm64.go",
"kernel_unsafe.go",
"lib_amd64.go",
"lib_amd64.s",
+ "lib_arm64.go",
"ring0.go",
],
importpath = "gvisor.dev/gvisor/pkg/sentry/platform/ring0",