aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract/netbsd.go
diff options
context:
space:
mode:
authorJoey Jiao <joeyjiaojg@163.com>2019-01-19 19:30:10 +0800
committerDmitry Vyukov <dvyukov@google.com>2019-01-19 12:30:10 +0100
commit8aa587b0a13ba3f8e19b359b1e254cdf94a8b7ff (patch)
treeb3d3546a796d43aa6fe2f51931706baecf010bad /sys/syz-extract/netbsd.go
parent2103a236f19bebcfb1c0cff08feea6e93b3af7b3 (diff)
sys/syz-extract: add -includedirs option
Kernel modules are in different directories in some cases, so to include the headers in the module dir or other directories the includedirs flag is added. ex: -includedirs path1/include,path2/include
Diffstat (limited to 'sys/syz-extract/netbsd.go')
-rw-r--r--sys/syz-extract/netbsd.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/syz-extract/netbsd.go b/sys/syz-extract/netbsd.go
index d0059f836..878a63584 100644
--- a/sys/syz-extract/netbsd.go
+++ b/sys/syz-extract/netbsd.go
@@ -67,6 +67,11 @@ func (*netbsd) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uin
for _, incdir := range info.Incdirs {
args = append(args, "-I"+filepath.Join(arch.sourceDir, incdir))
}
+ if arch.includeDirs != "" {
+ for _, dir := range strings.Split(arch.includeDirs, ",") {
+ args = append(args, "-I"+dir)
+ }
+ }
// Syscall consts on netbsd have weird prefixes sometimes,
// try to extract consts with these prefixes as well.
compatNames := make(map[string][]string)