aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-sysgen
diff options
context:
space:
mode:
Diffstat (limited to 'sys/syz-sysgen')
-rw-r--r--sys/syz-sysgen/sysgen.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index 0459d544f..70b38fee5 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -98,9 +98,17 @@ func main() {
var jobs []*Job
for _, arch := range archs {
+ target := targets.List[OS][arch]
+ constInfo := compiler.ExtractConsts(descriptions, target, nil)
+ if OS == targets.TestOS {
+ // The ConstFile object provides no guarantees re concurrent read-write,
+ // so let's patch it before we start goroutines.
+ compiler.FabricateSyscallConsts(target, constInfo, constFile)
+ }
jobs = append(jobs, &Job{
- Target: targets.List[OS][arch],
+ Target: target,
Unsupported: make(map[string]bool),
+ ConstInfo: constInfo,
})
}
sort.Slice(jobs, func(i, j int) bool {
@@ -167,6 +175,7 @@ type Job struct {
Errors []string
Unsupported map[string]bool
ArchData ArchData
+ ConstInfo map[string]*compiler.ConstInfo
}
func processJob(job *Job, descriptions *ast.Description, constFile *compiler.ConstFile) {
@@ -174,10 +183,6 @@ func processJob(job *Job, descriptions *ast.Description, constFile *compiler.Con
job.Errors = append(job.Errors, fmt.Sprintf("%v: %v\n", pos, msg))
}
consts := constFile.Arch(job.Target.Arch)
- if job.Target.OS == targets.TestOS {
- constInfo := compiler.ExtractConsts(descriptions, job.Target, eh)
- compiler.FabricateSyscallConsts(job.Target, constInfo, consts)
- }
prog := compiler.Compile(descriptions, consts, job.Target, eh)
if prog == nil {
return