-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bazelrc
70 lines (59 loc) · 2.31 KB
/
.bazelrc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Use our custom-configured c++ toolchain.
build:clang_config --crosstool_top=//toolchain:clang_suite
# Use --cpu as a differentiator.
build:clang_config --cpu=k8
# Use the default Bazel C++ toolchain to build the tools used during the
# build.
build:clang_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
# Pretty colors
build --copt=-fdiagnostics-color
# Warnings that we would like our build to emit
build --copt=-Wall
build --copt=-Wextra
build --copt=-Werror
build --copt=-Werror=return-type
build --copt=-Wcast-qual
build --copt=-Woverlength-strings
build --copt=-Wpointer-arith
build --copt=-Wunused-local-typedefs
build --copt=-Wunused-result
build --copt=-Wvarargs
build --copt=-Wvla
build --copt=-Wwrite-strings
build --copt=-Wformat=2
build --copt=-Wno-unknown-pragmas
build --cxxopt=-Wconversion-null
# Set the version of C++ we support and use
build --cxxopt=-std=c++20
build --host_cxxopt=-std=c++20
build --copt=-O3
build:debug --copt=-g3
build:debug --copt=-fno-inline
build:debug --copt=-O0
build:debug --strip=never
# Sanitizer support
build:asan --define sanitizer=true
build:asan --define asan=true
build:asan --features asan
build:asan --copt=-fsanitize=address
build:asan --copt=-fno-omit-frame-pointer
build:asan --copt=-DADDRESS_SANITIZER
build:asan --strip=never
build:asan --linkopt=-fsanitize=address
build:asan --test_env=ASAN_SYMBOLIZER_PATH
build:asan --action_env=ASAN_SYMBOLIZER_PATH
build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:detect_odr_violation=1:detect_stack_use_after_return=1
build:ubsan --define sanitizer=true
build:ubsan --define ubsan=true
build:ubsan --features ubsan
build:ubsan --copt=-fsanitize=address,undefined
build:ubsan --copt=-fno-omit-frame-pointer
build:ubsan --copt=-DADDRESS_SANITIZER
build:ubsan --strip=never
build:ubsan --linkopt=-fsanitize=address,undefined
build:ubsan --test_env=ASAN_SYMBOLIZER_PATH
build:ubsan --action_env=ASAN_SYMBOLIZER_PATH
build:ubsan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1
# Enable them when bazel has better support for that or with explicit linker options.
#build:ubsan --copt -fno-sanitize=vptr,function
#build:ubsan --linkopt -fno-sanitize=vptr,function