-
Notifications
You must be signed in to change notification settings - Fork 74
/
.bazelrc
65 lines (56 loc) · 2.39 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
# Address sanitizer
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -O1
build:asan --copt -fno-omit-frame-pointer
build:asan --copt -Wno-error=maybe-uninitialized
build:asan --linkopt -fsanitize=address
build:asan --test_tag_filters=-no_asan
# Thread sanitizer
build:tsan --strip=never
build:tsan --copt -fsanitize=thread
build:tsan --copt -fPIE
build:tsan --copt -O2
build:tsan --copt -g
build:tsan --copt -fno-omit-frame-pointer
build:tsan --copt -DGRPC_TSAN
build:tsan --linkopt -fsanitize=thread
build:tsan --linkopt -pie
# Use -Wl,-ltsan instead of -ltsan to make Bazel link libtsan before all other
# libs in particularly before -lpthread. This allows TSAN to pull in it's own
# version of -lpthread.
build:tsan --linkopt -Wl,-ltsan
# Our default TSAN setup with -pie does not work with some linux versions (e.g.,
# on Travis's trusty). See https://github.com/google/sanitizers/issues/503
# So for TSAN on Travis we use gcc-5, which supports TSAN for non-pie binaries.
build:tsan_nopie --strip=never
build:tsan_nopie --copt -fsanitize=thread
build:tsan_nopie --copt -O2
build:tsan_nopie --copt -g
build:tsan_nopie --copt -fno-omit-frame-pointer
build:tsan_nopie --copt -DGRPC_TSAN
build:tsan_nopie --linkopt -fsanitize=thread
build:tsan_nopie --linkopt -Wl,-ltsan
# Explicitly instruct the compiler to use the gold linker. TSAN uses linker
# options (e.g., --push-state) that are only available in gold linker. On some
# linux versions (e.g., Travis's latest trusty), specifying -fsanitize=thread
# doesn't automatically use the gold linker.
build:tsan_nopie --linkopt -fuse-ld=gold
# Release builds
build:release -c opt
# Add compile option for all C++ files
build --cxxopt -Wnon-virtual-dtor
build --cxxopt -Wformat
build --cxxopt -Wformat-security
fetch --incompatible_remove_native_git_repository=false
fetch --incompatible_remove_native_http_archive=false
fetch --incompatible_package_name_is_a_function=false
build --incompatible_remove_native_git_repository=false
build --incompatible_remove_native_http_archive=false
build --incompatible_package_name_is_a_function=false
# When building gRPC on a Mac, "-DGRPC_BAZEL_BUILD" is required due to
# https://github.com/bazelbuild/bazel/issues/4341
# (Also found in the gRPC .bazelrc)
build --per_file_copt="external/com_github_grpc_grpc/.*@-DGRPC_BAZEL_BUILD"
# Required for nginx tests (Also found in Jenkinsfile)
build --action_env=PERL5LIB=.