blob: 682ce1e11ef319d9f26c3f3599914574a73ae369 [file] [log] [blame]
Brian Silverman7b8899e2018-06-30 19:19:24 -07001major_version: "local"
2minor_version: ""
3default_target_cpu: "same_as_host"
4
5default_toolchain {
6 cpu: "roborio"
7 toolchain_identifier: "roborio_linux"
8}
9
10default_toolchain {
11 cpu: "k8"
12 toolchain_identifier: "k8_linux"
13}
14
15default_toolchain {
16 cpu: "armeabi-v7a"
17 toolchain_identifier: "stub_armeabi-v7a"
18}
19
20default_toolchain {
21 cpu: "armhf-debian"
22 toolchain_identifier: "clang_linux_armhf"
23}
24
25default_toolchain {
26 cpu: "cortex-m4f"
27 toolchain_identifier: "cortex-m4f"
28}
29
Brian Silverman6c8b88b2018-09-03 18:17:02 -070030default_toolchain {
31 cpu: "cortex-m4f-k22"
32 toolchain_identifier: "cortex-m4f-k22"
33}
34
Brian Silverman7b8899e2018-06-30 19:19:24 -070035toolchain {
36 abi_version: "armeabi-v7a"
37 abi_libc_version: "armeabi-v7a"
38 builtin_sysroot: ""
39 compiler: "compiler"
40 host_system_name: "armeabi-v7a"
41 needsPic: true
42 supports_gold_linker: false
43 supports_incremental_linker: false
44 supports_fission: false
45 supports_interface_shared_objects: false
46 supports_normalizing_ar: false
47 supports_start_end_lib: false
48 supports_thin_archives: false
49 target_libc: "armeabi-v7a"
50 target_cpu: "armeabi-v7a"
51 target_system_name: "armeabi-v7a"
52 toolchain_identifier: "stub_armeabi-v7a"
53
54 tool_path { name: "ar" path: "/bin/false" }
55 tool_path { name: "compat-ld" path: "/bin/false" }
56 tool_path { name: "cpp" path: "/bin/false" }
57 tool_path { name: "dwp" path: "/bin/false" }
58 tool_path { name: "gcc" path: "/bin/false" }
59 tool_path { name: "gcov" path: "/bin/false" }
60 tool_path { name: "ld" path: "/bin/false" }
61
62 tool_path { name: "nm" path: "/bin/false" }
63 tool_path { name: "objcopy" path: "/bin/false" }
64 tool_path { name: "objdump" path: "/bin/false" }
65 tool_path { name: "strip" path: "/bin/false" }
66}
67
68toolchain {
69 abi_version: "local"
70 abi_libc_version: "local"
71 builtin_sysroot: ""
72 compiler: "clang"
73 host_system_name: "local"
74 needsPic: true
75 supports_gold_linker: false
76 supports_incremental_linker: false
77 supports_fission: false
78 supports_interface_shared_objects: false
79 supports_normalizing_ar: false
80 supports_start_end_lib: false
81 supports_thin_archives: false
82 target_libc: "local"
83 target_cpu: "k8"
84 target_system_name: "k8"
85 toolchain_identifier: "k8_linux"
86
87 # These paths are relative to //tools/cpp.
88 tool_path { name: "ar" path: "clang_3p6/x86_64-linux-gnu-ar" }
89 tool_path { name: "compat-ld" path: "clang_3p6/x86_64-linux-gnu-ld" }
90 tool_path { name: "cpp" path: "clang_3p6/x86_64-linux-gnu-cpp" }
91 tool_path { name: "dwp" path: "clang_3p6/x86_64-linux-gnu-dwp" }
92 tool_path { name: "gcc" path: "clang_3p6/x86_64-linux-gnu-clang-3.6" }
93 tool_path { name: "gcov" path: "clang_3p6/x86_64-linux-gnu-gcov" }
94 # C(++) compiles invoke the compiler (as that is the one knowing where
95 # to find libraries), but we provide LD so other rules can invoke the linker.
96 tool_path { name: "ld" path: "clang_3p6/x86_64-linux-gnu-ld" }
97 tool_path { name: "nm" path: "clang_3p6/x86_64-linux-gnu-nm" }
98 tool_path { name: "objcopy" path: "clang_3p6/x86_64-linux-gnu-objcopy" }
99 objcopy_embed_flag: "-I"
100 objcopy_embed_flag: "binary"
101 tool_path { name: "objdump" path: "clang_3p6/x86_64-linux-gnu-objdump" }
102 tool_path { name: "strip" path: "clang_3p6/x86_64-linux-gnu-strip" }
103 linking_mode_flags { mode: DYNAMIC }
104
105 compiler_flag: "--sysroot=external/clang_3p6_repo/"
106 compiler_flag: "-nostdinc"
107 compiler_flag: "-isystem"
108 compiler_flag: "external/clang_3p6_repo/usr/include",
109 compiler_flag: "-isystem"
110 compiler_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu",
111 compiler_flag: "-isystem"
112 compiler_flag: "external/clang_3p6_repo/usr/lib/llvm-3.6/lib/clang/3.6.2/include",
113
114 cxx_flag: "-isystem"
115 cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9"
116 cxx_flag: "-isystem"
117 cxx_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu/c++/4.9"
118 cxx_flag: "-isystem"
119 cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9/backward"
120
121 # TODO(bazel-team): In theory, the path here ought to exactly match the path
122 # used by gcc. That works because bazel currently doesn't track files at
123 # absolute locations and has no remote execution, yet. However, this will need
124 # to be fixed, maybe with auto-detection?
125 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9'
126 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu/c++/4.9'
127 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9/backward'
128 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/local/include'
129 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/llvm-3.6/lib/clang/3.6.2/include'
130 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu'
131 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include'
132 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/clang/3.6.2/include'
133
134 linker_flag: "-nodefaultlibs"
135 linker_flag: "--sysroot=external/clang_3p6_repo/"
136 linker_flag: "-lstdc++"
137 linker_flag: "-lc"
138 linker_flag: "-lgcc"
139 linker_flag: "-lgcc_s"
140 linker_flag: "-Bexternal/clang_3p6_repo/usr/bin/"
141 linker_flag: "-Ltools/cpp/clang_3p6/clang_more_libs"
142 linker_flag: "-Lexternal/clang_3p6/lib/x86_64-linux-gnu"
143 linker_flag: "-Lexternal/clang_3p6/usr/lib/x86_64-linux-gnu"
144 linker_flag: "-Lexternal/clang_3p6/usr/lib/gcc/x86_64-linux-gnu"
145
146 feature {
147 name: "opt"
148 implies: "all_modes"
149 flag_set {
150 action: "preprocess-assemble"
151 action: "c-compile"
152 action: "c++-compile"
153 action: "c++-header-parsing"
154 action: "c++-header-preprocessing"
155 action: "c++-module-compile"
156 flag_group {
157 flag: "-DAOS_DEBUG=0"
158 }
159 }
160 }
161
162 feature {
163 name: "dbg"
164 implies: "all_modes"
165 flag_set {
166 action: "preprocess-assemble"
167 action: "c-compile"
168 action: "c++-compile"
169 action: "c++-header-parsing"
170 action: "c++-header-preprocessing"
171 action: "c++-module-compile"
172 flag_group {
173 flag: "-DAOS_DEBUG=1"
174 }
175 flag_group {
176 flag: "-fno-omit-frame-pointer"
177 }
178 }
179 }
180
181 feature {
182 name: "fastbuild"
183 implies: "all_modes"
184 flag_set {
185 action: "preprocess-assemble"
186 action: "c-compile"
187 action: "c++-compile"
188 action: "c++-header-parsing"
189 action: "c++-header-preprocessing"
190 action: "c++-module-compile"
191 flag_group {
192 flag: "-DAOS_DEBUG=0"
193 }
194 }
195 }
196
197 feature {
198 name: "all_modes"
199 flag_set {
200 action: "preprocess-assemble"
201 action: "assemble"
202 action: "c-compile"
203 flag_group {
204 flag: "-std=gnu99"
205 }
206 }
207 flag_set {
208 action: "c++-compile"
209 action: "c++-header-parsing"
210 action: "c++-header-preprocessing"
211 action: "c++-module-compile"
212 flag_group {
213 flag: "-std=gnu++1y"
214 }
215 }
216 flag_set {
217 action: "preprocess-assemble"
218 action: "assemble"
219 action: "c++-link"
220 action: "c++-compile"
221 action: "c++-header-parsing"
222 action: "c++-header-preprocessing"
223 action: "c++-module-compile"
224 action: "c-compile"
225 flag_group {
226 # We always want to compile with -pthread semantics.
227 flag: "-pthread"
228 }
229 }
230 }
231
232 # Anticipated future default.
233 # This makes GCC and Clang do what we want when called through symlinks.
234 unfiltered_cxx_flag: "-no-canonical-prefixes"
235 linker_flag: "-no-canonical-prefixes"
236
237 # Things that the code wants defined.
238 compiler_flag: "-D__STDC_FORMAT_MACROS"
239 compiler_flag: "-D__STDC_CONSTANT_MACROS"
240 compiler_flag: "-D__STDC_LIMIT_MACROS"
241 compiler_flag: "-D_FILE_OFFSET_BITS=64"
242 # TODO(Brian): Rename this or something.
243 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
244
245 linker_flag: "-fuse-ld=gold"
246
247 # Make C++ compilation deterministic. Use linkstamping instead of these
248 # compiler symbols.
249 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
250 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
251 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
252 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
253
254 # Security hardening on by default.
255 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
256 # We need to undef it before redefining it as some distributions now have
257 # it enabled by default.
258 compiler_flag: "-U_FORTIFY_SOURCE"
259 compiler_flag: "-D_FORTIFY_SOURCE=1"
260 compiler_flag: "-fstack-protector"
261 compiler_flag: "-fPIE"
262 linker_flag: "-Wl,-z,relro,-z,now"
263
264 # Pretty much everything needs this, including parts of the glibc STL...
265 linker_flag: "-lm"
266
267 # Enable coloring even if there's no attached terminal. Bazel removes the
268 # escape sequences if --nocolor is specified.
269 compiler_flag: "-fcolor-diagnostics"
270 compiler_flag: "-fmessage-length=80"
271 compiler_flag: "-fmacro-backtrace-limit=0"
272
273 compiler_flag: "-Wall"
274 compiler_flag: "-Wextra"
275 compiler_flag: "-Wpointer-arith"
276 compiler_flag: "-Wstrict-aliasing"
277 compiler_flag: "-Wcast-qual"
278 compiler_flag: "-Wcast-align"
279 compiler_flag: "-Wwrite-strings"
280 compiler_flag: "-Wtype-limits"
281 compiler_flag: "-Wsign-compare"
282 compiler_flag: "-Wformat=2"
283 compiler_flag: "-Werror"
284
285 # Keep stack frames for debugging, even in opt mode.
286 compiler_flag: "-fno-omit-frame-pointer"
287
288 # Don't use temp files while compiling.
289 compiler_flag: "-pipe"
290
291 # Stamp the binary with a unique identifier.
292 linker_flag: "-Wl,--build-id=md5"
293 linker_flag: "-Wl,--hash-style=gnu"
294 linker_flag: "-Wl,--warn-execstack"
295 linker_flag: "-Wl,--detect-odr-violations"
296
297 # Enable debug symbols.
298 compiler_flag: "-ggdb3"
299
300 compilation_mode_flags {
301 mode: OPT
302
303 compiler_flag: "-O2"
304
305 # Disable assertions
306 compiler_flag: "-DNDEBUG"
307
308 # Removal of unused code and data at link time (can this increase binary size in some cases?).
309 compiler_flag: "-ffunction-sections"
310 compiler_flag: "-fdata-sections"
311 linker_flag: "-Wl,--gc-sections"
312 }
313 feature {
314 name: "pie_for_linking"
315 enabled: true
316 flag_set {
317 action: "c++-link-executable"
318 flag_group {
319 flag: "-pie"
320 }
321 }
322 }
323}
324
325toolchain {
Austin Schuhef147de2018-10-27 21:19:00 -0700326 toolchain_identifier: "roborio_linux"
327 host_system_name: "roborio"
328 target_system_name: "roborio"
329 target_cpu: "roborio"
330 target_libc: "roborio"
331 compiler: "gcc"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700332 abi_version: "roborio"
333 abi_libc_version: "roborio"
Austin Schuhef147de2018-10-27 21:19:00 -0700334
Brian Silverman7b8899e2018-06-30 19:19:24 -0700335 builtin_sysroot: ""
Brian Silverman7b8899e2018-06-30 19:19:24 -0700336 needsPic: true
337 supports_gold_linker: false
338 supports_incremental_linker: false
339 supports_fission: false
340 supports_interface_shared_objects: false
341 supports_normalizing_ar: false
342 supports_start_end_lib: false
343 supports_thin_archives: false
Brian Silverman7b8899e2018-06-30 19:19:24 -0700344
345 tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
346 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
347 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
348 tool_path { name: "dwp" path: "/bin/false" }
349 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
350 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
351 # C(++) compiles invoke the compiler (as that is the one knowing where
352 # to find libraries), but we provide LD so other rules can invoke the linker.
353 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
354 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
355 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
356 objcopy_embed_flag: "-I"
357 objcopy_embed_flag: "binary"
358 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
359 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
360 linking_mode_flags { mode: DYNAMIC }
361
Austin Schuhef147de2018-10-27 21:19:00 -0700362 feature {
363 name: "compile_flags1"
364 enabled: true
365 flag_set {
366 action: "assemble"
367 action: "preprocess-assemble"
368 action: "c-compile"
369 action: "c++-compile"
370 action: "c++-header-parsing"
371 action: "c++-module-compile"
372 action: "c++-module-codegen"
373 action: "lto-backend"
374 action: "clif-match"
375 flag_group {
376 flag: "--sysroot=external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi"
377 flag: "-nostdinc"
378 flag: "-isystem"
379 flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include"
380 flag: "-isystem"
381 flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed"
382 flag: "-isystem"
383 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include"
384 flag: "-mfpu=neon"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700385
Austin Schuhef147de2018-10-27 21:19:00 -0700386 # Things that the code wants defined.
387 flag: "-D__STDC_FORMAT_MACROS"
388 flag: "-D__STDC_CONSTANT_MACROS"
389 flag: "-D__STDC_LIMIT_MACROS"
390 flag: "-D_FILE_OFFSET_BITS=64"
391
392 # TODO(Brian): Rename this or something.
393 flag: "-DAOS_ARCHITECTURE_arm_frc"
394
395 # Security hardening on by default.
396 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
397 # We need to undef it before redefining it as some distributions now have
398 # it enabled by default.
399 flag: "-U_FORTIFY_SOURCE"
400 flag: "-fstack-protector"
401 flag: "-fPIE"
402
403 # Enable coloring even if there's no attached terminal. Bazel removes the
404 # escape sequences if --nocolor is specified.
405 flag: "-fdiagnostics-color=always"
406
407 flag: "-Wall"
408 flag: "-Wextra"
409 flag: "-Wpointer-arith"
410 flag: "-Wstrict-aliasing"
411 flag: "-Wcast-qual"
412 flag: "-Wcast-align"
413 flag: "-Wwrite-strings"
414 flag: "-Wtype-limits"
415 flag: "-Wsign-compare"
416 flag: "-Wformat=2"
417 flag: "-Werror"
418 flag: "-Wunused-local-typedefs"
419
420 # Keep stack frames for debugging, even in opt mode.
421 flag: "-fno-omit-frame-pointer"
422
423 flag: "-D__has_feature(x)=0"
424
425 # Don't use temp files while compiling.
426 flag: "-pipe"
427
428 # Enable debug symbols.
429 flag: "-ggdb3"
430 }
431 }
432 }
433
434 feature {
435 name: "opt"
436 implies: "opt_post"
437 flag_set {
438 action: "assemble"
439 action: "preprocess-assemble"
440 action: "c-compile"
441 action: "c++-compile"
442 action: "c++-module-compile"
443 action: "objc-compile"
444 action: "objc++-compile"
445 action: "c++-header-parsing"
446 action: "linkstamp-compile"
447 flag_group {
448 flag: "-O2"
449 flag: "-DNDEBUG"
450 flag: "-D_FORTIFY_SOURCE=1"
451 flag: "-ffunction-sections"
452 flag: "-fdata-sections"
453 }
454 }
455 flag_set {
456 action: "c++-link-executable"
457 action: "c++-link-nodeps-dynamic-library"
458 action: "c++-link-dynamic-library"
459 flag_group {
460 flag: "-Wl,--gc-sections"
461 }
462 }
463 }
464
465 feature {
466 name: "compile_flags2"
467 enabled: true
468 flag_set {
469 action: "c++-compile"
470 action: "c++-header-parsing"
471 action: "c++-module-compile"
472 action: "c++-module-codegen"
473 action: "lto-backend"
474 action: "clif-match"
475 flag_group {
476 flag: "-isystem"
477 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0"
478 flag: "-isystem"
479 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0/arm-frc-linux-gnueabi"
480 flag: "-isystem"
481 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0/backward"
482 flag: "-isystem"
483 flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include"
484 flag: "-isystem"
485 flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed"
486 flag: "-isystem"
487 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include"
488 flag: "-isystem"
489 flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include"
490 }
491 }
492 }
Brian Silverman7b8899e2018-06-30 19:19:24 -0700493
494 # TODO(bazel-team): In theory, the path here ought to exactly match the path
495 # used by gcc. That works because bazel currently doesn't track files at
496 # absolute locations and has no remote execution, yet. However, this will need
497 # to be fixed, maybe with auto-detection?
498 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0"
499 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0/arm-frc-linux-gnueabi"
500 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0/backward"
501 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include)%"
502 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed)%"
503 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%"
504 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/usr/include)%"
505
506 linker_flag: "-lstdc++"
507 linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs"
508
509 feature {
Austin Schuhef147de2018-10-27 21:19:00 -0700510 name: "dependency_file"
511 flag_set {
512 action: "assemble"
513 action: "preprocess-assemble"
514 action: "c-compile"
515 action: "c++-compile"
516 action: "c++-module-compile"
517 action: "objc-compile"
518 action: "objc++-compile"
519 action: "c++-header-parsing"
520 action: "clif-match"
521 expand_if_all_available: "dependency_file"
522 flag_group {
523 flag: "-MD"
524 flag: "-MF"
525 flag: "%{dependency_file}"
526 }
527 }
528 }
529
530 feature {
531 name: "random_seed"
532 flag_set {
533 # TODO(austin): Should these also have -frandom-seed set? Upstream
534 # doesn't.
535 # action: "linkstamp-compile"
536 # action: "c-compile"
537 action: "c++-compile"
538 action: "c++-module-codegen"
539 action: "c++-module-compile"
540 flag_group {
541 expand_if_all_available: "output_file"
542 flag: "-frandom-seed=%{output_file}"
543 }
544 }
545 }
546
547 feature {
548 name: "pic"
549 flag_set {
550 action: "assemble"
551 action: "preprocess-assemble"
552 action: "linkstamp-compile"
553 action: "c-compile"
554 action: "c++-compile"
555 action: "c++-module-codegen"
556 action: "c++-module-compile"
557 expand_if_all_available: "pic"
558 flag_group {
559 flag: "-fPIC"
560 }
561 }
562 }
563
564 feature {
565 name: "preprocessor_defines"
566 flag_set {
567 action: "preprocess-assemble"
568 action: "linkstamp-compile"
569 action: "c-compile"
570 action: "c++-compile"
571 action: "c++-header-parsing"
572 action: "c++-module-compile"
573 action: "clif-match"
574 flag_group {
575 iterate_over: "preprocessor_defines"
576 flag: "-D%{preprocessor_defines}"
577 }
578 }
579 }
580
581 feature {
582 name: "include_paths"
583 flag_set {
584 action: "preprocess-assemble"
585 action: "c-compile"
586 action: "c++-compile"
587 action: "c++-header-parsing"
588 action: "c++-header-preprocessing"
589 action: "c++-module-compile"
590 flag_group {
591 flag: "-iquote"
592 flag: "%{quote_include_paths}"
593 iterate_over: "quote_include_paths"
594 }
595 flag_group {
596 flag: "-I%{include_paths}"
597 iterate_over: "include_paths"
598 }
599 flag_group {
600 flag: "-isystem"
601 flag: "%{system_include_paths}"
602 iterate_over: "system_include_paths"
603 }
604 }
605 }
606
607 feature {
608 name: "opt_post"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700609 flag_set {
610 action: "preprocess-assemble"
611 action: "c-compile"
612 action: "c++-compile"
613 action: "c++-header-parsing"
614 action: "c++-header-preprocessing"
615 action: "c++-module-compile"
616 flag_group {
617 flag: "-DAOS_DEBUG=0"
618 }
619 }
620 }
621
622 feature {
623 name: "dbg"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700624 flag_set {
625 action: "preprocess-assemble"
626 action: "c-compile"
627 action: "c++-compile"
628 action: "c++-header-parsing"
629 action: "c++-header-preprocessing"
630 action: "c++-module-compile"
631 flag_group {
632 flag: "-DAOS_DEBUG=1"
633 }
634 flag_group {
635 flag: "-fno-omit-frame-pointer"
636 }
637 }
638 }
639
640 feature {
641 name: "fastbuild"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700642 flag_set {
643 action: "preprocess-assemble"
644 action: "c-compile"
645 action: "c++-compile"
646 action: "c++-header-parsing"
647 action: "c++-header-preprocessing"
648 action: "c++-module-compile"
649 flag_group {
650 flag: "-DAOS_DEBUG=0"
651 }
652 }
653 }
654
655 feature {
656 name: "all_modes"
Austin Schuhef147de2018-10-27 21:19:00 -0700657 enabled: true
Brian Silverman7b8899e2018-06-30 19:19:24 -0700658 flag_set {
659 action: "preprocess-assemble"
660 action: "assemble"
661 action: "c-compile"
662 flag_group {
663 flag: "-std=gnu99"
664 }
665 }
666 flag_set {
667 action: "c++-compile"
668 action: "c++-header-parsing"
669 action: "c++-header-preprocessing"
670 action: "c++-module-compile"
671 flag_group {
672 flag: "-std=gnu++1y"
673 }
674 }
675 flag_set {
676 action: "preprocess-assemble"
677 action: "assemble"
678 action: "c++-link"
679 action: "c++-compile"
680 action: "c++-header-parsing"
681 action: "c++-header-preprocessing"
682 action: "c++-module-compile"
683 action: "c-compile"
684 flag_group {
685 # We always want to compile with -pthread semantics.
686 flag: "-pthread"
687 }
688 }
689 }
690
Brian Silverman7b8899e2018-06-30 19:19:24 -0700691 # Anticipated future default.
692 # This makes GCC and Clang do what we want when called through symlinks.
693 unfiltered_cxx_flag: "-no-canonical-prefixes"
694 linker_flag: "-no-canonical-prefixes"
695
Brian Silverman7b8899e2018-06-30 19:19:24 -0700696 # Make C++ compilation deterministic. Use linkstamping instead of these
697 # compiler symbols.
698 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
699 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
700 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
701 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
702
Brian Silverman7b8899e2018-06-30 19:19:24 -0700703 linker_flag: "-Wl,-z,relro,-z,now"
704
705 # Pretty much everything needs this, including parts of the glibc STL...
706 linker_flag: "-lm"
707
Brian Silverman7b8899e2018-06-30 19:19:24 -0700708 # Have GCC return the exit code from ld.
709 linker_flag: "-pass-exit-codes"
710
711 # Stamp the binary with a unique identifier.
712 linker_flag: "-Wl,--build-id=md5"
713 linker_flag: "-Wl,--hash-style=gnu"
714 #linker_flag: "-Wl,--warn-execstack"
715 #linker_flag: "-Wl,--detect-odr-violations"
716
Brian Silverman7b8899e2018-06-30 19:19:24 -0700717 feature {
718 name: "pie_for_linking"
719 enabled: true
720 flag_set {
721 action: "c++-link-executable"
722 flag_group {
723 flag: "-pie"
724 }
725 }
726 }
727}
728
729toolchain {
730 abi_version: "clang_3.6"
731 abi_libc_version: "glibc_2.19"
732 builtin_sysroot: ""
733 compiler: "clang"
734 host_system_name: "linux"
735 needsPic: true
736 supports_gold_linker: false
737 supports_incremental_linker: false
738 supports_fission: false
739 supports_interface_shared_objects: false
740 supports_normalizing_ar: true
741 supports_start_end_lib: false
742 supports_thin_archives: true
743 target_libc: "glibc_2.19"
744 target_cpu: "armhf-debian"
745 target_system_name: "arm_a15"
746 toolchain_identifier: "clang_linux_armhf"
747
748 tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" }
749 tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
750 tool_path { name: "cpp" path: "linaro_linux_gcc/clang_bin/clang" }
751 tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" }
752 tool_path { name: "gcc" path: "linaro_linux_gcc/clang_bin/clang" }
753 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
754 # C(++) compiles invoke the compiler (as that is the one knowing where
755 # to find libraries), but we provide LD so other rules can invoke the linker.
756 tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
757 tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" }
758 tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" }
759 objcopy_embed_flag: "-I"
760 objcopy_embed_flag: "binary"
761 tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" }
762 tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" }
763 linking_mode_flags { mode: DYNAMIC }
764
765 compiler_flag: "-target"
766 compiler_flag: "armv7a-arm-linux-gnueabif"
767 compiler_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
768 compiler_flag: "-mfloat-abi=hard"
769 compiler_flag: "-mfpu=vfpv3-d16"
770
771 compiler_flag: "-nostdinc"
772 compiler_flag: "-isystem"
773 compiler_flag: "/usr/lib/clang/3.6/include"
774 compiler_flag: "-isystem"
775 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include"
776 compiler_flag: "-isystem"
777 compiler_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/include"
778 compiler_flag: "-isystem"
779 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed"
780 cxx_flag: "-isystem"
781 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf"
782 cxx_flag: "-isystem"
783 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3"
784 cxx_flag: "-isystem"
785 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3/arm-linux-gnueabihf"
786 cxx_flag: "-isystem"
787 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3"
788
789 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%"
790 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/include)%"
791 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/lib/include)%"
792 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
793 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%/c++/4.9.3"
794 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
795 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
796 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
797 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
798 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/include)%/c++/4.9.3"
799 cxx_builtin_include_directory: '/usr/lib/clang/3.6/include'
800
801 linker_flag: "-target"
802 linker_flag: "armv7a-arm-linux-gnueabif"
803 linker_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
804 linker_flag: "-lstdc++"
805 linker_flag: "-Ltools/cpp/linaro_linux_gcc/clang_more_libs"
806 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/lib"
807 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/lib"
808 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/lib"
809 linker_flag: "-Bexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/bin"
810 linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3"
811
812 feature {
813 name: "opt"
814 implies: "all_modes"
815 flag_set {
816 action: "preprocess-assemble"
817 action: "c-compile"
818 action: "c++-compile"
819 action: "c++-header-parsing"
820 action: "c++-header-preprocessing"
821 action: "c++-module-compile"
822 flag_group {
823 flag: "-DAOS_DEBUG=0"
824 }
825 }
826 }
827
828 feature {
829 name: "dbg"
830 implies: "all_modes"
831 flag_set {
832 action: "preprocess-assemble"
833 action: "c-compile"
834 action: "c++-compile"
835 action: "c++-header-parsing"
836 action: "c++-header-preprocessing"
837 action: "c++-module-compile"
838 flag_group {
839 flag: "-DAOS_DEBUG=1"
840 }
841 flag_group {
842 flag: "-fno-omit-frame-pointer"
843 }
844 }
845 }
846
847 feature {
848 name: "fastbuild"
849 implies: "all_modes"
850 flag_set {
851 action: "preprocess-assemble"
852 action: "c-compile"
853 action: "c++-compile"
854 action: "c++-header-parsing"
855 action: "c++-header-preprocessing"
856 action: "c++-module-compile"
857 flag_group {
858 flag: "-DAOS_DEBUG=0"
859 }
860 }
861 }
862
863 feature {
864 name: "all_modes"
865 flag_set {
866 action: "preprocess-assemble"
867 action: "assemble"
868 action: "c-compile"
869 flag_group {
870 flag: "-std=gnu99"
871 }
872 }
873 flag_set {
874 action: "c++-compile"
875 action: "c++-header-parsing"
876 action: "c++-header-preprocessing"
877 action: "c++-module-compile"
878 flag_group {
879 flag: "-std=gnu++1y"
880 }
881 }
882 flag_set {
883 action: "preprocess-assemble"
884 action: "assemble"
885 action: "c++-link"
886 action: "c++-compile"
887 action: "c++-header-parsing"
888 action: "c++-header-preprocessing"
889 action: "c++-module-compile"
890 action: "c-compile"
891 flag_group {
892 # We always want to compile with -pthread semantics.
893 flag: "-pthread"
894 }
895 }
896 }
897
898 # Anticipated future default.
899 # This makes GCC and Clang do what we want when called through symlinks.
900 unfiltered_cxx_flag: "-no-canonical-prefixes"
901 linker_flag: "-no-canonical-prefixes"
902
903 # Things that the code wants defined.
904 compiler_flag: "-D__STDC_FORMAT_MACROS"
905 compiler_flag: "-D__STDC_CONSTANT_MACROS"
906 compiler_flag: "-D__STDC_LIMIT_MACROS"
907 compiler_flag: "-D_FILE_OFFSET_BITS=64"
908 # TODO(Brian): Rename this or something.
909 compiler_flag: "-DAOS_ARCHITECTURE_armhf"
910
911 # Make C++ compilation deterministic. Use linkstamping instead of these
912 # compiler symbols.
913 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
914 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
915 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
916 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
917
918 # Security hardening on by default.
919 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
920 # We need to undef it before redefining it as some distributions now have
921 # it enabled by default.
922 compiler_flag: "-U_FORTIFY_SOURCE"
923 compiler_flag: "-fstack-protector"
924 compiler_flag: "-fPIE"
925 linker_flag: "-Wl,-z,relro,-z,now"
926
927 # Pretty much everything needs this, including parts of the glibc STL...
928 linker_flag: "-lm"
929
930 # Enable coloring even if there's no attached terminal. Bazel removes the
931 # escape sequences if --nocolor is specified.
932 compiler_flag: "-fdiagnostics-color=always"
933
934 compiler_flag: "-Wall"
935 compiler_flag: "-Wextra"
936 compiler_flag: "-Wpointer-arith"
937 compiler_flag: "-Wstrict-aliasing"
938 compiler_flag: "-Wcast-qual"
939 compiler_flag: "-Wcast-align"
940 compiler_flag: "-Wwrite-strings"
941 compiler_flag: "-Wtype-limits"
942 compiler_flag: "-Wsign-compare"
943 compiler_flag: "-Wformat=2"
944 compiler_flag: "-Werror"
945 compiler_flag: "-Wunused-local-typedefs"
946
947 # Keep stack frames for debugging, even in opt mode.
948 compiler_flag: "-fno-omit-frame-pointer"
949
950 # Don't use temp files while compiling.
951 compiler_flag: "-pipe"
952
953 # Stamp the binary with a unique identifier.
954 linker_flag: "-Wl,--build-id=md5"
955 linker_flag: "-Wl,--hash-style=gnu"
956 #linker_flag: "-Wl,--warn-execstack"
957 #linker_flag: "-Wl,--detect-odr-violations"
958
959 # Enable debug symbols.
960 compiler_flag: "-ggdb3"
961
962 compilation_mode_flags {
963 mode: OPT
964
965 compiler_flag: "-O2"
966
967 # Disable assertions
968 compiler_flag: "-DNDEBUG"
969 compiler_flag: "-D_FORTIFY_SOURCE=1"
970
971 # Removal of unused code and data at link time (can this increase binary size in some cases?).
972 compiler_flag: "-ffunction-sections"
973 compiler_flag: "-fdata-sections"
974 linker_flag: "-Wl,--gc-sections"
975 }
976 feature {
977 name: "pie_for_linking"
978 enabled: true
979 flag_set {
980 action: "c++-link-executable"
981 flag_group {
982 flag: "-pie"
983 }
984 }
985 }
986}