Move fuzzer's CollectAllSharedDependencies into GenerateAndroidBuildActions
Make rust and cc fuzzers collect their shared libraries once in GenerateAndroidBuildActions and store it for later use by the packaging singleton. Also use android.OutputFileForModule to get the paths. Together this will fix fuzzers that depend on architecture specific prebuilt shared libraries that are missing a prebuilt for an architecture when building with AllowMissingDependencies. Bug: 250918230 Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing Change-Id: I154a6f3a767c883e9fe7067003615db73ee78e2d
This commit is contained in:
15
rust/fuzz.go
15
rust/fuzz.go
@@ -34,6 +34,7 @@ type fuzzDecorator struct {
|
||||
*binaryDecorator
|
||||
|
||||
fuzzPackagedModule fuzz.FuzzPackagedModule
|
||||
sharedLibraries android.Paths
|
||||
}
|
||||
|
||||
var _ compiler = (*fuzzDecorator)(nil)
|
||||
@@ -86,6 +87,15 @@ func (fuzzer *fuzzDecorator) compilerProps() []interface{} {
|
||||
&fuzzer.fuzzPackagedModule.FuzzProperties)
|
||||
}
|
||||
|
||||
func (fuzzer *fuzzDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput {
|
||||
out := fuzzer.binaryDecorator.compile(ctx, flags, deps)
|
||||
|
||||
// Grab the list of required shared libraries.
|
||||
fuzzer.sharedLibraries = cc.CollectAllSharedDependencies(ctx)
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
func (fuzzer *fuzzDecorator) stdLinkage(ctx *depsContext) RustLinkage {
|
||||
return RlibLinkage
|
||||
}
|
||||
@@ -149,11 +159,8 @@ func (s *rustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
// The executable.
|
||||
files = append(files, fuzz.FileToZip{rustModule.UnstrippedOutputFile(), ""})
|
||||
|
||||
// Grab the list of required shared libraries.
|
||||
sharedLibraries := fuzz.CollectAllSharedDependencies(ctx, module, cc.UnstrippedOutputFile, cc.IsValidSharedDependency)
|
||||
|
||||
// Package shared libraries
|
||||
files = append(files, cc.GetSharedLibsToZip(sharedLibraries, rustModule, &s.FuzzPackager, archString, "lib", &sharedLibraryInstalled)...)
|
||||
files = append(files, cc.GetSharedLibsToZip(fuzzModule.sharedLibraries, rustModule, &s.FuzzPackager, archString, "lib", &sharedLibraryInstalled)...)
|
||||
|
||||
archDirs[archOs], ok = s.BuildZipFile(ctx, module, fuzzModule.fuzzPackagedModule, files, builder, archDir, archString, hostOrTargetString, archOs, archDirs)
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user