aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-04-03 10:27:09 +0200
committerDmitry Vyukov <dvyukov@google.com>2025-04-03 20:00:12 +0000
commit6dc47718fdbb634024bcfe47cbc4d7cc781b4cc4 (patch)
tree27df5135e412a5f1cc816d418b75e8ce4e2d4a20 /sys/syz-extract
parentd7ae3a111bd75df44dda69b37da945b50d5133e2 (diff)
tools/syz-declextract: allow to run on subset of arches
This may be useful for downstream kernels that only build and are supposed to be used with a subset of arches. Some esoteric arches may be broken on such kernels. Allow to ignore them.
Diffstat (limited to 'sys/syz-extract')
-rw-r--r--sys/syz-extract/extract.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/syz-extract/extract.go b/sys/syz-extract/extract.go
index deaeb3f09..aa020b029 100644
--- a/sys/syz-extract/extract.go
+++ b/sys/syz-extract/extract.go
@@ -11,7 +11,6 @@ import (
"path/filepath"
"runtime"
"sort"
- "strings"
"github.com/google/syzkaller/pkg/ast"
"github.com/google/syzkaller/pkg/compiler"
@@ -80,7 +79,11 @@ func main() {
if extractor == nil {
tool.Failf("unknown os: %v", OS)
}
- arches, nfiles, err := createArches(OS, archList(OS, *flagArch), flag.Args())
+ archList, err := tool.ParseArchList(OS, *flagArch)
+ if err != nil {
+ tool.Failf("failed to parse arch flag: %v", err)
+ }
+ arches, nfiles, err := createArches(OS, archList, flag.Args())
if err != nil {
tool.Fail(err)
}
@@ -242,18 +245,6 @@ func createArches(OS string, archArray, files []string) ([]*Arch, int, error) {
return arches, nfiles, nil
}
-func archList(OS, arches string) []string {
- if arches != "" {
- return strings.Split(arches, ",")
- }
- var archArray []string
- for arch := range targets.List[OS] {
- archArray = append(archArray, arch)
- }
- sort.Strings(archArray)
- return archArray
-}
-
func checkUnsupportedCalls(arches []*Arch) bool {
supported := make(map[string]bool)
unsupported := make(map[string]string)