| 1 |
# temporary fix for https://github.com/bazelbuild/bazel/issues/12905 on macOS |
| 2 |
build --features=-debug_prefix_map_pwd_is_dot |
| 3 |
|
| 4 |
build --extra_toolchains=@system_python//:python_toolchain |
| 5 |
|
| 6 |
# Use our custom-configured c++ toolchain. |
| 7 |
|
| 8 |
build:m32 --copt=-m32 --linkopt=-m32 |
| 9 |
build:asan --copt=-fsanitize=address --linkopt=-fsanitize=address |
| 10 |
build:msan --copt=-fsanitize=memory --linkopt=-fsanitize=memory |
| 11 |
|
| 12 |
# For Valgrind, we have to disable checks of "possible" leaks because the Python |
| 13 |
# interpreter does the sorts of things that flag Valgrind "possible" leak checks. |
| 14 |
# Ideally we could enforce a stricter check for the non-Python tests, but I don't |
| 15 |
# know of an easy way to do that. |
| 16 |
# |
| 17 |
# We also have to disable pymalloc to avoid triggering Valgrind. |
| 18 |
build:valgrind --run_under='valgrind --leak-check=full --track-origins=yes --trace-children=yes --show-leak-kinds=all --error-exitcode=1 --num-callers=500 ' --action_env=PYTHONMALLOC=malloc |
| 19 |
|
| 20 |
build:ubsan --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 |
| 21 |
# Workaround for the fact that Bazel links with $CC, not $CXX |
| 22 |
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748 |
| 23 |
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr |
| 24 |
# Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404 |
| 25 |
build:ubsan --linkopt=--rtlib=compiler-rt --linkopt=-lunwind |
| 26 |
|
| 27 |
build:Werror --copt=-Werror |
| 28 |
build:Werror --per_file_copt=json/parser@-Wno-error |
| 29 |
build:Werror --per_file_copt=com_google_protobuf@-Wno-error |
| 30 |
|
| 31 |
# GCC's -fanalyzer, a deeper static analysis than normal warnings. |
| 32 |
build:analyzer --copt=-fanalyzer --copt=-Werror |
| 33 |
build:analyzer --per_file_copt=json/parser@-fno-analyzer |
| 34 |
build:analyzer --per_file_copt=com_google_protobuf@-fno-analyzer |
| 35 |
build:analyzer --per_file_copt=com_github_google_benchmark@-fno-analyzer |
| 36 |
|
| 37 |
# --config=asan-libfuzzer |
| 38 |
build:asan-libfuzzer --action_env=CC=clang |
| 39 |
build:asan-libfuzzer --action_env=CXX=clang++ |
| 40 |
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer |
| 41 |
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer |
| 42 |
build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan |
| 43 |
|
| 44 |
# --config=msan-libfuzzer |
| 45 |
build:msan-libfuzzer --action_env=CC=clang |
| 46 |
build:msan-libfuzzer --action_env=CXX=clang++ |
| 47 |
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer |
| 48 |
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer |
| 49 |
build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=msan |
| 50 |
|
| 51 |
# --config=ubsan-libfuzzer |
| 52 |
build:ubsan-libfuzzer --action_env=CC=clang |
| 53 |
build:ubsan-libfuzzer --action_env=CXX=clang++ |
| 54 |
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer |
| 55 |
build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer |
| 56 |
build:ubsan-libfuzzer --copt=-fsanitize=undefined |
| 57 |
build:ubsan-libfuzzer --linkopt=-fsanitize=undefined |
| 58 |
build:ubsan-libfuzzer --linkopt=-fsanitize-link-c++-runtime |