Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 1 | # Use our CROSSTOOL. |
Brian Silverman | fbe4fd5 | 2015-10-26 10:40:55 -0400 | [diff] [blame] | 2 | build --crosstool_top=//tools/cpp:toolchain |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 3 | # Don't switch HOST compilers. |
| 4 | build --host_crosstool_top=//tools/cpp:toolchain |
Brian Silverman | fbe4fd5 | 2015-10-26 10:40:55 -0400 | [diff] [blame] | 5 | |
Brian Silverman | 5bc5434 | 2015-11-26 22:57:46 -0500 | [diff] [blame] | 6 | # Always include debug information in the non-.stripped binaries. |
| 7 | build --strip=never |
| 8 | |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 9 | # Use the malloc we want. |
| 10 | build --custom_malloc=//tools/cpp:malloc |
| 11 | |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 12 | build:asan --copt -fsanitize=address |
| 13 | build:asan --linkopt -fsanitize=address --linkopt -ldl |
| 14 | build:asan --platform_suffix=-asan |
| 15 | build:asan --test_env ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
| 16 | build:asan --test_env ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:detect_odr_violation=2:allow_user_segv_handler=1 |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame^] | 17 | build:asan --copt -fsanitize-blacklist=tools/cpp/asan-blacklist |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 18 | |
| 19 | build:tsan --copt -fsanitize=thread --copt -DAOS_SANITIZER_thread |
| 20 | build:tsan --linkopt -fsanitize=thread |
| 21 | build:tsan --platform_suffix=-tsan |
| 22 | build:tsan --test_env TSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:detect_deadlocks=1:second_deadlock_stack=1 |
| 23 | |
| 24 | build:isan --copt -fsanitize=integer |
| 25 | build:isan --linkopt -fsanitize=integer |
| 26 | build:isan --platform_suffix=-isan |
| 27 | build:isan --test_env LLVM_SYMBOLIZER=/usr/bin/llvm-symbolizer-3.6 |
| 28 | |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 29 | build:ubsan --copt -fsanitize=undefined --copt -fno-sanitize-recover |
| 30 | # Bad alignment is just slow on x86 and traps on ARM, so we'll find |
| 31 | # it other ways, and some x86 code does it on purpose. |
| 32 | build:ubsan --copt -fno-sanitize=alignment |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 33 | build:ubsan --linkopt -fsanitize=undefined |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame^] | 34 | # TOOD(Brian): Remove this once Clang adds it itself like it should. |
| 35 | build:ubsan --linkopt /usr/lib/llvm-3.6/lib/clang/3.6.2/lib/linux/libclang_rt.ubsan_cxx-x86_64.a |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 36 | build:ubsan --platform_suffix=-ubsan |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame^] | 37 | build:ubsan --test_env UBSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:color=always:print_stacktrace=1 |
| 38 | build:ubsan --copt -fsanitize-blacklist=tools/cpp/ubsan-blacklist |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 39 | |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 40 | build:msan --copt -fsanitize=memory --copt -fsanitize-memory-track-origins |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame^] | 41 | build:msan --linkopt -fsanitize=memory --linkopt -fsanitize-memory-track-origins |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 42 | build:msan --platform_suffix=-msan |
| 43 | build:msan --test_env MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
| 44 | |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 45 | # Show paths to a few more than just 1 target. |
| 46 | build --show_result 15 |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 47 | # Dump the output of the failing test to stdout. |
| 48 | test --test_output=errors |