aboutsummaryrefslogtreecommitdiff
path: root/.bazelrc
diff options
context:
space:
mode:
Diffstat (limited to '.bazelrc')
-rw-r--r--.bazelrc28
1 files changed, 28 insertions, 0 deletions
diff --git a/.bazelrc b/.bazelrc
index 97fd61c..717b2dc 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -6,3 +6,31 @@ common --experimental_repo_remote_exec
common --cxxopt=-std=c++17
common --host_cxxopt=-std=c++17
common --copt=-w
+
+# Address sanitizer
+# bazel build --config asan
+build:asan --action_env=CC=clang
+build:asan --action_env=CXX=clang++
+build:asan --strip=never
+build:asan --copt -fsanitize=address
+build:asan --copt -DADDRESS_SANITIZER
+build:asan --copt -g
+build:asan --copt -O1
+build:asan --copt -fno-omit-frame-pointer
+build:asan --copt -fno-sanitize-recover=all
+build:asan --linkopt -fsanitize=address
+build:asan --linkopt -shared-libasan
+
+# Undefined Behavior Sanitizer
+# bazel build --config ubsan
+build:ubsan --action_env=CC=clang
+build:ubsan --action_env=CXX=clang++
+build:ubsan --strip=never
+build:ubsan --copt -fsanitize=undefined
+build:ubsan --copt -DUNDEFINED_BEHAVIOR_SANITIZER
+build:ubsan --copt -g
+build:ubsan --copt -O1
+build:ubsan --copt -fno-omit-frame-pointer
+build:ubsan --copt -fno-sanitize-recover=all
+build:ubsan --linkopt -fsanitize=undefined
+build:ubsan --linkopt -lubsan