-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bazelrc
99 lines (81 loc) · 3.02 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
# Use our custom-configured c++ toolchain.
build:avr_config --crosstool_top=//toolchain:arduino_suite
build:avr_config --cpu=arduino
# Use the default Bazel C++ toolchain to build the tools used during the
# build.
build:avr_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
#MICROCONTROLLER DETAILS
#CPU megahertz
build --copt=-DF_CPU=16000000L
build --copt=-DARDUINO=10819
#board name
build --copt=-DARDUINO_AVR_INDUSTRIAL101
build --copt=-DARDUINO_ARCH_AVR
build --copt=-DUSB_VID=0x2a03
build --copt=-DUSB_PID=0x8056
build --copt=-DUSB_MANUFACTURER="\"Unknown\""
build --copt=-DUSB_PRODUCT="\"Arduino Industrial 101\""
build --copt=-mmcu=atmega32u4
# 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 --copt=-flto
build --copt=-fno-exceptions
build --copt=-ffunction-sections
build --copt=-fdata-sections
build --copt=-fno-threadsafe-statics
build --copt=-Wno-error=narrowing
build --copt=-MMD
build --copt=-Wno-error=volatile
#TODO: DELETE THIS LATER. SHOULD NOT HIDE WARNINGS
build --copt=-Wno-volatile
#look into -fno-fat-lto-object
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=-Os
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