Rework build hacks for fuzztest+absl to be more component-build friendly.

absl only includes subsets of Abseil that are allowed in Chrome, while
fuzztest has additional Abseil dependencies that are not normally
allowed (e.g. flags). To work around this, fuzztest would directly
depend on these additional absl_source_set targets.

However, from a component build perspective, this is problematic,
because it is really easy to end up with multiple copies of a global in
different components. For example, the centipede binary simply would not
run in an ASAN component build unless ODR violation checks were
disabled.

The build hacks are now centralized in the `absl` and `absl_full`
target. In non-component builds, `absl_full` depends on the `absl`
target + subsets of Abseil that are banned in Chrome. However, in
component builds, `absl_full` only has the `absl` dependency: the banned
subsets of Abseil are built directly into the `absl` target.

This allows the component build to avoid random ODR violations in an
ASAN build, since the entire Abseil library is now in one component; at
the same time, the non-component build still enforces correct build
dependencies.

Note that this only addresses component build issues in Abseil itself;
it is still very easy for the component build to break in subtle ways,
e.g. if two components depend on a single source_set that defines an
Abseil flag, the flag will end up being defined in two distinct
components. At runtime, this fails, since the flag registration code
checks that multiple definitions of the flag have matching types—but
this check is based on a fake RTTI pattern that is known to be broken in
component builds (i.e. absl::Any is banned for this reason).

Bug: 40286621
Change-Id: I24bbd39dfd3e1c67024e50c5bc5f15fac45aab6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5342394
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Reviewed-by: Paul Semel <paulsemel@chromium.org>
Reviewed-by: Danil Chapovalov <danilchap@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268717}
NOKEYCHECK=True
GitOrigin-RevId: 8966ba50db166c58c9020cd68a1d366a24859a35
1 file changed
tree: 898d8d2148a54234d8fcd05098062bac52dbb0f3
  1. BUILD.gn
  2. OWNERS
  3. README.chromium