aboutsummaryrefslogtreecommitdiff
path: root/.bazelrc
blob: ed993c54cb5a257987bf7aef8abf7bae4b8fbb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

# Flag to enable remote config
common --experimental_repo_remote_exec
common --cxxopt=-std=c++17
common --host_cxxopt=-std=c++17
common --copt=-w
common --copt=-U_FORTIFY_SOURCE
common --copt=-D_FORTIFY_SOURCE=2

# 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