Revert "Add FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION to fuzzer mode and enable DCHECKs under fuzzing (#5489)" (#5580)

This reverts commit 1889ee3904.

We have identified that this is causing ODR violations, because the
`fuzzer` feature is being added `cc_fuzz_test` targets, and thus any
includes they make, but not to the rest of the build. Any include that
is seen from both places has ODR violations if it branches on
FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION.

We need to apply fuzzer globally when building fuzz targets somehow, or
not set different defines in fuzzer.
This commit is contained in:
Dana Jansens
2025-05-30 16:20:43 +00:00
committed by GitHub
parent 0b530de9ed
commit 11e82e9872
3 changed files with 12 additions and 24 deletions
@@ -661,20 +661,12 @@ def _impl(ctx):
fuzzer = feature(
name = "fuzzer",
flag_sets = [
flag_set(
actions = all_compile_actions + all_link_actions,
flag_groups = [flag_group(flags = [
"-fsanitize=fuzzer-no-link",
])],
),
flag_set(
actions = all_compile_actions,
flag_groups = [flag_group(flags = [
"-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION",
])],
),
],
flag_sets = [flag_set(
actions = all_compile_actions + all_link_actions,
flag_groups = [flag_group(flags = [
"-fsanitize=fuzzer-no-link",
])],
)],
)
# Clang HARDENED_MODE has 4 possible values: