diff options
| -rw-r--r-- | pkg/host/features.go | 22 | ||||
| -rw-r--r-- | pkg/runtest/run.go | 1 | ||||
| -rw-r--r-- | pkg/runtest/run_test.go | 4 | ||||
| -rw-r--r-- | sys/targets/targets.go | 18 |
4 files changed, 36 insertions, 9 deletions
diff --git a/pkg/host/features.go b/pkg/host/features.go index b8ec837f0..80f083a21 100644 --- a/pkg/host/features.go +++ b/pkg/host/features.go @@ -80,10 +80,7 @@ func Check(target *prog.Target) (*Features, error) { Feature802154Emulation: {Name: "802.15.4 emulation", Reason: unsupported}, FeatureSwap: {Name: "swap file", Reason: unsupported}, } - if noHostChecks(target) { - return res, nil - } - for n, check := range checkFeature { + for n, check := range featureCheckers(target) { if check == nil { continue } @@ -135,6 +132,23 @@ func Setup(target *prog.Target, features *Features, featureFlags csource.Feature return err } +func featureCheckers(target *prog.Target) [numFeatures]func() string { + ret := [numFeatures]func() string{} + if target.OS == targets.TestOS { + sysTarget := targets.Get(target.OS, target.Arch) + ret[FeatureCoverage] = func() string { + if sysTarget.ExecutorUsesShmem && sysTarget.PtrSize == 8 { + return "" + } + return "disabled" + } + } + if noHostChecks(target) { + return ret + } + return checkFeature +} + func noHostChecks(target *prog.Target) bool { // HostFuzzer targets can't run Go binaries on the targets, // so we actually run on the host on another OS. The same for targets.TestOS OS. diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 864a9f5f1..0651b3f42 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -416,6 +416,7 @@ func (ctx *Context) createSyzTest(p *prog.Prog, sandbox string, threaded, cov bo } if cov { cfg.Flags |= ipc.FlagSignal + opts.Flags |= ipc.FlagCollectSignal opts.Flags |= ipc.FlagCollectCover } if ctx.Features[host.FeatureExtraCoverage].Enabled { diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index c80f7c6b0..5cbbca865 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -51,7 +51,9 @@ func test(t *testing.T, sysTarget *targets.Target) { if err != nil { t.Fatal(err) } - executor, err := csource.BuildFile(target, filepath.FromSlash("../../executor/executor.cc")) + executor, err := csource.BuildFile(target, + filepath.FromSlash("../../executor/executor.cc"), + "-fsanitize-coverage=trace-pc") if err != nil { t.Fatal(err) } diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 4c840119a..40fc40991 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -175,8 +175,13 @@ var List = map[string]map[string]*Target{ TestArch64: { PtrSize: 8, PageSize: 4 << 10, - // Compile with -no-pie due to issues with ASan + ASLR on ppc64le. - CFlags: []string{"-fsanitize=address", "-no-pie"}, + CFlags: []string{ + "-fsanitize=address", + // Compile with -no-pie due to issues with ASan + ASLR on ppc64le. + "-no-pie", + // Otherwise it conflicts with -fsanitize-coverage=trace-pc. + "-fno-exceptions", + }, osCommon: osCommon{ SyscallNumbers: true, SyscallPrefix: "SYS_", @@ -187,8 +192,13 @@ var List = map[string]map[string]*Target{ TestArch64Fork: { PtrSize: 8, PageSize: 8 << 10, - // Compile with -no-pie due to issues with ASan + ASLR on ppc64le. - CFlags: []string{"-fsanitize=address", "-no-pie"}, + CFlags: []string{ + "-fsanitize=address", + // Compile with -no-pie due to issues with ASan + ASLR on ppc64le. + "-no-pie", + // Otherwise it conflicts with -fsanitize-coverage=trace-pc. + "-fno-exceptions", + }, osCommon: osCommon{ SyscallNumbers: true, SyscallPrefix: "SYS_", |
