Revert "Adding support for building AFLpp Test: Build AFL fuzzer..."

Revert submission 2124256-AFLpp support in Soong

Reason for revert: It is breaking the build
Reverted Changes:
Ie07ec3368:Adding support for building AFLpp Test: Build AFL ...
I5bd6d1e9b:Adding support for building AFLpp Test: Built AFL ...

Change-Id: Id2eec1060f7532fec46293d0c207be800e6eaa03
This commit is contained in:
Cory Barker
2022-07-12 18:04:17 +00:00
parent f4b1c3a7a7
commit 7bc91232d1
6 changed files with 73 additions and 372 deletions

View File

@@ -26,13 +26,12 @@ import (
"android/soong/android"
)
type FuzzType string
type Lang string
const (
Cc FuzzType = ""
Rust FuzzType = "rust"
Java FuzzType = "java"
AFL FuzzType = "AFL"
Cc Lang = ""
Rust Lang = "rust"
Java Lang = "java"
)
var BoolDefault = proptools.BoolDefault
@@ -47,7 +46,6 @@ type FuzzPackager struct {
Packages android.Paths
FuzzTargets map[string]bool
SharedLibInstallStrings []string
FuzzType FuzzType
}
type FileToZip struct {
@@ -210,7 +208,7 @@ func (f *FuzzConfig) String() string {
return string(b)
}
func (s *FuzzPackager) CreateFuzzPackage(ctx android.SingletonContext, archDirs map[ArchOs][]FileToZip, fuzzType FuzzType, pctx android.PackageContext) {
func (s *FuzzPackager) CreateFuzzPackage(ctx android.SingletonContext, archDirs map[ArchOs][]FileToZip, lang Lang, pctx android.PackageContext) {
var archOsList []ArchOs
for archOs := range archDirs {
archOsList = append(archOsList, archOs)
@@ -223,15 +221,12 @@ func (s *FuzzPackager) CreateFuzzPackage(ctx android.SingletonContext, archDirs
hostOrTarget := archOs.HostOrTarget
builder := android.NewRuleBuilder(pctx, ctx)
zipFileName := "fuzz-" + hostOrTarget + "-" + arch + ".zip"
if fuzzType == Rust {
if lang == Rust {
zipFileName = "fuzz-rust-" + hostOrTarget + "-" + arch + ".zip"
}
if fuzzType == Java {
if lang == Java {
zipFileName = "fuzz-java-" + hostOrTarget + "-" + arch + ".zip"
}
if fuzzType == AFL {
zipFileName = "fuzz-afl-" + hostOrTarget + "-" + arch + ".zip"
}
outputFile := android.PathForOutput(ctx, zipFileName)
s.Packages = append(s.Packages, outputFile)
@@ -242,6 +237,7 @@ func (s *FuzzPackager) CreateFuzzPackage(ctx android.SingletonContext, archDirs
Flag("-L 0") // No need to try and re-compress the zipfiles.
for _, fileToZip := range filesToZip {
if fileToZip.DestinationPathPrefix != "" {
command.FlagWithArg("-P ", fileToZip.DestinationPathPrefix)
} else {
@@ -260,7 +256,6 @@ func (s *FuzzPackager) PreallocateSlice(ctx android.MakeVarsContext, targets str
for target, _ := range s.FuzzTargets {
fuzzTargets = append(fuzzTargets, target)
}
sort.Strings(fuzzTargets)
ctx.Strict(targets, strings.Join(fuzzTargets, " "))
}