Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@ verifier: descriptions
# `extract` extracts const files from various kernel sources, and may only
# re-generate parts of files.
extract: bin/syz-extract
ifeq ($(TARGETOS),fuchsia)
$(MAKE) generate_fidl TARGETARCH=amd64
$(MAKE) generate_fidl TARGETARCH=arm64
else
endif
bin/syz-extract -build -os=$(TARGETOS) -sourcedir=$(SOURCEDIR) $(FILES)

bin/syz-extract:
Expand All @@ -236,21 +231,14 @@ generate:
$(MAKE) format

generate_go: format_cpp
$(GO) generate ./executor ./pkg/ifuzz ./pkg/build ./pkg/rpcserver
$(GO) generate ./...
$(GO) run github.com/vektra/mockery/v2@v2.52.1 --log-level="error"

generate_rpc:
flatc -o pkg/flatrpc --warnings-as-errors --gen-object-api --filename-suffix "" --go --gen-onefile --go-namespace flatrpc pkg/flatrpc/flatrpc.fbs
flatc -o pkg/flatrpc --warnings-as-errors --gen-object-api --filename-suffix "" --cpp --scoped-enums pkg/flatrpc/flatrpc.fbs
$(GO) fmt ./pkg/flatrpc/flatrpc.go

generate_fidl:
ifeq ($(TARGETOS),fuchsia)
$(HOSTGO) generate ./sys/fuchsia
$(MAKE) format_sys
else
endif

generate_trace2syz:
(cd tools/syz-trace2syz/parser; ragel -Z -G2 -o lex.go straceLex.rl)
(cd tools/syz-trace2syz/parser; goyacc -o strace.go -p Strace -v="" strace.y)
Expand Down
2 changes: 0 additions & 2 deletions pkg/csource/common.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.

//go:generate go run gen.go

package csource

import (
Expand Down
12 changes: 6 additions & 6 deletions pkg/ifuzz/x86/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ nextInsn:
insns = deduped

fmt.Printf(`
// Code generated by pkg/ifuzz/gen. DO NOT EDIT.
// Code generated by pkg/ifuzz/x86/gen. DO NOT EDIT.

// +build !codeanalysis
//go:build !codeanalysis

package x86
package generated

import "github.com/google/syzkaller/pkg/ifuzz/x86"
import . "github.com/google/syzkaller/pkg/ifuzz/x86"

func init() {
x86.Register(insns_x86)
Register(insns)
}

var insns_x86 = []*Insn{
var insns =
`)
serializer.Write(os.Stdout, insns)

Expand Down
8 changes: 4 additions & 4 deletions pkg/ifuzz/x86/generated/insns.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions sys/fuchsia/fidlgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ import (
)

func main() {
targetOS := os.Getenv("TARGETOS")
targetArch := os.Getenv("TARGETARCH")
target := targets.Get(targets.Fuchsia, targetArch)
if target == nil {
tool.Failf("unknown TARGETARCH %s", targetArch)
}
arch := target.KernelHeaderArch

sourceDir := os.Getenv("SOURCEDIR")
if targetOS != targets.Fuchsia || sourceDir == "" {
return
}
if !osutil.IsExist(sourceDir) {
tool.Failf("cannot find SOURCEDIR %s", sourceDir)
}
target := targets.Get(targetOS, targetArch)
if target == nil {
tool.Failf("unknown TARGETARCH %s", targetArch)
}
arch := target.KernelHeaderArch

fidlgenPath := filepath.Join(
sourceDir,
Expand Down
3 changes: 2 additions & 1 deletion sys/fuchsia/init.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// 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.

//go:generate go run fidlgen/main.go
//go:generate bash -c "TARGETARCH=amd64 go run fidlgen/main.go"
//go:generate bash -c "TARGETARCH=arm64 go run fidlgen/main.go"

package fuchsia

Expand Down