-
Notifications
You must be signed in to change notification settings - Fork 34
/
.bazelrc
125 lines (111 loc) · 4.27 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Import any user defined rules.
try-import %workspace%/user.bazelrc
# Add C++14 compiler flags.
build --cxxopt=-std=c++14
build --host_cxxopt=-std=c++14
# Default to an optimized build.
build -c opt
# lexyacc
build --extra_toolchains=@dreal//third_party/com_github_google_kythe/tools/build_rules:lexyacc_remote_toolchain
# Default build options.
build --force_pic
build --strip=never
build --strict_system_includes
# Default test options.
test --test_output=errors
### Cpplint. ###
# By default, cpplint tests are run as part of `bazel test` alongside all of
# the other compilation and test targets. This is a convenience shortcut to
# only do the cpplint testing and nothing else.
test:cpplint --build_tests_only
test:cpplint --test_tag_filters=cpplint
### ASan build. ###
build:asan --copt=-g
build:asan --copt=-fno-common
build:asan --copt=-fsanitize=address
build:asan --copt=-O0
build:asan --copt=-fno-omit-frame-pointer
build:asan --copt=-fno-optimize-sibling-calls
build:asan --copt=-DCDS_ADDRESS_SANITIZER_ENABLED
build:asan --copt -Wno-macro-redefined
build:asan --copt -D_FORTIFY_SOURCE=0
build:asan --linkopt=-fsanitize=address
build:asan --linkopt=-fuse-ld=ld
build:asan --start_end_lib=no
build:asan --test_env=ASAN_OPTIONS
build:asan --test_env=LSAN_OPTIONS
build:asan --test_tag_filters=-no_asan,-no_lsan
build:asan --test_timeout=120,600,1800,7200
### LSan build. ###
build:lsan --copt=-g
build:lsan --copt=-fno-common
build:lsan --copt=-fsanitize=leak
build:lsan --copt=-O0
build:lsan --copt=-fno-omit-frame-pointer
build:lsan --copt -Wno-macro-redefined
build:lsan --copt -D_FORTIFY_SOURCE=0
build:lsan --linkopt=-fsanitize=leak
build:lsan --test_env=LSAN_OPTIONS
build:lsan --test_env=LSAN_SYMBOLIZER_PATH
build:lsan --test_tag_filters=-no_asan,-no_lsan
build:lsan --test_timeout=120,600,1800,7200
### TSan build. ###
build:tsan --build_tests_only
build:tsan --copt -g
build:tsan --copt -fsanitize=thread
build:tsan --copt -O1
build:tsan --copt -fno-omit-frame-pointer
build:tsan --copt -DCDS_THREAD_SANITIZER_ENABLED
build:tsan --copt -Wno-macro-redefined
build:tsan --copt -D_FORTIFY_SOURCE=0
# From Tsan documentation for Clang-3.9:
# fsanitize=thread flag will cause Clang to act as though the -fPIE flag
# had been supplied if compiling without -fPIC, and as though the
# -pie flag had been supplied if linking an executable
# Bug in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67308
build:tsan --noforce_pic
build:tsan --linkopt -fsanitize=thread
build:tsan --test_env=TSAN_OPTIONS
build:tsan --test_tag_filters=-no_tsan
build:tsan --test_timeout=180,900,2700,10800
### UBSan build. ###
build:ubsan --build_tests_only
build:ubsan --copt -g
build:ubsan --copt -fsanitize=undefined
# Since Bazel uses clang instead of clang++, enabling -fsanitize=vptr would
# require extra linkopts that cause segmentation faults on pure C code.
build:ubsan --copt -fno-sanitize=float-divide-by-zero,vptr
build:ubsan --copt -O1
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --copt -Wno-macro-redefined
build:ubsan --copt -D_FORTIFY_SOURCE=0
build:ubsan --copt -fno-sanitize=float-divide-by-zero,function,vptr
build:ubsan --copt -fsanitize-link-c++-runtime
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -fsanitize-link-c++-runtime
build:ubsan --linkopt -rtlib=compiler-rt
# We need the following in Ubuntu. For now, we pass this via --linkopt in CI.
# build:ubsan --linkopt -lgcc_s
build:ubsan --test_env=UBSAN_OPTIONS
build:ubsan --test_tag_filters=-no_ubsan
build:ubsan --test_timeout=120,600,1800,7200
### Kcov coverage build. ###
build:kcov --copt -g
build:kcov --copt -O0
test:kcov --spawn_strategy=local
test:kcov --run_under //tools:kcov
test:kcov --local_test_jobs=1
test:kcov --test_tag_filters=-cpplint,-pycodestyle,-no_kcov
test:kcov --nocache_test_results
test:kcov --test_timeout=120,600,1800,7200
# When compiling with dReal as the main WORKSPACE (i.e., if and only if this
# rcfile is loaded), we enable -Werror by default for dReal's *own* targets,
# but not for our externals.
#
# Developers may still disable errors locally by passing --copt=-w on the
# command line, or promote *any* warnings even from externals to errors via
# --copt=-Werror.
#
# When compiilng dReal as an external package, this rcfile is not loaded and we
# won't promote warnings to errors by default.
build --copt=-Werror