mongo/.bazelrc.fuzztest
Mike Merrill 9b770d3df9 SERVER-118522 Vendor Fuzztest (#47328)
GitOrigin-RevId: bfe44acc8976e2928a8c12257cf9e977e07fe416
2026-02-06 19:34:13 +00:00

86 lines
3.2 KiB
Plaintext

### DO NOT EDIT. Generated file.
#
# To regenerate, run the following from your project's workspace:
#
# bazel run @com_google_fuzztest//bazel:setup_configs > fuzztest.bazelrc
#
# And don't forget to add the following to your project's .bazelrc:
#
# try-import %workspace%/fuzztest.bazelrc
### Common options.
#
# Do not use directly.
# Standard define for \"ifdef-ing\" any fuzz test specific code.
build:fuzztest-common --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# In fuzz tests, we want to catch assertion violations even in optimized builds.
build:fuzztest-common --copt=-UNDEBUG
# Enable libc++ assertions.
# See https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode
build:fuzztest-common --copt=-D_LIBCPP_ENABLE_ASSERTIONS=1
### ASan (Address Sanitizer) build configuration.
#
# Use with: --config=fuzztest_asan
build:fuzztest_asan --linkopt=-fsanitize=address
build:fuzztest_asan --copt=-fsanitize=address
# We rely on the following flag instead of the compiler provided
# __has_feature(address_sanitizer) to know that we have an ASAN build even in
# the uninstrumented runtime.
build:fuzztest_asan --copt=-DADDRESS_SANITIZER
### FuzzTest build configuration.
#
# Use with: --config=fuzztest
#
# Note that this configuration includes the ASan configuration.
build:fuzztest --config=fuzztest_asan
build:fuzztest --config=fuzztest-common
# Link statically.
build:fuzztest --dynamic_mode=off
# We apply coverage tracking instrumentation to everything but Centipede and the
# FuzzTest framework itself (including GoogleTest and GoogleMock).
build:fuzztest --copt=-fsanitize-coverage=inline-8bit-counters,trace-cmp,pc-table
build:fuzztest --per_file_copt=common/.*,fuzztest/.*,centipede/.*,-centipede/.*fuzz_target,googletest/.*,googlemock/.*@-fsanitize-coverage=0
### Experimental FuzzTest build configuration.
#
# Use with: --config=fuzztest-experimental
#
# Use this instead of --config=fuzztest when building test binaries to run with
# Centipede. Eventually, this will be consolidated with --config=fuzztest.
# Note that this configuration doesn't include the ASan configuration. If you
# want to use both, you can use --config=fuzztest-experimental --config=fuzztest_asan.
build:fuzztest-experimental --config=fuzztest-common
build:fuzztest-experimental --@com_google_fuzztest//fuzztest:centipede_integration
# Generate line tables for debugging.
build:fuzztest-experimental --copt=-gline-tables-only
build:fuzztest-experimental --strip=never
# Prevent memcmp & co from being inlined.
build:fuzztest-experimental --copt=-fno-builtin
# Disable heap checking.
build:fuzztest-experimental --copt=-DHEAPCHECK_DISABLE
# Link statically.
build:fuzztest-experimental --dynamic_mode=off
# We apply coverage tracking instrumentation to everything but Centipede and the
# FuzzTest framework itself (including GoogleTest and GoogleMock).
# TODO(b/374840534): Add -fsanitize-coverage=control-flow once we start building
# with clang 16+.
build:fuzztest-experimental --copt=-fsanitize-coverage=trace-pc-guard,pc-table,trace-loads,trace-cmp
build:fuzztest-experimental --per_file_copt=common/.*,fuzztest/.*,centipede/.*,-centipede/.*fuzz_target,googletest/.*,googlemock/.*@-fsanitize-coverage=0