mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-12 23:22:31 +00:00
sys/syz-extract: support akaros
This commit is contained in:
parent
fb05d27bb8
commit
7553c19941
34
sys/syz-extract/akaros.go
Normal file
34
sys/syz-extract/akaros.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2017 syzkaller project authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/google/syzkaller/pkg/compiler"
|
||||||
|
)
|
||||||
|
|
||||||
|
type akaros struct{}
|
||||||
|
|
||||||
|
func (*akaros) prepare(sourcedir string, build bool, arches []string) error {
|
||||||
|
if sourcedir == "" {
|
||||||
|
return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*akaros) prepareArch(arch *Arch) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*akaros) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
|
||||||
|
dir := arch.sourceDir
|
||||||
|
syscallH := filepath.Join(dir, "kern", "include", "ros", "bits", "syscall.h")
|
||||||
|
args := []string{"-fmessage-length=0", "--include", syscallH}
|
||||||
|
for _, incdir := range info.Incdirs {
|
||||||
|
args = append(args, "-I"+filepath.Join(dir, incdir))
|
||||||
|
}
|
||||||
|
return extract(info, "gcc", args, "")
|
||||||
|
}
|
@ -52,6 +52,7 @@ type OS interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var oses = map[string]OS{
|
var oses = map[string]OS{
|
||||||
|
"akaros": new(akaros),
|
||||||
"linux": new(linux),
|
"linux": new(linux),
|
||||||
"freebsd": new(freebsd),
|
"freebsd": new(freebsd),
|
||||||
"android": new(linux),
|
"android": new(linux),
|
||||||
|
@ -36,6 +36,7 @@ func extract(info *compiler.ConstInfo, cc string, args []string, addSource strin
|
|||||||
}
|
}
|
||||||
for _, errMsg := range []string{
|
for _, errMsg := range []string{
|
||||||
"error: ‘([a-zA-Z0-9_]+)’ undeclared",
|
"error: ‘([a-zA-Z0-9_]+)’ undeclared",
|
||||||
|
"error: '([a-zA-Z0-9_]+)' undeclared",
|
||||||
"note: in expansion of macro ‘([a-zA-Z0-9_]+)’",
|
"note: in expansion of macro ‘([a-zA-Z0-9_]+)’",
|
||||||
} {
|
} {
|
||||||
re := regexp.MustCompile(errMsg)
|
re := regexp.MustCompile(errMsg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user