[cc_fuzz] Collect shared deps by name, not by module.
cc_fuzz relies on an invariant that's not exactly true. We assume that for each fuzz target, we'll only have a dependency on a single sanitized variant of a shared library. In a few instances, this is proven not to be true, as we end up with a transitive dependency on a shared library with sanitizer coverage instrumentation, and one without sancov. This results in breaking the packaging for some fuzz targets. This then goes on to break `make haiku` in some scenarios. While this isn't a completely technically correct solution (as we basically resolve one of the sanitized variants pseduorandomly), it does resolve the issue for now. Realistically, we should select *both* of them, and set the DT_RUNPATHS on the shared libraries to point to the dependencies that have the sanitization that they're expecting. In practice - this shouldn't break sancov (we might just silently drop some coverage) or hwasan (we might just silently drop some hwasanification). I believe that the walk order of VisitDirectDeps is deterministic, and as such this shouldn't affect the reproducability of fuzz target builds (and thus won't blow up the Soong rebuilds). ccross@ or dwillemsen@ can speak better to this than I can though. Bug: 148306195 Bug: 151102177 Bug: 155123587 Test: lunch flame_hwasan-userdebug && make haiku Change-Id: I8d4001d93da33e4e5d21f740beb88a20fcc26e2a
Loading
Please register or sign in to comment