Copy Rust fuzzer dependencies to /data.

Fix an issue where rust_fuzz modules were
not correctly packaging and copying their
dependencies.

This is done by extending the CC fuzz packager
to simply handle both Rust and CC modules,
ensuring this doesn't get out of sync again.
Fuzzer related functions are added to the
Linkable interface to facilitate this.

There was a bug where the Make definitions for
Rust fuzzers were not being created as well,
and that is addressed here.

Bug: 249551848
Test: m android_log_fuzzer #check $OUT/data/fuzz/arm64/libs
Change-Id: I9b41153e0cf08ab510476b75003c3a3baccc3858
This commit is contained in:
Ivan Lozano
2023-02-06 13:31:02 -05:00
parent 8e0ae8e960
commit 0f9963e9e4
6 changed files with 161 additions and 151 deletions

View File

@@ -3,6 +3,7 @@ package cc
import (
"android/soong/android"
"android/soong/bazel/cquery"
"android/soong/fuzz"
"android/soong/snapshot"
"github.com/google/blueprint"
@@ -120,6 +121,17 @@ type LinkableInterface interface {
IsPrebuilt() bool
Toc() android.OptionalPath
// IsFuzzModule returns true if this a *_fuzz module.
IsFuzzModule() bool
// FuzzPackagedModule returns the fuzz.FuzzPackagedModule for this module.
// Expects that IsFuzzModule returns true.
FuzzPackagedModule() fuzz.FuzzPackagedModule
// FuzzSharedLibraries returns the shared library dependencies for this module.
// Expects that IsFuzzModule returns true.
FuzzSharedLibraries() android.Paths
Device() bool
Host() bool
@@ -256,6 +268,9 @@ type LinkableInterface interface {
// Partition returns the partition string for this module.
Partition() string
// FuzzModule returns the fuzz.FuzzModule associated with the module.
FuzzModuleStruct() fuzz.FuzzModule
}
var (