diff options
author | 2022-10-04 16:35:39 -0700 | |
---|---|---|
committer | 2022-10-04 19:15:45 -0700 | |
commit | 31d89b4e0cf22ea11b02c5c937c4c96c621cf819 (patch) | |
tree | 97e84fd5fe75fa57b5ac952c98d8829d513fa9dc /fuzz/fuzz_common.go | |
parent | 553a31be9d357d9e7f90b0a1760791bf173add07 (diff) |
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
Diffstat (limited to 'fuzz/fuzz_common.go')
-rw-r--r-- | fuzz/fuzz_common.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/fuzz/fuzz_common.go b/fuzz/fuzz_common.go index c8cd21b7e..eb248bb40 100644 --- a/fuzz/fuzz_common.go +++ b/fuzz/fuzz_common.go @@ -379,42 +379,3 @@ func (s *FuzzPackager) PreallocateSlice(ctx android.MakeVarsContext, targets str sort.Strings(fuzzTargets) ctx.Strict(targets, strings.Join(fuzzTargets, " ")) } - -// CollectAllSharedDependencies performs a breadth-first search over the provided module's -// dependencies using `visitDirectDeps` to enumerate all shared library -// dependencies. We require breadth-first expansion, as otherwise we may -// incorrectly use the core libraries (sanitizer runtimes, libc, libdl, etc.) -// from a dependency. This may cause issues when dependencies have explicit -// sanitizer tags, as we may get a dependency on an unsanitized libc, etc. -func CollectAllSharedDependencies(ctx android.SingletonContext, module android.Module, unstrippedOutputFile func(module android.Module) android.Path, isValidSharedDependency func(dependency android.Module) bool) android.Paths { - var fringe []android.Module - - seen := make(map[string]bool) - - // Enumerate the first level of dependencies, as we discard all non-library - // modules in the BFS loop below. - ctx.VisitDirectDeps(module, func(dep android.Module) { - if isValidSharedDependency(dep) { - fringe = append(fringe, dep) - } - }) - - var sharedLibraries android.Paths - - for i := 0; i < len(fringe); i++ { - module := fringe[i] - if seen[module.Name()] { - continue - } - seen[module.Name()] = true - - sharedLibraries = append(sharedLibraries, unstrippedOutputFile(module)) - ctx.VisitDirectDeps(module, func(dep android.Module) { - if isValidSharedDependency(dep) && !seen[dep.Name()] { - fringe = append(fringe, dep) - } - }) - } - - return sharedLibraries -} |