aboutsummaryrefslogtreecommitdiff
path: root/.bazelrc
diff options
context:
space:
mode:
authorTom Allsop <tom.allsop@arm.com>2022-11-04 10:40:10 +0000
committerTom Allsop <tom.allsop@arm.com>2022-11-14 11:35:09 +0000
commitb4240d3aa133b8eefd253498e3f2cc321e24ab84 (patch)
tree0fc478cdfc2ed902eda7d0c9afe2734987047c89 /.bazelrc
parent04a2328f9683b7fe97579a3310d2f473f38717dd (diff)
downloadtosa_checker-b4240d3aa133b8eefd253498e3f2cc321e24ab84.tar.gz
Added ASAN & UBSAN build options and Dockerfile for sanitized builds
* Added SanitizerBuild.Dockerfile for running sanitized builds. * Added dependencies for bandit into SanitizerBuild.Dockerfile. * Added --sanitizer option to setup.py. * Added .bandit.yaml. Change-Id: I4dd41bc52790a1b7f17ffca556362e37860ab572
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