blob: 29170766efe59909be66e43ad058dffb46564b97 [file] [log] [blame]
Brian Silverman12b3fc52015-10-11 19:38:33 -04001major_version: "local"
2minor_version: ""
3default_target_cpu: "same_as_host"
4
5default_toolchain {
Austin Schuh23da18b2015-10-11 20:52:49 -07006 cpu: "roborio"
7 toolchain_identifier: "roborio_linux"
8}
9
10default_toolchain {
Brian Silverman12b3fc52015-10-11 19:38:33 -040011 cpu: "k8"
Austin Schuh23da18b2015-10-11 20:52:49 -070012 toolchain_identifier: "k8_linux"
Brian Silverman12b3fc52015-10-11 19:38:33 -040013}
14
15default_toolchain {
16 cpu: "armeabi-v7a"
17 toolchain_identifier: "stub_armeabi-v7a"
18}
19
20
21toolchain {
22 abi_version: "armeabi-v7a"
23 abi_libc_version: "armeabi-v7a"
24 builtin_sysroot: ""
25 compiler: "compiler"
26 host_system_name: "armeabi-v7a"
27 needsPic: true
28 supports_gold_linker: false
29 supports_incremental_linker: false
30 supports_fission: false
31 supports_interface_shared_objects: false
32 supports_normalizing_ar: false
33 supports_start_end_lib: false
34 supports_thin_archives: false
35 target_libc: "armeabi-v7a"
36 target_cpu: "armeabi-v7a"
37 target_system_name: "armeabi-v7a"
38 toolchain_identifier: "stub_armeabi-v7a"
39
40 tool_path { name: "ar" path: "/bin/false" }
41 tool_path { name: "compat-ld" path: "/bin/false" }
42 tool_path { name: "cpp" path: "/bin/false" }
43 tool_path { name: "dwp" path: "/bin/false" }
44 tool_path { name: "gcc" path: "/bin/false" }
45 tool_path { name: "gcov" path: "/bin/false" }
46 tool_path { name: "ld" path: "/bin/false" }
47
48 tool_path { name: "nm" path: "/bin/false" }
49 tool_path { name: "objcopy" path: "/bin/false" }
50 tool_path { name: "objdump" path: "/bin/false" }
51 tool_path { name: "strip" path: "/bin/false" }
52}
53
54toolchain {
55 abi_version: "local"
56 abi_libc_version: "local"
57 builtin_sysroot: ""
Austin Schuh23da18b2015-10-11 20:52:49 -070058 compiler: "clang"
Brian Silverman12b3fc52015-10-11 19:38:33 -040059 host_system_name: "local"
60 needsPic: true
61 supports_gold_linker: false
62 supports_incremental_linker: false
63 supports_fission: false
64 supports_interface_shared_objects: false
65 supports_normalizing_ar: false
66 supports_start_end_lib: false
67 supports_thin_archives: false
68 target_libc: "local"
Austin Schuh23da18b2015-10-11 20:52:49 -070069 target_cpu: "k8"
70 target_system_name: "k8"
71 toolchain_identifier: "k8_linux"
Brian Silverman12b3fc52015-10-11 19:38:33 -040072
73 tool_path { name: "ar" path: "/usr/bin/ar" }
74 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
75 tool_path { name: "cpp" path: "/usr/bin/cpp" }
76 tool_path { name: "dwp" path: "/usr/bin/dwp" }
77 tool_path { name: "gcc" path: "/usr/bin/clang-3.6" }
78 tool_path { name: "gcov" path: "/usr/bin/gcov" }
79 # C(++) compiles invoke the compiler (as that is the one knowing where
80 # to find libraries), but we provide LD so other rules can invoke the linker.
81 tool_path { name: "ld" path: "/usr/bin/ld" }
82 tool_path { name: "nm" path: "/usr/bin/nm" }
83 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
84 objcopy_embed_flag: "-I"
85 objcopy_embed_flag: "binary"
86 tool_path { name: "objdump" path: "/usr/bin/objdump" }
87 tool_path { name: "strip" path: "/usr/bin/strip" }
88
89 # TODO(bazel-team): In theory, the path here ought to exactly match the path
90 # used by gcc. That works because bazel currently doesn't track files at
91 # absolute locations and has no remote execution, yet. However, this will need
92 # to be fixed, maybe with auto-detection?
Austin Schuh7b684d32015-10-21 20:17:09 -070093 cxx_builtin_include_directory: '/usr/include/c++/4.9'
94 cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu/c++/4.9'
95 cxx_builtin_include_directory: '/usr/include/c++/4.9/backward'
96 cxx_builtin_include_directory: '/usr/local/include'
97 cxx_builtin_include_directory: '/usr/lib/llvm-3.6/lib/clang/3.6.2/include'
98 cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu'
99 cxx_builtin_include_directory: '/usr/include'
100 cxx_builtin_include_directory: '/usr/lib/clang/3.6.2/include/'
Brian Silverman12b3fc52015-10-11 19:38:33 -0400101
102 linker_flag: "-lstdc++"
103 linker_flag: "-B/usr/bin/"
104
105 feature {
106 name: "opt"
107 implies: "all_modes"
108 flag_set {
109 action: "preprocess-assemble"
110 action: "c-compile"
111 action: "c++-compile"
112 action: "c++-header-parsing"
113 action: "c++-header-preprocessing"
114 action: "c++-module-compile"
115 flag_group {
116 flag: "-DAOS_DEBUG=0"
117 }
118 }
119 }
120
121 feature {
122 name: "dbg"
123 implies: "all_modes"
124 flag_set {
125 action: "preprocess-assemble"
126 action: "c-compile"
127 action: "c++-compile"
128 action: "c++-header-parsing"
129 action: "c++-header-preprocessing"
130 action: "c++-module-compile"
131 flag_group {
132 flag: "-DAOS_DEBUG=1"
133 }
134 }
135 }
136
137 feature {
138 name: "fastbuild"
139 implies: "all_modes"
140 flag_set {
141 action: "preprocess-assemble"
142 action: "c-compile"
143 action: "c++-compile"
144 action: "c++-header-parsing"
145 action: "c++-header-preprocessing"
146 action: "c++-module-compile"
147 flag_group {
148 flag: "-DAOS_DEBUG=0"
149 }
150 }
151 }
152
153 feature {
154 name: "all_modes"
155 flag_set {
Austin Schuha20ae722015-11-01 12:29:38 -0800156 action: "preprocess-assemble"
157 action: "assemble"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400158 action: "c-compile"
159 flag_group {
160 flag: "-std=gnu99"
161 }
162 }
163 flag_set {
164 action: "c++-compile"
165 action: "c++-header-parsing"
166 action: "c++-header-preprocessing"
167 action: "c++-module-compile"
168 flag_group {
Austin Schuha20ae722015-11-01 12:29:38 -0800169 flag: "-std=gnu++1y"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400170 }
Brian Silverman23a1b342015-10-11 23:44:09 -0400171 }
172 flag_set {
173 action: "preprocess-assemble"
Austin Schuh23da18b2015-10-11 20:52:49 -0700174 action: "assemble"
175 action: "c++-link"
Brian Silverman23a1b342015-10-11 23:44:09 -0400176 action: "c++-compile"
177 action: "c++-header-parsing"
178 action: "c++-header-preprocessing"
179 action: "c++-module-compile"
Austin Schuh23da18b2015-10-11 20:52:49 -0700180 action: "c-compile"
Brian Silverman5dc00072015-10-12 00:38:14 -0400181 flag_group {
Brian Silverman12b3fc52015-10-11 19:38:33 -0400182 # We always want to compile with -pthread semantics.
Brian Silverman5dc00072015-10-12 00:38:14 -0400183 flag: "-pthread"
184 }
Brian Silverman12b3fc52015-10-11 19:38:33 -0400185 }
186 }
187
188 # Anticipated future default.
189 # This makes GCC and Clang do what we want when called through symlinks.
190 unfiltered_cxx_flag: "-no-canonical-prefixes"
191 linker_flag: "-no-canonical-prefixes"
192
193 # Things that the code wants defined.
194 compiler_flag: "-D__STDC_FORMAT_MACROS"
195 compiler_flag: "-D__STDC_CONSTANT_MACROS"
196 compiler_flag: "-D__STDC_LIMIT_MACROS"
197 compiler_flag: "-D_FILE_OFFSET_BITS=64"
198 # TODO(Brian): Rename this or something.
Austin Schuh23da18b2015-10-11 20:52:49 -0700199 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400200
201 linker_flag: "-fuse-ld=gold"
202
Brian Silverman12b3fc52015-10-11 19:38:33 -0400203 # Make C++ compilation deterministic. Use linkstamping instead of these
204 # compiler symbols.
205 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
206 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
207 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
208 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
209
210 # Security hardening on by default.
211 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
212 # We need to undef it before redefining it as some distributions now have
213 # it enabled by default.
214 compiler_flag: "-U_FORTIFY_SOURCE"
215 compiler_flag: "-D_FORTIFY_SOURCE=1"
216 compiler_flag: "-fstack-protector"
217 compiler_flag: "-fPIE"
218 linker_flag: "-pie"
219 linker_flag: "-Wl,-z,relro,-z,now"
220
221 # Pretty much everything needs this, including parts of the glibc STL...
222 linker_flag: "-lm"
223
224 # Enable coloring even if there's no attached terminal. Bazel removes the
225 # escape sequences if --nocolor is specified.
226 compiler_flag: "-fcolor-diagnostics"
227
228 compiler_flag: "-Wall"
229 compiler_flag: "-Wextra"
230 compiler_flag: "-Wswitch-enum"
231 compiler_flag: "-Wpointer-arith"
Brian Silverman594be0d2015-10-31 17:56:23 -0400232 compiler_flag: "-Wstrict-aliasing"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400233 compiler_flag: "-Wcast-qual"
234 compiler_flag: "-Wcast-align"
235 compiler_flag: "-Wwrite-strings"
236 compiler_flag: "-Wtype-limits"
237 compiler_flag: "-Wsign-compare"
238 compiler_flag: "-Wformat=2"
239 compiler_flag: "-Werror"
240
241 # Keep stack frames for debugging, even in opt mode.
242 compiler_flag: "-fno-omit-frame-pointer"
243
244 # Don't use temp files while compiling.
245 compiler_flag: "-pipe"
246
Brian Silverman12b3fc52015-10-11 19:38:33 -0400247 # Stamp the binary with a unique identifier.
248 linker_flag: "-Wl,--build-id=md5"
249 linker_flag: "-Wl,--hash-style=gnu"
250 linker_flag: "-Wl,--warn-execstack"
251 linker_flag: "-Wl,--detect-odr-violations"
252
253 compilation_mode_flags {
254 mode: DBG
255 # Enable debug symbols.
256 compiler_flag: "-ggdb3"
257 }
258 compilation_mode_flags {
259 mode: OPT
260
Austin Schuha20ae722015-11-01 12:29:38 -0800261 compiler_flag: "-O2"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400262
263 # Disable assertions
264 compiler_flag: "-DNDEBUG"
265
266 # Removal of unused code and data at link time (can this increase binary size in some cases?).
267 compiler_flag: "-ffunction-sections"
268 compiler_flag: "-fdata-sections"
269 linker_flag: "-Wl,--gc-sections"
270 }
271}
Austin Schuh23da18b2015-10-11 20:52:49 -0700272
273toolchain {
274 abi_version: "roborio"
275 abi_libc_version: "roborio"
276 builtin_sysroot: ""
277 compiler: "gcc"
278 host_system_name: "roborio"
279 needsPic: true
280 supports_gold_linker: false
281 supports_incremental_linker: false
282 supports_fission: false
283 supports_interface_shared_objects: false
284 supports_normalizing_ar: false
285 supports_start_end_lib: false
286 supports_thin_archives: false
287 target_libc: "roborio"
288 target_cpu: "roborio"
289 target_system_name: "roborio"
290 toolchain_identifier: "roborio_linux"
291
Austin Schuh55139fe2015-10-14 23:55:24 -0700292 tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
293 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
294 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
295 tool_path { name: "dwp" path: "/bin/false" }
296 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
297 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700298 # C(++) compiles invoke the compiler (as that is the one knowing where
299 # to find libraries), but we provide LD so other rules can invoke the linker.
Austin Schuh55139fe2015-10-14 23:55:24 -0700300 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
301 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
302 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700303 objcopy_embed_flag: "-I"
304 objcopy_embed_flag: "binary"
Austin Schuh55139fe2015-10-14 23:55:24 -0700305 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
306 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700307
Austin Schuh044e18b2015-10-21 20:17:09 -0700308 compiler_flag: "--sysroot=external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi"
309 compiler_flag: "-nostdinc"
310 compiler_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500311 compiler_flag: "external/arm-frc-linux-gnueabi-repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include",
Austin Schuh044e18b2015-10-21 20:17:09 -0700312 compiler_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500313 compiler_flag: "external/arm-frc-linux-gnueabi-repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed"
Austin Schuh044e18b2015-10-21 20:17:09 -0700314 compiler_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500315 compiler_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/usr/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700316
317 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500318 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3"
Austin Schuh044e18b2015-10-21 20:17:09 -0700319 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500320 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3/arm-frc-linux-gnueabi"
Austin Schuh044e18b2015-10-21 20:17:09 -0700321 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500322 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3/backward"
Austin Schuh044e18b2015-10-21 20:17:09 -0700323 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500324 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700325 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500326 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed"
Austin Schuh044e18b2015-10-21 20:17:09 -0700327 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500328 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700329 cxx_flag: "-isystem"
Brian Silvermanb2215d02015-11-23 19:10:15 -0500330 cxx_flag: "external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi/usr/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700331
Austin Schuh23da18b2015-10-11 20:52:49 -0700332 # TODO(bazel-team): In theory, the path here ought to exactly match the path
333 # used by gcc. That works because bazel currently doesn't track files at
334 # absolute locations and has no remote execution, yet. However, this will need
335 # to be fixed, maybe with auto-detection?
Brian Silvermanb2215d02015-11-23 19:10:15 -0500336 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3"
337 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/arm-frc-linux-gnueabi"
338 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/backward"
339 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include)%"
340 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed)%"
341 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%"
342 cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/usr/include)%"
Austin Schuh23da18b2015-10-11 20:52:49 -0700343
344 linker_flag: "-lstdc++"
345 #linker_flag: "-B/usr/bin/"
346
347 feature {
348 name: "opt"
349 implies: "all_modes"
350 flag_set {
351 action: "preprocess-assemble"
352 action: "c-compile"
353 action: "c++-compile"
354 action: "c++-header-parsing"
355 action: "c++-header-preprocessing"
356 action: "c++-module-compile"
357 flag_group {
358 flag: "-DAOS_DEBUG=0"
359 }
360 }
361 }
362
363 feature {
364 name: "dbg"
365 implies: "all_modes"
366 flag_set {
367 action: "preprocess-assemble"
368 action: "c-compile"
369 action: "c++-compile"
370 action: "c++-header-parsing"
371 action: "c++-header-preprocessing"
372 action: "c++-module-compile"
373 flag_group {
374 flag: "-DAOS_DEBUG=1"
375 }
376 }
377 }
378
379 feature {
380 name: "fastbuild"
381 implies: "all_modes"
382 flag_set {
383 action: "preprocess-assemble"
384 action: "c-compile"
385 action: "c++-compile"
386 action: "c++-header-parsing"
387 action: "c++-header-preprocessing"
388 action: "c++-module-compile"
389 flag_group {
390 flag: "-DAOS_DEBUG=0"
391 }
392 }
393 }
394
395 feature {
396 name: "all_modes"
397 flag_set {
398 action: "c-compile"
399 flag_group {
400 flag: "-std=gnu99"
401 }
402 }
403 flag_set {
404 action: "preprocess-assemble"
405 action: "assemble"
406 action: "c++-link"
407 flag_group {
408 flag: "-std=gnu99"
409 }
410 }
411 flag_set {
412 action: "c++-compile"
413 action: "c++-header-parsing"
414 action: "c++-header-preprocessing"
415 action: "c++-module-compile"
416 flag_group {
417 flag: "-std=gnu++1y"
418 }
419 }
420 flag_set {
421 action: "preprocess-assemble"
422 action: "assemble"
423 action: "c++-link"
424 action: "c++-compile"
425 action: "c++-header-parsing"
426 action: "c++-header-preprocessing"
427 action: "c++-module-compile"
428 action: "c-compile"
429 flag_group {
430 # We always want to compile with -pthread semantics.
431 flag: "-pthread"
432 }
433 }
434 }
435
436 # Anticipated future default.
437 # This makes GCC and Clang do what we want when called through symlinks.
438 unfiltered_cxx_flag: "-no-canonical-prefixes"
439 linker_flag: "-no-canonical-prefixes"
440
441 # Things that the code wants defined.
442 compiler_flag: "-D__STDC_FORMAT_MACROS"
443 compiler_flag: "-D__STDC_CONSTANT_MACROS"
444 compiler_flag: "-D__STDC_LIMIT_MACROS"
445 compiler_flag: "-D_FILE_OFFSET_BITS=64"
446 # TODO(Brian): Rename this or something.
Austin Schuha20ae722015-11-01 12:29:38 -0800447 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
Austin Schuh23da18b2015-10-11 20:52:49 -0700448
449 #linker_flag: "-fuse-ld=gold"
450
Austin Schuh23da18b2015-10-11 20:52:49 -0700451 # Make C++ compilation deterministic. Use linkstamping instead of these
452 # compiler symbols.
453 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
454 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
455 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
456 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
457
458 # Security hardening on by default.
459 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
460 # We need to undef it before redefining it as some distributions now have
461 # it enabled by default.
462 compiler_flag: "-U_FORTIFY_SOURCE"
463 compiler_flag: "-fstack-protector"
464 compiler_flag: "-fPIE"
465 linker_flag: "-pie"
466 linker_flag: "-Wl,-z,relro,-z,now"
467
468 # Pretty much everything needs this, including parts of the glibc STL...
469 linker_flag: "-lm"
470
471 # Enable coloring even if there's no attached terminal. Bazel removes the
472 # escape sequences if --nocolor is specified.
473 compiler_flag: "-fdiagnostics-color=always"
474
475 compiler_flag: "-Wall"
476 compiler_flag: "-Wextra"
477 compiler_flag: "-Wswitch-enum"
478 compiler_flag: "-Wpointer-arith"
Brian Silverman594be0d2015-10-31 17:56:23 -0400479 compiler_flag: "-Wstrict-aliasing"
Austin Schuh23da18b2015-10-11 20:52:49 -0700480 compiler_flag: "-Wcast-qual"
481 compiler_flag: "-Wcast-align"
482 compiler_flag: "-Wwrite-strings"
483 compiler_flag: "-Wtype-limits"
484 compiler_flag: "-Wsign-compare"
485 compiler_flag: "-Wformat=2"
486 compiler_flag: "-Werror"
487
488 # Keep stack frames for debugging, even in opt mode.
489 compiler_flag: "-fno-omit-frame-pointer"
490 compiler_flag: "-D__has_feature(x)=0"
491
492 # Don't use temp files while compiling.
493 compiler_flag: "-pipe"
494
495 # Have GCC return the exit code from ld.
496 linker_flag: "-pass-exit-codes"
497
498 # Stamp the binary with a unique identifier.
499 linker_flag: "-Wl,--build-id=md5"
500 linker_flag: "-Wl,--hash-style=gnu"
501 #linker_flag: "-Wl,--warn-execstack"
502 #linker_flag: "-Wl,--detect-odr-violations"
503
504 compilation_mode_flags {
505 mode: DBG
506 # Enable debug symbols.
507 compiler_flag: "-ggdb3"
508 }
509 compilation_mode_flags {
510 mode: OPT
511
Brian Silverman594be0d2015-10-31 17:56:23 -0400512 compiler_flag: "-O2"
Austin Schuh23da18b2015-10-11 20:52:49 -0700513
514 # Disable assertions
515 compiler_flag: "-DNDEBUG"
516 compiler_flag: "-D_FORTIFY_SOURCE=1"
517
518 # Removal of unused code and data at link time (can this increase binary size in some cases?).
519 compiler_flag: "-ffunction-sections"
520 compiler_flag: "-fdata-sections"
521 linker_flag: "-Wl,--gc-sections"
522 }
523}