-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.bazelrc
64 lines (57 loc) · 2.87 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
try-import %workspace%/gcb/rbe/remote.bazelrc
build --cxxopt='-std=c++17'
build --cxxopt='-Werror' --cxxopt='-Wall'
# This feature disables warnings in include paths from external repos. This is
# useful because it allows us to ignore non-serious flaws in code for which we
# are not directly responsible.
build --features=external_include_paths
# Why are we doing this when Souffle-generated C++ clearly uses exceptions?
# Well, Google famously does not like C++ exceptions in its internal codebase,
# so we will need to explicitly override that in Raksha files everywhere we
# build Souffle C++ code to have Raksha build when imported into Google. This
# default acts as a simulation of that property of Google's internal codebase.
build --cxxopt='-fno-exceptions'
build --host_cxxopt='-std=c++17'
# Note: We usually try to keep the cxxopt and host_cxxopt consistent. That is
# not a good idea for this line. It appears that adding -Werror to host_cxxopt
# causes the compiler to use this flag when building dependencies that we build
# from source. This causes the build to fail if our source dependencies are not
# warning-clean. We also comment out -Wall so that we do not receive extra
# warnings from our third party packages.
# build --host_cxxopt='-Werror' --host_cxxopt='-Wall'
#
# This warning is just a bad one, common return optimizations make its advice
# the wrong thing to do.
build --cxxopt='-Wno-return-std-move'
build --host_cxxopt='-Wno-return-std-move'
# These are needed on systems with GLIBC > 2.34-8 to build google-fuzztest
# which has these errors.
build --cxxopt='-Wno-error=sign-compare'
build --cxxopt='-Wno-error=attributes'
build --host_cxxopt='-Wno-error=sign-compare'
build --host_cxxopt='-Wno-error=attributes'
# Annoyingly, in the fuzztest library, their attempt to turn off the `-Wpsabi`
# warning in Clang causes Clang to complain about an unknown warning flag. This
# is our attempt to work around that.
build --cxxopt='-Wno-unknown-warning-option'
build --host_cxxopt='-Wno-unknown-warning-option'
# The fuzztest library also has a conflict in one of its `.cc` files in
# a macro. When https://github.com/google/fuzztest/issues/41 is fixed, we
# should re-enable this warning.
build --cxxopt='-Wno-macro-redefined'
build --host_cxxopt='-Wno-macro-redefined'
# The grammar generated by Antlr for SQLite does not use parens as
# -Wlogical-op-parentheses would like.
build --cxxopt='-Wno-logical-op-parentheses'
build --host_cxxopt='-Wno-logical-op-parentheses'
# Similarly, we should not set this flag that we're using as a debugging
# assistant when compiling third party libraries.
# build --host_cxxopt='-fno-exceptions'
# ASAN config for exposing memory errors.
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -O1
build:asan --copt -g
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address