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 | 6470f44 | 2018-08-05 12:08:16 -0700 | [diff] [blame] | 12 | # Use our hermetic Python runtime. |
| 13 | build --python_top=//tools/python:runtime |
| 14 | |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 15 | build:asan --copt -fsanitize=address |
| 16 | build:asan --linkopt -fsanitize=address --linkopt -ldl |
| 17 | build:asan --platform_suffix=-asan |
| 18 | build:asan --test_env ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
| 19 | 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] | 20 | build:asan --copt -fsanitize-blacklist=tools/cpp/asan-blacklist |
Brian Silverman | 7dc6adb | 2017-02-19 17:04:36 -0800 | [diff] [blame] | 21 | build:asan --define have_asan=true |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 22 | |
| 23 | build:tsan --copt -fsanitize=thread --copt -DAOS_SANITIZER_thread |
| 24 | build:tsan --linkopt -fsanitize=thread |
| 25 | build:tsan --platform_suffix=-tsan |
| 26 | build:tsan --test_env TSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:detect_deadlocks=1:second_deadlock_stack=1 |
Brian Silverman | 7dc6adb | 2017-02-19 17:04:36 -0800 | [diff] [blame] | 27 | build:tsan --define have_tsan=true |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 28 | |
| 29 | build:isan --copt -fsanitize=integer |
| 30 | build:isan --linkopt -fsanitize=integer |
| 31 | build:isan --platform_suffix=-isan |
| 32 | build:isan --test_env LLVM_SYMBOLIZER=/usr/bin/llvm-symbolizer-3.6 |
Brian Silverman | 7dc6adb | 2017-02-19 17:04:36 -0800 | [diff] [blame] | 33 | build:isan --define have_isan=true |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 34 | |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 35 | build:ubsan --copt -fsanitize=undefined --copt -fno-sanitize-recover |
| 36 | # Bad alignment is just slow on x86 and traps on ARM, so we'll find |
| 37 | # it other ways, and some x86 code does it on purpose. |
| 38 | build:ubsan --copt -fno-sanitize=alignment |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 39 | build:ubsan --linkopt -fsanitize=undefined |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame] | 40 | # TOOD(Brian): Remove this once Clang adds it itself like it should. |
| 41 | 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] | 42 | build:ubsan --platform_suffix=-ubsan |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame] | 43 | build:ubsan --test_env UBSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:color=always:print_stacktrace=1 |
| 44 | build:ubsan --copt -fsanitize-blacklist=tools/cpp/ubsan-blacklist |
Brian Silverman | 7dc6adb | 2017-02-19 17:04:36 -0800 | [diff] [blame] | 45 | build:ubsan --define have_ubsan=true |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 46 | |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 47 | build:msan --copt -fsanitize=memory --copt -fsanitize-memory-track-origins |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame] | 48 | build:msan --linkopt -fsanitize=memory --linkopt -fsanitize-memory-track-origins |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 49 | build:msan --platform_suffix=-msan |
| 50 | build:msan --test_env MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
Brian Silverman | 7dc6adb | 2017-02-19 17:04:36 -0800 | [diff] [blame] | 51 | build:msan --define have_msan=true |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 52 | |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 53 | # Show paths to a few more than just 1 target. |
Austin Schuh | 00bc093 | 2016-02-14 21:05:34 -0800 | [diff] [blame] | 54 | build --show_result 5 |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 55 | # Dump the output of the failing test to stdout. |
| 56 | test --test_output=errors |
Brian Silverman | b200c17 | 2017-01-02 17:35:35 -0800 | [diff] [blame] | 57 | |
Austin Schuh | 9d92e6b | 2017-10-17 01:19:38 -0700 | [diff] [blame] | 58 | build --experimental_sandbox_base=/dev/shm/ |
Austin Schuh | 35c75e8 | 2017-03-11 21:54:05 -0800 | [diff] [blame] | 59 | build --experimental_multi_threaded_digest |
Austin Schuh | 9d92e6b | 2017-10-17 01:19:38 -0700 | [diff] [blame] | 60 | |
| 61 | build --sandbox_fake_hostname=true |
| 62 | build --sandbox_fake_username=true |
| 63 | |
Austin Schuh | 4f85729 | 2018-02-15 23:42:04 -0800 | [diff] [blame] | 64 | build --auto_cpu_environment_group=//tools:cpus |
Austin Schuh | 9d92e6b | 2017-10-17 01:19:38 -0700 | [diff] [blame] | 65 | startup --host_jvm_args=-Dbazel.DigestFunction=SHA1 |
| 66 | |
| 67 | common --watchfs |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 68 | |
| 69 | # Switch to SHA256 for compatibility with distributed caching. |
| 70 | startup --host_jvm_args=-Dbazel.DigestFunction=SHA256 |
| 71 | |
Austin Schuh | b6043b2 | 2017-11-29 00:14:39 -0800 | [diff] [blame] | 72 | build --spawn_strategy=linux-sandbox |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 73 | build --experimental_sandbox_default_allow_network=false |
| 74 | |
| 75 | # Use our hermetic JDK. |
| 76 | # Note that this doesn't quite work fully, but it should. See |
| 77 | # https://github.com/bazelbuild/bazel/issues/6341 for ongoing discussion with |
| 78 | # upstream about this. |
| 79 | build --javabase=@openjdk_linux_archive//:jdk --host_javabase=@openjdk_linux_archive//:jdk |