blob: 5599c1568aacf05297c5e66fdf0ad709c0f30515 [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" }
Austin Schuhf6b94632019-02-02 22:11:27 -0800346 tool_path { name: "as" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as" }
Brian Silverman7b8899e2018-06-30 19:19:24 -0700347 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
348 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
349 tool_path { name: "dwp" path: "/bin/false" }
350 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
351 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
352 # C(++) compiles invoke the compiler (as that is the one knowing where
353 # to find libraries), but we provide LD so other rules can invoke the linker.
354 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
355 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
356 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
357 objcopy_embed_flag: "-I"
358 objcopy_embed_flag: "binary"
359 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
360 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
361 linking_mode_flags { mode: DYNAMIC }
362
Austin Schuhef147de2018-10-27 21:19:00 -0700363 feature {
364 name: "compile_flags1"
365 enabled: true
366 flag_set {
367 action: "assemble"
368 action: "preprocess-assemble"
369 action: "c-compile"
370 action: "c++-compile"
371 action: "c++-header-parsing"
372 action: "c++-module-compile"
373 action: "c++-module-codegen"
374 action: "lto-backend"
375 action: "clif-match"
376 flag_group {
Austin Schuhf6b94632019-02-02 22:11:27 -0800377 flag: "--sysroot=external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi"
Austin Schuhef147de2018-10-27 21:19:00 -0700378 flag: "-nostdinc"
379 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800380 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include"
Austin Schuhef147de2018-10-27 21:19:00 -0700381 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800382 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include-fixed"
383 }
384 }
385
386 flag_set {
James Kuszmaulebdeaf52019-05-22 20:31:25 -0700387 action: "assemble"
388 action: "preprocess-assemble"
389 action: "c++-compile"
390 action: "c++-header-parsing"
391 action: "c++-header-preprocessing"
392 flag_group {
393 flag: "-fno-canonical-system-headers"
394 }
395 }
396
397 flag_set {
Austin Schuhf6b94632019-02-02 22:11:27 -0800398 action: "c++-compile"
399 action: "c++-header-parsing"
400 action: "c++-module-compile"
401 action: "c++-module-codegen"
402 flag_group {
Austin Schuhef147de2018-10-27 21:19:00 -0700403 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800404 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0"
405 flag: "-isystem"
406 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/arm-frc2019-linux-gnueabi"
407 flag: "-isystem"
408 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/backward"
409 }
410 }
411
412 flag_set {
413 action: "assemble"
414 action: "preprocess-assemble"
415 action: "c-compile"
416 action: "c++-compile"
417 action: "c++-header-parsing"
418 action: "c++-module-compile"
419 action: "c++-module-codegen"
420 action: "lto-backend"
421 action: "clif-match"
422 flag_group {
423 flag: "-isystem"
424 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include"
425
Austin Schuhef147de2018-10-27 21:19:00 -0700426 flag: "-mfpu=neon"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700427
Austin Schuhef147de2018-10-27 21:19:00 -0700428 # Things that the code wants defined.
429 flag: "-D__STDC_FORMAT_MACROS"
430 flag: "-D__STDC_CONSTANT_MACROS"
431 flag: "-D__STDC_LIMIT_MACROS"
432 flag: "-D_FILE_OFFSET_BITS=64"
433
434 # TODO(Brian): Rename this or something.
435 flag: "-DAOS_ARCHITECTURE_arm_frc"
436
437 # Security hardening on by default.
438 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
439 # We need to undef it before redefining it as some distributions now have
440 # it enabled by default.
441 flag: "-U_FORTIFY_SOURCE"
442 flag: "-fstack-protector"
443 flag: "-fPIE"
444
445 # Enable coloring even if there's no attached terminal. Bazel removes the
446 # escape sequences if --nocolor is specified.
447 flag: "-fdiagnostics-color=always"
448
449 flag: "-Wall"
450 flag: "-Wextra"
451 flag: "-Wpointer-arith"
452 flag: "-Wstrict-aliasing"
453 flag: "-Wcast-qual"
454 flag: "-Wcast-align"
455 flag: "-Wwrite-strings"
456 flag: "-Wtype-limits"
457 flag: "-Wsign-compare"
458 flag: "-Wformat=2"
459 flag: "-Werror"
460 flag: "-Wunused-local-typedefs"
461
462 # Keep stack frames for debugging, even in opt mode.
463 flag: "-fno-omit-frame-pointer"
464
465 flag: "-D__has_feature(x)=0"
466
467 # Don't use temp files while compiling.
468 flag: "-pipe"
469
470 # Enable debug symbols.
471 flag: "-ggdb3"
472 }
473 }
474 }
475
476 feature {
477 name: "opt"
478 implies: "opt_post"
479 flag_set {
480 action: "assemble"
481 action: "preprocess-assemble"
482 action: "c-compile"
483 action: "c++-compile"
484 action: "c++-module-compile"
485 action: "objc-compile"
486 action: "objc++-compile"
487 action: "c++-header-parsing"
488 action: "linkstamp-compile"
489 flag_group {
490 flag: "-O2"
491 flag: "-DNDEBUG"
492 flag: "-D_FORTIFY_SOURCE=1"
493 flag: "-ffunction-sections"
494 flag: "-fdata-sections"
495 }
496 }
497 flag_set {
498 action: "c++-link-executable"
499 action: "c++-link-nodeps-dynamic-library"
500 action: "c++-link-dynamic-library"
501 flag_group {
502 flag: "-Wl,--gc-sections"
503 }
504 }
505 }
506
Brian Silverman7b8899e2018-06-30 19:19:24 -0700507 # TODO(bazel-team): In theory, the path here ought to exactly match the path
508 # used by gcc. That works because bazel currently doesn't track files at
509 # absolute locations and has no remote execution, yet. However, this will need
510 # to be fixed, maybe with auto-detection?
Austin Schuhf6b94632019-02-02 22:11:27 -0800511
512 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include)%"
513 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include-fixed)%"
514 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/arm-frc2019-linux-gnueabi)%"
515 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/backward)%"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700516
517 linker_flag: "-lstdc++"
518 linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs"
519
520 feature {
Austin Schuhef147de2018-10-27 21:19:00 -0700521 name: "dependency_file"
522 flag_set {
523 action: "assemble"
524 action: "preprocess-assemble"
525 action: "c-compile"
526 action: "c++-compile"
527 action: "c++-module-compile"
528 action: "objc-compile"
529 action: "objc++-compile"
530 action: "c++-header-parsing"
531 action: "clif-match"
532 expand_if_all_available: "dependency_file"
533 flag_group {
534 flag: "-MD"
535 flag: "-MF"
536 flag: "%{dependency_file}"
537 }
538 }
539 }
540
541 feature {
542 name: "random_seed"
543 flag_set {
544 # TODO(austin): Should these also have -frandom-seed set? Upstream
545 # doesn't.
546 # action: "linkstamp-compile"
547 # action: "c-compile"
548 action: "c++-compile"
549 action: "c++-module-codegen"
550 action: "c++-module-compile"
551 flag_group {
552 expand_if_all_available: "output_file"
553 flag: "-frandom-seed=%{output_file}"
554 }
555 }
556 }
557
558 feature {
559 name: "pic"
560 flag_set {
561 action: "assemble"
562 action: "preprocess-assemble"
563 action: "linkstamp-compile"
564 action: "c-compile"
565 action: "c++-compile"
566 action: "c++-module-codegen"
567 action: "c++-module-compile"
568 expand_if_all_available: "pic"
569 flag_group {
570 flag: "-fPIC"
571 }
572 }
573 }
574
575 feature {
576 name: "preprocessor_defines"
577 flag_set {
578 action: "preprocess-assemble"
579 action: "linkstamp-compile"
580 action: "c-compile"
581 action: "c++-compile"
582 action: "c++-header-parsing"
583 action: "c++-module-compile"
584 action: "clif-match"
585 flag_group {
586 iterate_over: "preprocessor_defines"
587 flag: "-D%{preprocessor_defines}"
588 }
589 }
590 }
591
592 feature {
593 name: "include_paths"
594 flag_set {
595 action: "preprocess-assemble"
596 action: "c-compile"
597 action: "c++-compile"
598 action: "c++-header-parsing"
599 action: "c++-header-preprocessing"
600 action: "c++-module-compile"
601 flag_group {
602 flag: "-iquote"
603 flag: "%{quote_include_paths}"
604 iterate_over: "quote_include_paths"
605 }
606 flag_group {
607 flag: "-I%{include_paths}"
608 iterate_over: "include_paths"
609 }
610 flag_group {
611 flag: "-isystem"
612 flag: "%{system_include_paths}"
613 iterate_over: "system_include_paths"
614 }
615 }
616 }
617
618 feature {
619 name: "opt_post"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700620 flag_set {
621 action: "preprocess-assemble"
622 action: "c-compile"
623 action: "c++-compile"
624 action: "c++-header-parsing"
625 action: "c++-header-preprocessing"
626 action: "c++-module-compile"
627 flag_group {
628 flag: "-DAOS_DEBUG=0"
629 }
630 }
631 }
632
633 feature {
634 name: "dbg"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700635 flag_set {
636 action: "preprocess-assemble"
637 action: "c-compile"
638 action: "c++-compile"
639 action: "c++-header-parsing"
640 action: "c++-header-preprocessing"
641 action: "c++-module-compile"
642 flag_group {
643 flag: "-DAOS_DEBUG=1"
644 }
645 flag_group {
646 flag: "-fno-omit-frame-pointer"
647 }
648 }
649 }
650
651 feature {
652 name: "fastbuild"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700653 flag_set {
654 action: "preprocess-assemble"
655 action: "c-compile"
656 action: "c++-compile"
657 action: "c++-header-parsing"
658 action: "c++-header-preprocessing"
659 action: "c++-module-compile"
660 flag_group {
661 flag: "-DAOS_DEBUG=0"
662 }
663 }
664 }
665
666 feature {
667 name: "all_modes"
Austin Schuhef147de2018-10-27 21:19:00 -0700668 enabled: true
Brian Silverman7b8899e2018-06-30 19:19:24 -0700669 flag_set {
670 action: "preprocess-assemble"
671 action: "assemble"
672 action: "c-compile"
673 flag_group {
674 flag: "-std=gnu99"
675 }
676 }
677 flag_set {
678 action: "c++-compile"
679 action: "c++-header-parsing"
680 action: "c++-header-preprocessing"
681 action: "c++-module-compile"
682 flag_group {
683 flag: "-std=gnu++1y"
Austin Schuhf6b94632019-02-02 22:11:27 -0800684 flag: "-fno-sized-deallocation"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700685 }
686 }
687 flag_set {
688 action: "preprocess-assemble"
689 action: "assemble"
690 action: "c++-link"
691 action: "c++-compile"
692 action: "c++-header-parsing"
693 action: "c++-header-preprocessing"
694 action: "c++-module-compile"
695 action: "c-compile"
696 flag_group {
697 # We always want to compile with -pthread semantics.
698 flag: "-pthread"
699 }
700 }
701 }
702
Brian Silverman7b8899e2018-06-30 19:19:24 -0700703 # Anticipated future default.
704 # This makes GCC and Clang do what we want when called through symlinks.
705 unfiltered_cxx_flag: "-no-canonical-prefixes"
706 linker_flag: "-no-canonical-prefixes"
707
Brian Silverman7b8899e2018-06-30 19:19:24 -0700708 # Make C++ compilation deterministic. Use linkstamping instead of these
709 # compiler symbols.
710 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
711 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
712 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
713 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
714
Brian Silverman7b8899e2018-06-30 19:19:24 -0700715 linker_flag: "-Wl,-z,relro,-z,now"
716
717 # Pretty much everything needs this, including parts of the glibc STL...
718 linker_flag: "-lm"
719
Brian Silverman7b8899e2018-06-30 19:19:24 -0700720 # Have GCC return the exit code from ld.
721 linker_flag: "-pass-exit-codes"
722
723 # Stamp the binary with a unique identifier.
724 linker_flag: "-Wl,--build-id=md5"
725 linker_flag: "-Wl,--hash-style=gnu"
726 #linker_flag: "-Wl,--warn-execstack"
727 #linker_flag: "-Wl,--detect-odr-violations"
728
Brian Silverman7b8899e2018-06-30 19:19:24 -0700729 feature {
730 name: "pie_for_linking"
731 enabled: true
732 flag_set {
733 action: "c++-link-executable"
734 flag_group {
735 flag: "-pie"
736 }
737 }
738 }
739}
740
741toolchain {
742 abi_version: "clang_3.6"
743 abi_libc_version: "glibc_2.19"
744 builtin_sysroot: ""
745 compiler: "clang"
746 host_system_name: "linux"
747 needsPic: true
748 supports_gold_linker: false
749 supports_incremental_linker: false
750 supports_fission: false
751 supports_interface_shared_objects: false
752 supports_normalizing_ar: true
753 supports_start_end_lib: false
754 supports_thin_archives: true
755 target_libc: "glibc_2.19"
756 target_cpu: "armhf-debian"
757 target_system_name: "arm_a15"
758 toolchain_identifier: "clang_linux_armhf"
759
760 tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" }
761 tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
762 tool_path { name: "cpp" path: "linaro_linux_gcc/clang_bin/clang" }
763 tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" }
764 tool_path { name: "gcc" path: "linaro_linux_gcc/clang_bin/clang" }
765 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
766 # C(++) compiles invoke the compiler (as that is the one knowing where
767 # to find libraries), but we provide LD so other rules can invoke the linker.
768 tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
769 tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" }
770 tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" }
771 objcopy_embed_flag: "-I"
772 objcopy_embed_flag: "binary"
773 tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" }
774 tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" }
775 linking_mode_flags { mode: DYNAMIC }
776
777 compiler_flag: "-target"
778 compiler_flag: "armv7a-arm-linux-gnueabif"
779 compiler_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
780 compiler_flag: "-mfloat-abi=hard"
781 compiler_flag: "-mfpu=vfpv3-d16"
782
783 compiler_flag: "-nostdinc"
784 compiler_flag: "-isystem"
785 compiler_flag: "/usr/lib/clang/3.6/include"
786 compiler_flag: "-isystem"
787 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include"
788 compiler_flag: "-isystem"
789 compiler_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/include"
790 compiler_flag: "-isystem"
791 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed"
792 cxx_flag: "-isystem"
793 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf"
794 cxx_flag: "-isystem"
795 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3"
796 cxx_flag: "-isystem"
797 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3/arm-linux-gnueabihf"
798 cxx_flag: "-isystem"
799 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3"
800
801 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%"
802 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/include)%"
803 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/lib/include)%"
804 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)%"
805 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%/c++/4.9.3"
806 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
807 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)%"
808 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
809 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
810 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/include)%/c++/4.9.3"
811 cxx_builtin_include_directory: '/usr/lib/clang/3.6/include'
812
813 linker_flag: "-target"
814 linker_flag: "armv7a-arm-linux-gnueabif"
815 linker_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
816 linker_flag: "-lstdc++"
817 linker_flag: "-Ltools/cpp/linaro_linux_gcc/clang_more_libs"
818 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/lib"
819 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/lib"
820 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/lib"
821 linker_flag: "-Bexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/bin"
822 linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3"
823
824 feature {
825 name: "opt"
826 implies: "all_modes"
827 flag_set {
828 action: "preprocess-assemble"
829 action: "c-compile"
830 action: "c++-compile"
831 action: "c++-header-parsing"
832 action: "c++-header-preprocessing"
833 action: "c++-module-compile"
834 flag_group {
835 flag: "-DAOS_DEBUG=0"
836 }
837 }
838 }
839
840 feature {
841 name: "dbg"
842 implies: "all_modes"
843 flag_set {
844 action: "preprocess-assemble"
845 action: "c-compile"
846 action: "c++-compile"
847 action: "c++-header-parsing"
848 action: "c++-header-preprocessing"
849 action: "c++-module-compile"
850 flag_group {
851 flag: "-DAOS_DEBUG=1"
852 }
853 flag_group {
854 flag: "-fno-omit-frame-pointer"
855 }
856 }
857 }
858
859 feature {
860 name: "fastbuild"
861 implies: "all_modes"
862 flag_set {
863 action: "preprocess-assemble"
864 action: "c-compile"
865 action: "c++-compile"
866 action: "c++-header-parsing"
867 action: "c++-header-preprocessing"
868 action: "c++-module-compile"
869 flag_group {
870 flag: "-DAOS_DEBUG=0"
871 }
872 }
873 }
874
875 feature {
876 name: "all_modes"
877 flag_set {
878 action: "preprocess-assemble"
879 action: "assemble"
880 action: "c-compile"
881 flag_group {
882 flag: "-std=gnu99"
883 }
884 }
885 flag_set {
886 action: "c++-compile"
887 action: "c++-header-parsing"
888 action: "c++-header-preprocessing"
889 action: "c++-module-compile"
890 flag_group {
891 flag: "-std=gnu++1y"
892 }
893 }
894 flag_set {
895 action: "preprocess-assemble"
896 action: "assemble"
897 action: "c++-link"
898 action: "c++-compile"
899 action: "c++-header-parsing"
900 action: "c++-header-preprocessing"
901 action: "c++-module-compile"
902 action: "c-compile"
903 flag_group {
904 # We always want to compile with -pthread semantics.
905 flag: "-pthread"
906 }
907 }
908 }
909
910 # Anticipated future default.
911 # This makes GCC and Clang do what we want when called through symlinks.
912 unfiltered_cxx_flag: "-no-canonical-prefixes"
913 linker_flag: "-no-canonical-prefixes"
914
915 # Things that the code wants defined.
916 compiler_flag: "-D__STDC_FORMAT_MACROS"
917 compiler_flag: "-D__STDC_CONSTANT_MACROS"
918 compiler_flag: "-D__STDC_LIMIT_MACROS"
919 compiler_flag: "-D_FILE_OFFSET_BITS=64"
920 # TODO(Brian): Rename this or something.
921 compiler_flag: "-DAOS_ARCHITECTURE_armhf"
922
923 # Make C++ compilation deterministic. Use linkstamping instead of these
924 # compiler symbols.
925 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
926 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
927 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
928 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
929
930 # Security hardening on by default.
931 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
932 # We need to undef it before redefining it as some distributions now have
933 # it enabled by default.
934 compiler_flag: "-U_FORTIFY_SOURCE"
935 compiler_flag: "-fstack-protector"
936 compiler_flag: "-fPIE"
937 linker_flag: "-Wl,-z,relro,-z,now"
938
939 # Pretty much everything needs this, including parts of the glibc STL...
940 linker_flag: "-lm"
941
942 # Enable coloring even if there's no attached terminal. Bazel removes the
943 # escape sequences if --nocolor is specified.
944 compiler_flag: "-fdiagnostics-color=always"
945
946 compiler_flag: "-Wall"
947 compiler_flag: "-Wextra"
948 compiler_flag: "-Wpointer-arith"
949 compiler_flag: "-Wstrict-aliasing"
950 compiler_flag: "-Wcast-qual"
951 compiler_flag: "-Wcast-align"
952 compiler_flag: "-Wwrite-strings"
953 compiler_flag: "-Wtype-limits"
954 compiler_flag: "-Wsign-compare"
955 compiler_flag: "-Wformat=2"
956 compiler_flag: "-Werror"
957 compiler_flag: "-Wunused-local-typedefs"
958
959 # Keep stack frames for debugging, even in opt mode.
960 compiler_flag: "-fno-omit-frame-pointer"
961
962 # Don't use temp files while compiling.
963 compiler_flag: "-pipe"
964
965 # Stamp the binary with a unique identifier.
966 linker_flag: "-Wl,--build-id=md5"
967 linker_flag: "-Wl,--hash-style=gnu"
968 #linker_flag: "-Wl,--warn-execstack"
969 #linker_flag: "-Wl,--detect-odr-violations"
970
971 # Enable debug symbols.
972 compiler_flag: "-ggdb3"
973
974 compilation_mode_flags {
975 mode: OPT
976
977 compiler_flag: "-O2"
978
979 # Disable assertions
980 compiler_flag: "-DNDEBUG"
981 compiler_flag: "-D_FORTIFY_SOURCE=1"
982
983 # Removal of unused code and data at link time (can this increase binary size in some cases?).
984 compiler_flag: "-ffunction-sections"
985 compiler_flag: "-fdata-sections"
986 linker_flag: "-Wl,--gc-sections"
987 }
988 feature {
989 name: "pie_for_linking"
990 enabled: true
991 flag_set {
992 action: "c++-link-executable"
993 flag_group {
994 flag: "-pie"
995 }
996 }
997 }
998}