aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-05-20 19:38:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-05-20 19:38:14 +0200
commit204f4fde068172170c5bc22bcffd60753d583c35 (patch)
treeeb9d581ee6ccae4417169e019ffaa82d02167ade /sys
parent4afdfa205b55633e7eb9db03a9d099d7aa324801 (diff)
sys/syz-extract: fix for full paths
pkg/ast now uses full paths since 554f8f39c57d91c1be8724cf4054424c9fb5f151. Fix syz-extract accordingly.
Diffstat (limited to 'sys')
-rw-r--r--sys/syz-extract/extract.go4
-rw-r--r--sys/syz-extract/linux.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/syz-extract/extract.go b/sys/syz-extract/extract.go
index efa02f5c1..5ee42af50 100644
--- a/sys/syz-extract/extract.go
+++ b/sys/syz-extract/extract.go
@@ -110,7 +110,7 @@ func main() {
close(j.done)
if j.err == nil {
for _, f := range j.files {
- f.info = infos[f.name]
+ f.info = infos[filepath.Join("sys", j.target.OS, f.name)]
jobC <- f
}
}
@@ -293,7 +293,7 @@ func processFile(extractor Extractor, arch *Arch, file *File) (map[string]uint64
inname := filepath.Join("sys", arch.target.OS, file.name)
outname := strings.TrimSuffix(inname, ".txt") + "_" + arch.target.Arch + ".const"
if file.info == nil {
- return nil, nil, fmt.Errorf("input file %v is missing", inname)
+ return nil, nil, fmt.Errorf("const info for input file %v is missing", inname)
}
if len(file.info.Consts) == 0 {
os.Remove(outname)
diff --git a/sys/syz-extract/linux.go b/sys/syz-extract/linux.go
index 29d99d1de..7760bcb0f 100644
--- a/sys/syz-extract/linux.go
+++ b/sys/syz-extract/linux.go
@@ -134,7 +134,7 @@ func (*linux) prepareArch(arch *Arch) error {
}
func (*linux) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
- if info.File == "dev_kvm.txt" && arch.target.Arch == "arm" {
+ if strings.HasSuffix(info.File, "_kvm.txt") && arch.target.Arch == "arm" {
// Hack: KVM is not supported on ARM anymore. We may want some more official support
// for marking descriptions arch-specific, but so far this combination is the only one.
// Note: syz-sysgen also ignores this file for arm.