From 13ed3f5e3487e795be67978beaefe5e0ec5850e2 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Tue, 12 Nov 2019 11:12:10 -0800 Subject: [PATCH] 'm fuzz' shared lib package should be per-fuzzer. Change the ClusterFuzz package built by 'make fuzz' to now package shared libraries per-fuzz target. Changes documented in go/proposed-clusterfuzz-package This has the impact of: - This package is much easier to post-process in the Haiku export cronjob. - Shared libraries are now per-fuzz-target. This means that we will have some level of duplication (libdl, libc, libc++, libclang_rt.*, etc.) as these libraries will be in multiple fuzz target's dirs. This *only* affects the fuzz-$target-$arch.zip file, not the fuzz targets in $ANDROID_HOST_OUT/fuzz or $ANDROID_PRODUCT_OUT/data/fuzz. These two install directories still use the global shared libraries in order to preserve space on devices. Bug: 144360679 Test: m fuzz Change-Id: I5f19a13070e01d2d39598f9f215a983b398a9f37 --- cc/fuzz.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cc/fuzz.go b/cc/fuzz.go index 11e641303..4b537c0a8 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -338,6 +338,9 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) { collectAllSharedDependencies(module, sharedLibraries, ctx) for _, library := range sharedLibraries { + archDirs[archDir] = append(archDirs[archDir], + fileToZip{library, ccModule.Name() + "/lib"}) + if _, exists := archSharedLibraryDeps[archAndLibraryKey{archDir, library}]; exists { continue } @@ -379,12 +382,6 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) { } }) - // Add the shared library deps for packaging. - for key, _ := range archSharedLibraryDeps { - archDirs[key.ArchDir] = append(archDirs[key.ArchDir], - fileToZip{key.Library, "lib"}) - } - for archDir, filesToZip := range archDirs { arch := archDir.Base() hostOrTarget := filepath.Base(filepath.Dir(archDir.String()))