blob: 3a80a06918bd58ffaee730e30b16e7454281b129 [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 {
156 action: "c-compile"
157 flag_group {
158 flag: "-std=gnu99"
159 }
160 }
161 flag_set {
162 action: "c++-compile"
163 action: "c++-header-parsing"
164 action: "c++-header-preprocessing"
165 action: "c++-module-compile"
166 flag_group {
167 flag: "-std=gnu++11"
168 }
Brian Silverman23a1b342015-10-11 23:44:09 -0400169 }
170 flag_set {
171 action: "preprocess-assemble"
Austin Schuh23da18b2015-10-11 20:52:49 -0700172 action: "assemble"
173 action: "c++-link"
Brian Silverman23a1b342015-10-11 23:44:09 -0400174 action: "c++-compile"
175 action: "c++-header-parsing"
176 action: "c++-header-preprocessing"
177 action: "c++-module-compile"
Austin Schuh23da18b2015-10-11 20:52:49 -0700178 action: "c-compile"
Brian Silverman5dc00072015-10-12 00:38:14 -0400179 flag_group {
Brian Silverman12b3fc52015-10-11 19:38:33 -0400180 # We always want to compile with -pthread semantics.
Brian Silverman5dc00072015-10-12 00:38:14 -0400181 flag: "-pthread"
182 }
Brian Silverman12b3fc52015-10-11 19:38:33 -0400183 }
184 }
185
186 # Anticipated future default.
187 # This makes GCC and Clang do what we want when called through symlinks.
188 unfiltered_cxx_flag: "-no-canonical-prefixes"
189 linker_flag: "-no-canonical-prefixes"
190
191 # Things that the code wants defined.
192 compiler_flag: "-D__STDC_FORMAT_MACROS"
193 compiler_flag: "-D__STDC_CONSTANT_MACROS"
194 compiler_flag: "-D__STDC_LIMIT_MACROS"
195 compiler_flag: "-D_FILE_OFFSET_BITS=64"
196 # TODO(Brian): Rename this or something.
Austin Schuh23da18b2015-10-11 20:52:49 -0700197 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400198
199 linker_flag: "-fuse-ld=gold"
200
201 # Temporary escape hatch for the Gyp->Bazel conversion.
202 # TODO(Brian): Remove this.
203 compiler_flag: "-DAOS_BAZEL"
204
205 # Make C++ compilation deterministic. Use linkstamping instead of these
206 # compiler symbols.
207 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
208 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
209 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
210 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
211
212 # Security hardening on by default.
213 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
214 # We need to undef it before redefining it as some distributions now have
215 # it enabled by default.
216 compiler_flag: "-U_FORTIFY_SOURCE"
217 compiler_flag: "-D_FORTIFY_SOURCE=1"
218 compiler_flag: "-fstack-protector"
219 compiler_flag: "-fPIE"
220 linker_flag: "-pie"
221 linker_flag: "-Wl,-z,relro,-z,now"
222
223 # Pretty much everything needs this, including parts of the glibc STL...
224 linker_flag: "-lm"
225
226 # Enable coloring even if there's no attached terminal. Bazel removes the
227 # escape sequences if --nocolor is specified.
228 compiler_flag: "-fcolor-diagnostics"
229
230 compiler_flag: "-Wall"
231 compiler_flag: "-Wextra"
232 compiler_flag: "-Wswitch-enum"
233 compiler_flag: "-Wpointer-arith"
234 compiler_flag: "-Wstrict-aliasing=2"
235 compiler_flag: "-Wcast-qual"
236 compiler_flag: "-Wcast-align"
237 compiler_flag: "-Wwrite-strings"
238 compiler_flag: "-Wtype-limits"
239 compiler_flag: "-Wsign-compare"
240 compiler_flag: "-Wformat=2"
241 compiler_flag: "-Werror"
242
243 # Keep stack frames for debugging, even in opt mode.
244 compiler_flag: "-fno-omit-frame-pointer"
245
246 # Don't use temp files while compiling.
247 compiler_flag: "-pipe"
248
Brian Silverman12b3fc52015-10-11 19:38:33 -0400249 # Stamp the binary with a unique identifier.
250 linker_flag: "-Wl,--build-id=md5"
251 linker_flag: "-Wl,--hash-style=gnu"
252 linker_flag: "-Wl,--warn-execstack"
253 linker_flag: "-Wl,--detect-odr-violations"
254
255 compilation_mode_flags {
256 mode: DBG
257 # Enable debug symbols.
258 compiler_flag: "-ggdb3"
259 }
260 compilation_mode_flags {
261 mode: OPT
262
263 # No debug symbols.
264 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
265 # even generally? However, that can't happen here, as it requires special
266 # handling in Bazel.
267 compiler_flag: "-g0"
268
269 compiler_flag: "-Oz"
270
271 # Disable assertions
272 compiler_flag: "-DNDEBUG"
273
274 # Removal of unused code and data at link time (can this increase binary size in some cases?).
275 compiler_flag: "-ffunction-sections"
276 compiler_flag: "-fdata-sections"
277 linker_flag: "-Wl,--gc-sections"
278 }
279}
Austin Schuh23da18b2015-10-11 20:52:49 -0700280
281toolchain {
282 abi_version: "roborio"
283 abi_libc_version: "roborio"
284 builtin_sysroot: ""
285 compiler: "gcc"
286 host_system_name: "roborio"
287 needsPic: true
288 supports_gold_linker: false
289 supports_incremental_linker: false
290 supports_fission: false
291 supports_interface_shared_objects: false
292 supports_normalizing_ar: false
293 supports_start_end_lib: false
294 supports_thin_archives: false
295 target_libc: "roborio"
296 target_cpu: "roborio"
297 target_system_name: "roborio"
298 toolchain_identifier: "roborio_linux"
299
Austin Schuh55139fe2015-10-14 23:55:24 -0700300 tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
301 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
302 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
303 tool_path { name: "dwp" path: "/bin/false" }
304 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
305 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700306 # C(++) compiles invoke the compiler (as that is the one knowing where
307 # to find libraries), but we provide LD so other rules can invoke the linker.
Austin Schuh55139fe2015-10-14 23:55:24 -0700308 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
309 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
310 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700311 objcopy_embed_flag: "-I"
312 objcopy_embed_flag: "binary"
Austin Schuh55139fe2015-10-14 23:55:24 -0700313 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
314 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700315
316 # TODO(bazel-team): In theory, the path here ought to exactly match the path
317 # used by gcc. That works because bazel currently doesn't track files at
318 # absolute locations and has no remote execution, yet. However, this will need
319 # to be fixed, maybe with auto-detection?
320 cxx_builtin_include_directory: "/usr/lib/gcc/"
321 cxx_builtin_include_directory: "/usr/local/include"
322 cxx_builtin_include_directory: "/usr/include"
323
324 linker_flag: "-lstdc++"
325 #linker_flag: "-B/usr/bin/"
326
327 feature {
328 name: "opt"
329 implies: "all_modes"
330 flag_set {
331 action: "preprocess-assemble"
332 action: "c-compile"
333 action: "c++-compile"
334 action: "c++-header-parsing"
335 action: "c++-header-preprocessing"
336 action: "c++-module-compile"
337 flag_group {
338 flag: "-DAOS_DEBUG=0"
339 }
340 }
341 }
342
343 feature {
344 name: "dbg"
345 implies: "all_modes"
346 flag_set {
347 action: "preprocess-assemble"
348 action: "c-compile"
349 action: "c++-compile"
350 action: "c++-header-parsing"
351 action: "c++-header-preprocessing"
352 action: "c++-module-compile"
353 flag_group {
354 flag: "-DAOS_DEBUG=1"
355 }
356 }
357 }
358
359 feature {
360 name: "fastbuild"
361 implies: "all_modes"
362 flag_set {
363 action: "preprocess-assemble"
364 action: "c-compile"
365 action: "c++-compile"
366 action: "c++-header-parsing"
367 action: "c++-header-preprocessing"
368 action: "c++-module-compile"
369 flag_group {
370 flag: "-DAOS_DEBUG=0"
371 }
372 }
373 }
374
375 feature {
376 name: "all_modes"
377 flag_set {
378 action: "c-compile"
379 flag_group {
380 flag: "-std=gnu99"
381 }
382 }
383 flag_set {
384 action: "preprocess-assemble"
385 action: "assemble"
386 action: "c++-link"
387 flag_group {
388 flag: "-std=gnu99"
389 }
390 }
391 flag_set {
392 action: "c++-compile"
393 action: "c++-header-parsing"
394 action: "c++-header-preprocessing"
395 action: "c++-module-compile"
396 flag_group {
397 flag: "-std=gnu++1y"
398 }
399 }
400 flag_set {
401 action: "preprocess-assemble"
402 action: "assemble"
403 action: "c++-link"
404 action: "c++-compile"
405 action: "c++-header-parsing"
406 action: "c++-header-preprocessing"
407 action: "c++-module-compile"
408 action: "c-compile"
409 flag_group {
410 # We always want to compile with -pthread semantics.
411 flag: "-pthread"
412 }
413 }
414 }
415
416 # Anticipated future default.
417 # This makes GCC and Clang do what we want when called through symlinks.
418 unfiltered_cxx_flag: "-no-canonical-prefixes"
419 linker_flag: "-no-canonical-prefixes"
420
421 # Things that the code wants defined.
422 compiler_flag: "-D__STDC_FORMAT_MACROS"
423 compiler_flag: "-D__STDC_CONSTANT_MACROS"
424 compiler_flag: "-D__STDC_LIMIT_MACROS"
425 compiler_flag: "-D_FILE_OFFSET_BITS=64"
426 # TODO(Brian): Rename this or something.
427 #compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
428
429 #linker_flag: "-fuse-ld=gold"
430
431 # Temporary escape hatch for the Gyp->Bazel conversion.
432 # TODO(Brian): Remove this.
433 compiler_flag: "-DAOS_BAZEL"
434
435 # Make C++ compilation deterministic. Use linkstamping instead of these
436 # compiler symbols.
437 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
438 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
439 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
440 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
441
442 # Security hardening on by default.
443 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
444 # We need to undef it before redefining it as some distributions now have
445 # it enabled by default.
446 compiler_flag: "-U_FORTIFY_SOURCE"
447 compiler_flag: "-fstack-protector"
448 compiler_flag: "-fPIE"
449 linker_flag: "-pie"
450 linker_flag: "-Wl,-z,relro,-z,now"
451
452 # Pretty much everything needs this, including parts of the glibc STL...
453 linker_flag: "-lm"
454
455 # Enable coloring even if there's no attached terminal. Bazel removes the
456 # escape sequences if --nocolor is specified.
457 compiler_flag: "-fdiagnostics-color=always"
458
459 compiler_flag: "-Wall"
460 compiler_flag: "-Wextra"
461 compiler_flag: "-Wswitch-enum"
462 compiler_flag: "-Wpointer-arith"
463 compiler_flag: "-Wstrict-aliasing=2"
464 compiler_flag: "-Wcast-qual"
465 compiler_flag: "-Wcast-align"
466 compiler_flag: "-Wwrite-strings"
467 compiler_flag: "-Wtype-limits"
468 compiler_flag: "-Wsign-compare"
469 compiler_flag: "-Wformat=2"
470 compiler_flag: "-Werror"
471
472 # Keep stack frames for debugging, even in opt mode.
473 compiler_flag: "-fno-omit-frame-pointer"
474 compiler_flag: "-D__has_feature(x)=0"
475
476 # Don't use temp files while compiling.
477 compiler_flag: "-pipe"
478
479 # Have GCC return the exit code from ld.
480 linker_flag: "-pass-exit-codes"
481
482 # Stamp the binary with a unique identifier.
483 linker_flag: "-Wl,--build-id=md5"
484 linker_flag: "-Wl,--hash-style=gnu"
485 #linker_flag: "-Wl,--warn-execstack"
486 #linker_flag: "-Wl,--detect-odr-violations"
487
488 compilation_mode_flags {
489 mode: DBG
490 # Enable debug symbols.
491 compiler_flag: "-ggdb3"
492 }
493 compilation_mode_flags {
494 mode: OPT
495
496 # No debug symbols.
497 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
498 # even generally? However, that can't happen here, as it requires special
499 # handling in Bazel.
500 compiler_flag: "-g0"
501
502 compiler_flag: "-Oz"
503
504 # Disable assertions
505 compiler_flag: "-DNDEBUG"
506 compiler_flag: "-D_FORTIFY_SOURCE=1"
507
508 # Removal of unused code and data at link time (can this increase binary size in some cases?).
509 compiler_flag: "-ffunction-sections"
510 compiler_flag: "-fdata-sections"
511 linker_flag: "-Wl,--gc-sections"
512 }
513}