From 44a5ca633e186c5836010366c515a4017836121b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 Apr 2022 09:15:41 +0200 Subject: pkg/ast, pkg/compiler: support per-file metadata We have a bunch of hacks in syz-extract, syz-sysgen and syz-check with respect to description files unsupported on some arches, or that must not be part of make extract. Add 2 meta attribtues to files: meta noextract Tells `make extract` to not extract constants for this file. Though, `syz-extract` can still be invoked manually on this file. meta arches["arch1", "arch2"] Restricts this file only to the given set of architectures. `make extract` and ``make generate` will not use it on other architectures. Later we can potentially use meta attributes to specify git tree/commit that must be used for extraction. Maybe something else. Fixes #2754 --- docs/syscall_descriptions_syntax.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/syscall_descriptions_syntax.md') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index a8f79b580..e2e2e2a17 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -391,6 +391,22 @@ foo(a ptr[in, array[int8, MY_PATH_MAX]]) define MY_PATH_MAX PATH_MAX + 2 ``` +## Meta + +Description files can also contain `meta` directives that specify meta-information for the whole file. + +``` +meta noextract +``` +Tells `make extract` to not extract constants for this file. +Though, `syz-extract` can still be invoked manually on this file. + +``` +meta arches["arch1", "arch2"] +``` +Restricts this file only to the given set of architectures. +`make extract` and ``make generate` will not use it on other architectures. + ## Misc Description files also contain `include` directives that refer to Linux kernel header files, -- cgit mrf-deployment