diff options
| author | Joey Jiao <joeyjiaojg@163.com> | 2019-01-19 19:30:10 +0800 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-01-19 12:30:10 +0100 |
| commit | 8aa587b0a13ba3f8e19b359b1e254cdf94a8b7ff (patch) | |
| tree | b3d3546a796d43aa6fe2f51931706baecf010bad /sys/syz-extract/trusty.go | |
| parent | 2103a236f19bebcfb1c0cff08feea6e93b3af7b3 (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/trusty.go')
| -rw-r--r-- | sys/syz-extract/trusty.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/syz-extract/trusty.go b/sys/syz-extract/trusty.go index 325925c14..71a38a968 100644 --- a/sys/syz-extract/trusty.go +++ b/sys/syz-extract/trusty.go @@ -6,6 +6,7 @@ package main import ( "fmt" "path/filepath" + "strings" "github.com/google/syzkaller/pkg/compiler" ) @@ -33,5 +34,10 @@ func (*trusty) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uin for _, incdir := range info.Incdirs { args = append(args, "-I"+filepath.Join(dir, incdir)) } + if arch.includeDirs != "" { + for _, dir := range strings.Split(arch.includeDirs, ",") { + args = append(args, "-I"+dir) + } + } return extract(info, "gcc", args, "", true) } |
