mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
This adds a `precompiledseccomp` library which provides tooling to compile `seccomp-bpf` programs and generate Go source code that contains the resulting bytecode embedded into it. In turn, this bytecode can be used in Go libraries. This avoids spending time compiling and optimizing `seccomp-bpf` programs at runsc container creation time. This library also contains support for "variables", which are `uint32`s whose values are part of the seccomp filters but only known at runtime. To support this, the program is compiled twice with placeholder values for these variables, and we verify that the offsets at which these values show up in the bytecode is consistent across these two compilation attempts. PiperOrigin-RevId: 583117683
21 lines
456 B
Python
21 lines
456 B
Python
load("//tools:defs.bzl", "go_library")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_library(
|
|
name = "example",
|
|
srcs = ["example.go"],
|
|
visibility = [
|
|
"//pkg/seccomp/precompiledseccomp/example:__subpackages__",
|
|
],
|
|
deps = [
|
|
"//pkg/abi/linux",
|
|
"//pkg/seccomp",
|
|
"//pkg/seccomp/precompiledseccomp",
|
|
"@org_golang_x_sys//unix:go_default_library",
|
|
],
|
|
)
|