blob: 69148253aaa00d7cf15877f581d8c5c9528c42f6 [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 {
James Kuszmaul27da8142019-07-21 16:13:55 -070021 cpu: "web"
22 toolchain_identifier: "emscripten_toolchain"
23}
24
25default_toolchain {
Brian Silverman7b8899e2018-06-30 19:19:24 -070026 cpu: "armhf-debian"
27 toolchain_identifier: "clang_linux_armhf"
28}
29
30default_toolchain {
31 cpu: "cortex-m4f"
32 toolchain_identifier: "cortex-m4f"
33}
34
Brian Silverman6c8b88b2018-09-03 18:17:02 -070035default_toolchain {
36 cpu: "cortex-m4f-k22"
37 toolchain_identifier: "cortex-m4f-k22"
38}
39
Brian Silverman7b8899e2018-06-30 19:19:24 -070040toolchain {
41 abi_version: "armeabi-v7a"
42 abi_libc_version: "armeabi-v7a"
43 builtin_sysroot: ""
44 compiler: "compiler"
45 host_system_name: "armeabi-v7a"
46 needsPic: true
47 supports_gold_linker: false
48 supports_incremental_linker: false
49 supports_fission: false
50 supports_interface_shared_objects: false
51 supports_normalizing_ar: false
52 supports_start_end_lib: false
53 supports_thin_archives: false
54 target_libc: "armeabi-v7a"
55 target_cpu: "armeabi-v7a"
56 target_system_name: "armeabi-v7a"
57 toolchain_identifier: "stub_armeabi-v7a"
58
59 tool_path { name: "ar" path: "/bin/false" }
60 tool_path { name: "compat-ld" path: "/bin/false" }
61 tool_path { name: "cpp" path: "/bin/false" }
62 tool_path { name: "dwp" path: "/bin/false" }
63 tool_path { name: "gcc" path: "/bin/false" }
64 tool_path { name: "gcov" path: "/bin/false" }
65 tool_path { name: "ld" path: "/bin/false" }
66
67 tool_path { name: "nm" path: "/bin/false" }
68 tool_path { name: "objcopy" path: "/bin/false" }
69 tool_path { name: "objdump" path: "/bin/false" }
70 tool_path { name: "strip" path: "/bin/false" }
71}
72
73toolchain {
74 abi_version: "local"
75 abi_libc_version: "local"
76 builtin_sysroot: ""
77 compiler: "clang"
78 host_system_name: "local"
79 needsPic: true
80 supports_gold_linker: false
81 supports_incremental_linker: false
82 supports_fission: false
83 supports_interface_shared_objects: false
84 supports_normalizing_ar: false
85 supports_start_end_lib: false
86 supports_thin_archives: false
87 target_libc: "local"
88 target_cpu: "k8"
89 target_system_name: "k8"
90 toolchain_identifier: "k8_linux"
91
92 # These paths are relative to //tools/cpp.
93 tool_path { name: "ar" path: "clang_3p6/x86_64-linux-gnu-ar" }
94 tool_path { name: "compat-ld" path: "clang_3p6/x86_64-linux-gnu-ld" }
95 tool_path { name: "cpp" path: "clang_3p6/x86_64-linux-gnu-cpp" }
96 tool_path { name: "dwp" path: "clang_3p6/x86_64-linux-gnu-dwp" }
97 tool_path { name: "gcc" path: "clang_3p6/x86_64-linux-gnu-clang-3.6" }
98 tool_path { name: "gcov" path: "clang_3p6/x86_64-linux-gnu-gcov" }
99 # C(++) compiles invoke the compiler (as that is the one knowing where
100 # to find libraries), but we provide LD so other rules can invoke the linker.
101 tool_path { name: "ld" path: "clang_3p6/x86_64-linux-gnu-ld" }
102 tool_path { name: "nm" path: "clang_3p6/x86_64-linux-gnu-nm" }
103 tool_path { name: "objcopy" path: "clang_3p6/x86_64-linux-gnu-objcopy" }
104 objcopy_embed_flag: "-I"
105 objcopy_embed_flag: "binary"
106 tool_path { name: "objdump" path: "clang_3p6/x86_64-linux-gnu-objdump" }
107 tool_path { name: "strip" path: "clang_3p6/x86_64-linux-gnu-strip" }
108 linking_mode_flags { mode: DYNAMIC }
109
110 compiler_flag: "--sysroot=external/clang_3p6_repo/"
111 compiler_flag: "-nostdinc"
112 compiler_flag: "-isystem"
113 compiler_flag: "external/clang_3p6_repo/usr/include",
114 compiler_flag: "-isystem"
115 compiler_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu",
116 compiler_flag: "-isystem"
117 compiler_flag: "external/clang_3p6_repo/usr/lib/llvm-3.6/lib/clang/3.6.2/include",
118
119 cxx_flag: "-isystem"
120 cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9"
121 cxx_flag: "-isystem"
122 cxx_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu/c++/4.9"
123 cxx_flag: "-isystem"
124 cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9/backward"
125
126 # TODO(bazel-team): In theory, the path here ought to exactly match the path
127 # used by gcc. That works because bazel currently doesn't track files at
128 # absolute locations and has no remote execution, yet. However, this will need
129 # to be fixed, maybe with auto-detection?
130 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9'
131 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu/c++/4.9'
132 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9/backward'
133 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/local/include'
134 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/llvm-3.6/lib/clang/3.6.2/include'
135 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu'
136 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include'
137 cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/clang/3.6.2/include'
138
139 linker_flag: "-nodefaultlibs"
140 linker_flag: "--sysroot=external/clang_3p6_repo/"
141 linker_flag: "-lstdc++"
142 linker_flag: "-lc"
143 linker_flag: "-lgcc"
144 linker_flag: "-lgcc_s"
145 linker_flag: "-Bexternal/clang_3p6_repo/usr/bin/"
146 linker_flag: "-Ltools/cpp/clang_3p6/clang_more_libs"
147 linker_flag: "-Lexternal/clang_3p6/lib/x86_64-linux-gnu"
148 linker_flag: "-Lexternal/clang_3p6/usr/lib/x86_64-linux-gnu"
149 linker_flag: "-Lexternal/clang_3p6/usr/lib/gcc/x86_64-linux-gnu"
150
151 feature {
152 name: "opt"
153 implies: "all_modes"
154 flag_set {
155 action: "preprocess-assemble"
156 action: "c-compile"
157 action: "c++-compile"
158 action: "c++-header-parsing"
159 action: "c++-header-preprocessing"
160 action: "c++-module-compile"
161 flag_group {
162 flag: "-DAOS_DEBUG=0"
163 }
164 }
165 }
166
167 feature {
168 name: "dbg"
169 implies: "all_modes"
170 flag_set {
171 action: "preprocess-assemble"
172 action: "c-compile"
173 action: "c++-compile"
174 action: "c++-header-parsing"
175 action: "c++-header-preprocessing"
176 action: "c++-module-compile"
177 flag_group {
178 flag: "-DAOS_DEBUG=1"
179 }
180 flag_group {
181 flag: "-fno-omit-frame-pointer"
182 }
183 }
184 }
185
186 feature {
187 name: "fastbuild"
188 implies: "all_modes"
189 flag_set {
190 action: "preprocess-assemble"
191 action: "c-compile"
192 action: "c++-compile"
193 action: "c++-header-parsing"
194 action: "c++-header-preprocessing"
195 action: "c++-module-compile"
196 flag_group {
197 flag: "-DAOS_DEBUG=0"
198 }
199 }
200 }
201
202 feature {
203 name: "all_modes"
204 flag_set {
205 action: "preprocess-assemble"
206 action: "assemble"
207 action: "c-compile"
208 flag_group {
209 flag: "-std=gnu99"
210 }
211 }
212 flag_set {
213 action: "c++-compile"
214 action: "c++-header-parsing"
215 action: "c++-header-preprocessing"
216 action: "c++-module-compile"
217 flag_group {
218 flag: "-std=gnu++1y"
219 }
220 }
221 flag_set {
222 action: "preprocess-assemble"
223 action: "assemble"
224 action: "c++-link"
225 action: "c++-compile"
226 action: "c++-header-parsing"
227 action: "c++-header-preprocessing"
228 action: "c++-module-compile"
229 action: "c-compile"
230 flag_group {
231 # We always want to compile with -pthread semantics.
232 flag: "-pthread"
233 }
234 }
235 }
236
237 # Anticipated future default.
238 # This makes GCC and Clang do what we want when called through symlinks.
239 unfiltered_cxx_flag: "-no-canonical-prefixes"
240 linker_flag: "-no-canonical-prefixes"
241
242 # Things that the code wants defined.
243 compiler_flag: "-D__STDC_FORMAT_MACROS"
244 compiler_flag: "-D__STDC_CONSTANT_MACROS"
245 compiler_flag: "-D__STDC_LIMIT_MACROS"
246 compiler_flag: "-D_FILE_OFFSET_BITS=64"
247 # TODO(Brian): Rename this or something.
248 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
249
250 linker_flag: "-fuse-ld=gold"
251
252 # Make C++ compilation deterministic. Use linkstamping instead of these
253 # compiler symbols.
254 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
255 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
256 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
257 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
258
259 # Security hardening on by default.
260 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
261 # We need to undef it before redefining it as some distributions now have
262 # it enabled by default.
263 compiler_flag: "-U_FORTIFY_SOURCE"
264 compiler_flag: "-D_FORTIFY_SOURCE=1"
265 compiler_flag: "-fstack-protector"
266 compiler_flag: "-fPIE"
267 linker_flag: "-Wl,-z,relro,-z,now"
268
269 # Pretty much everything needs this, including parts of the glibc STL...
270 linker_flag: "-lm"
271
272 # Enable coloring even if there's no attached terminal. Bazel removes the
273 # escape sequences if --nocolor is specified.
274 compiler_flag: "-fcolor-diagnostics"
275 compiler_flag: "-fmessage-length=80"
276 compiler_flag: "-fmacro-backtrace-limit=0"
277
278 compiler_flag: "-Wall"
279 compiler_flag: "-Wextra"
280 compiler_flag: "-Wpointer-arith"
281 compiler_flag: "-Wstrict-aliasing"
282 compiler_flag: "-Wcast-qual"
283 compiler_flag: "-Wcast-align"
284 compiler_flag: "-Wwrite-strings"
285 compiler_flag: "-Wtype-limits"
286 compiler_flag: "-Wsign-compare"
287 compiler_flag: "-Wformat=2"
288 compiler_flag: "-Werror"
289
290 # Keep stack frames for debugging, even in opt mode.
291 compiler_flag: "-fno-omit-frame-pointer"
292
293 # Don't use temp files while compiling.
294 compiler_flag: "-pipe"
295
296 # Stamp the binary with a unique identifier.
297 linker_flag: "-Wl,--build-id=md5"
298 linker_flag: "-Wl,--hash-style=gnu"
299 linker_flag: "-Wl,--warn-execstack"
300 linker_flag: "-Wl,--detect-odr-violations"
301
302 # Enable debug symbols.
303 compiler_flag: "-ggdb3"
304
305 compilation_mode_flags {
306 mode: OPT
307
308 compiler_flag: "-O2"
309
310 # Disable assertions
311 compiler_flag: "-DNDEBUG"
312
313 # Removal of unused code and data at link time (can this increase binary size in some cases?).
314 compiler_flag: "-ffunction-sections"
315 compiler_flag: "-fdata-sections"
316 linker_flag: "-Wl,--gc-sections"
317 }
318 feature {
319 name: "pie_for_linking"
320 enabled: true
321 flag_set {
322 action: "c++-link-executable"
323 flag_group {
324 flag: "-pie"
325 }
326 }
327 }
328}
329
330toolchain {
James Kuszmaul27da8142019-07-21 16:13:55 -0700331 # This toolchain was initially sourced from https://github.com/ribrdb/rules_emscripten
332 toolchain_identifier: "emscripten_toolchain"
333 host_system_name: "web"
334 target_system_name: "emscripten-unknown-emscripten"
335 target_cpu: "web"
336 target_libc: "unknown"
337 compiler: "emscripten"
338 abi_version: "unknown"
339 abi_libc_version: "unknown"
340 tool_path {
341 name: "gcc"
342 path: "emscripten/emcc.sh"
343 }
344 tool_path {
345 name: "ld"
346 path: "emscripten/emcc.sh"
347 }
348 tool_path {
349 name: "ar"
350 path: "emscripten/emar.sh"
351 }
352 tool_path {
353 name: "cpp"
354 path: "/bin/false"
355 }
356 tool_path {
357 name: "gcov"
358 path: "/bin/false"
359 }
360 tool_path {
361 name: "nm"
362 path: "/bin/false"
363 }
364 tool_path {
365 name: "objdump"
366 path: "/bin/false"
367 }
368 tool_path {
369 name: "objcopy"
370 path: "/bin/false"
371 }
372 tool_path {
373 name: "strip"
374 path: "/bin/false"
375 }
376
377 unfiltered_cxx_flag: "-isystem"
378 unfiltered_cxx_flag: "external/emscripten_toolchain/system/include/libcxx"
379 unfiltered_cxx_flag: "-isystem"
380 unfiltered_cxx_flag: "external/emscripten_toolchain/system/lib/libcxxabi/include"
381 unfiltered_cxx_flag: "-isystem"
382 unfiltered_cxx_flag: "external/emscripten_toolchain/system/include/compat"
383 compiler_flag: "-isystem"
384 compiler_flag: "external/emscripten_toolchain/system/include"
385 unfiltered_cxx_flag: "-isystem"
386 unfiltered_cxx_flag: "external/emscripten_toolchain/system/include"
387 unfiltered_cxx_flag: "-isystem"
388 unfiltered_cxx_flag: "external/emscripten_toolchain/system/include/SSE"
389 unfiltered_cxx_flag: "-isystem"
390 unfiltered_cxx_flag: "external/emscripten_toolchain/system/include/libc"
391 unfiltered_cxx_flag: "-isystem"
392 unfiltered_cxx_flag: "external/emscripten_toolchain/system/lib/libc/musl/arch/emscripten"
393 unfiltered_cxx_flag: "-isystem"
394 unfiltered_cxx_flag: "external/emscripten_toolchain/system/local/include"
395
396 # Turn off exceptions since emscripten has issues catching them
397 compiler_flag: "-fno-exceptions"
398
399 unfiltered_cxx_flag: "-no-canonical-prefixes"
400 linker_flag: "-no-canonical-prefixes"
401
402 # Make C++ compilation deterministic. Use linkstamping instead of these
403 # compiler symbols.
404 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
405 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
406 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
407 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
408 # Enable coloring even if there's no attached terminal. Bazel removes the
409 # escape sequences if --nocolor is specified.
410 compiler_flag: "-fdiagnostics-color=always"
411 compiler_flag: "-Wall"
412 compiler_flag: "-Werror"
413
414 compiler_flag: "-ffunction-sections"
415 compiler_flag: "-fdata-sections"
416
417 feature {
418 name: "opt"
419 flag_set {
420 action: "preprocess-assemble"
421 action: "c-compile"
422 action: "c++-compile"
423 action: "c++-header-parsing"
424 action: "c++-header-preprocessing"
425 action: "c++-module-compile"
426 flag_group {
427 flag: "-DAOS_DEBUG=0"
428 flag: "-O2"
429 flag: "--closure"
430 flag: "1"
431 }
432 }
433 implies: "all_modes"
434 }
435 feature {
436 name: "dbg"
437 flag_set {
438 action: "preprocess-assemble"
439 action: "c-compile"
440 action: "c++-compile"
441 action: "c++-header-parsing"
442 action: "c++-header-preprocessing"
443 action: "c++-module-compile"
444 flag_group {
445 flag: "-DAOS_DEBUG=1"
446 }
447 flag_group {
448 flag: "-fno-omit-frame-pointer"
449 }
450 }
451 implies: "all_modes"
452 }
453 feature {
454 name: "fastbuild"
455 flag_set {
456 action: "preprocess-assemble"
457 action: "c-compile"
458 action: "c++-compile"
459 action: "c++-header-parsing"
460 action: "c++-header-preprocessing"
461 action: "c++-module-compile"
462 flag_group {
463 flag: "-DAOS_DEBUG=0"
464 }
465 }
466 implies: "all_modes"
467 }
468 feature {
469 name: "all_modes"
470 flag_set {
471 action: "preprocess-assemble"
472 action: "assemble"
473 action: "c-compile"
474 flag_group {
475 flag: "-std=gnu99"
476 }
477 }
478 flag_set {
479 action: "c++-compile"
480 action: "c++-header-parsing"
481 action: "c++-header-preprocessing"
482 action: "c++-module-compile"
483 flag_group {
484 flag: "-std=gnu++1y"
485 }
486 }
487 }
488}
489
490toolchain {
Austin Schuhef147de2018-10-27 21:19:00 -0700491 toolchain_identifier: "roborio_linux"
492 host_system_name: "roborio"
493 target_system_name: "roborio"
494 target_cpu: "roborio"
495 target_libc: "roborio"
496 compiler: "gcc"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700497 abi_version: "roborio"
498 abi_libc_version: "roborio"
Austin Schuhef147de2018-10-27 21:19:00 -0700499
Brian Silverman7b8899e2018-06-30 19:19:24 -0700500 builtin_sysroot: ""
Brian Silverman7b8899e2018-06-30 19:19:24 -0700501 needsPic: true
502 supports_gold_linker: false
503 supports_incremental_linker: false
504 supports_fission: false
505 supports_interface_shared_objects: false
506 supports_normalizing_ar: false
507 supports_start_end_lib: false
508 supports_thin_archives: false
Brian Silverman7b8899e2018-06-30 19:19:24 -0700509
510 tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
Austin Schuhf6b94632019-02-02 22:11:27 -0800511 tool_path { name: "as" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as" }
Brian Silverman7b8899e2018-06-30 19:19:24 -0700512 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
513 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
514 tool_path { name: "dwp" path: "/bin/false" }
515 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
516 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
517 # C(++) compiles invoke the compiler (as that is the one knowing where
518 # to find libraries), but we provide LD so other rules can invoke the linker.
519 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
520 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
521 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
522 objcopy_embed_flag: "-I"
523 objcopy_embed_flag: "binary"
524 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
525 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
526 linking_mode_flags { mode: DYNAMIC }
527
Austin Schuhef147de2018-10-27 21:19:00 -0700528 feature {
529 name: "compile_flags1"
530 enabled: true
531 flag_set {
532 action: "assemble"
533 action: "preprocess-assemble"
534 action: "c-compile"
535 action: "c++-compile"
536 action: "c++-header-parsing"
537 action: "c++-module-compile"
538 action: "c++-module-codegen"
539 action: "lto-backend"
540 action: "clif-match"
541 flag_group {
Austin Schuhf6b94632019-02-02 22:11:27 -0800542 flag: "--sysroot=external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi"
Austin Schuhef147de2018-10-27 21:19:00 -0700543 flag: "-nostdinc"
544 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800545 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 -0700546 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800547 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/lib/gcc/arm-frc2019-linux-gnueabi/6.3.0/include-fixed"
548 }
549 }
550
551 flag_set {
James Kuszmaulebdeaf52019-05-22 20:31:25 -0700552 action: "assemble"
553 action: "preprocess-assemble"
554 action: "c++-compile"
555 action: "c++-header-parsing"
556 action: "c++-header-preprocessing"
557 flag_group {
558 flag: "-fno-canonical-system-headers"
559 }
560 }
561
562 flag_set {
Austin Schuhf6b94632019-02-02 22:11:27 -0800563 action: "c++-compile"
564 action: "c++-header-parsing"
565 action: "c++-module-compile"
566 action: "c++-module-codegen"
567 flag_group {
Austin Schuhef147de2018-10-27 21:19:00 -0700568 flag: "-isystem"
Austin Schuhf6b94632019-02-02 22:11:27 -0800569 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0"
570 flag: "-isystem"
571 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/arm-frc2019-linux-gnueabi"
572 flag: "-isystem"
573 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/backward"
574 }
575 }
576
577 flag_set {
578 action: "assemble"
579 action: "preprocess-assemble"
580 action: "c-compile"
581 action: "c++-compile"
582 action: "c++-header-parsing"
583 action: "c++-module-compile"
584 action: "c++-module-codegen"
585 action: "lto-backend"
586 action: "clif-match"
587 flag_group {
588 flag: "-isystem"
589 flag: "external/arm_frc_linux_gnueabi_repo/arm-frc2019-linux-gnueabi/usr/include"
590
Austin Schuhef147de2018-10-27 21:19:00 -0700591 flag: "-mfpu=neon"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700592
Austin Schuhef147de2018-10-27 21:19:00 -0700593 # Things that the code wants defined.
594 flag: "-D__STDC_FORMAT_MACROS"
595 flag: "-D__STDC_CONSTANT_MACROS"
596 flag: "-D__STDC_LIMIT_MACROS"
597 flag: "-D_FILE_OFFSET_BITS=64"
598
599 # TODO(Brian): Rename this or something.
600 flag: "-DAOS_ARCHITECTURE_arm_frc"
601
602 # Security hardening on by default.
603 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
604 # We need to undef it before redefining it as some distributions now have
605 # it enabled by default.
606 flag: "-U_FORTIFY_SOURCE"
607 flag: "-fstack-protector"
608 flag: "-fPIE"
609
610 # Enable coloring even if there's no attached terminal. Bazel removes the
611 # escape sequences if --nocolor is specified.
612 flag: "-fdiagnostics-color=always"
613
614 flag: "-Wall"
615 flag: "-Wextra"
616 flag: "-Wpointer-arith"
617 flag: "-Wstrict-aliasing"
618 flag: "-Wcast-qual"
619 flag: "-Wcast-align"
620 flag: "-Wwrite-strings"
621 flag: "-Wtype-limits"
622 flag: "-Wsign-compare"
623 flag: "-Wformat=2"
624 flag: "-Werror"
625 flag: "-Wunused-local-typedefs"
626
627 # Keep stack frames for debugging, even in opt mode.
628 flag: "-fno-omit-frame-pointer"
629
630 flag: "-D__has_feature(x)=0"
631
632 # Don't use temp files while compiling.
633 flag: "-pipe"
634
635 # Enable debug symbols.
636 flag: "-ggdb3"
637 }
638 }
639 }
640
641 feature {
642 name: "opt"
643 implies: "opt_post"
644 flag_set {
645 action: "assemble"
646 action: "preprocess-assemble"
647 action: "c-compile"
648 action: "c++-compile"
649 action: "c++-module-compile"
650 action: "objc-compile"
651 action: "objc++-compile"
652 action: "c++-header-parsing"
653 action: "linkstamp-compile"
654 flag_group {
655 flag: "-O2"
656 flag: "-DNDEBUG"
657 flag: "-D_FORTIFY_SOURCE=1"
658 flag: "-ffunction-sections"
659 flag: "-fdata-sections"
660 }
661 }
662 flag_set {
663 action: "c++-link-executable"
664 action: "c++-link-nodeps-dynamic-library"
665 action: "c++-link-dynamic-library"
666 flag_group {
667 flag: "-Wl,--gc-sections"
668 }
669 }
670 }
671
Brian Silverman7b8899e2018-06-30 19:19:24 -0700672 # TODO(bazel-team): In theory, the path here ought to exactly match the path
673 # used by gcc. That works because bazel currently doesn't track files at
674 # absolute locations and has no remote execution, yet. However, this will need
675 # to be fixed, maybe with auto-detection?
Austin Schuhf6b94632019-02-02 22:11:27 -0800676
677 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)%"
678 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)%"
679 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//arm-frc2019-linux-gnueabi/usr/include/c++/6.3.0/arm-frc2019-linux-gnueabi)%"
680 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 -0700681
682 linker_flag: "-lstdc++"
683 linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs"
684
685 feature {
Austin Schuhef147de2018-10-27 21:19:00 -0700686 name: "dependency_file"
687 flag_set {
688 action: "assemble"
689 action: "preprocess-assemble"
690 action: "c-compile"
691 action: "c++-compile"
692 action: "c++-module-compile"
693 action: "objc-compile"
694 action: "objc++-compile"
695 action: "c++-header-parsing"
696 action: "clif-match"
697 expand_if_all_available: "dependency_file"
698 flag_group {
699 flag: "-MD"
700 flag: "-MF"
701 flag: "%{dependency_file}"
702 }
703 }
704 }
705
706 feature {
707 name: "random_seed"
708 flag_set {
709 # TODO(austin): Should these also have -frandom-seed set? Upstream
710 # doesn't.
711 # action: "linkstamp-compile"
712 # action: "c-compile"
713 action: "c++-compile"
714 action: "c++-module-codegen"
715 action: "c++-module-compile"
716 flag_group {
717 expand_if_all_available: "output_file"
718 flag: "-frandom-seed=%{output_file}"
719 }
720 }
721 }
722
723 feature {
724 name: "pic"
725 flag_set {
726 action: "assemble"
727 action: "preprocess-assemble"
728 action: "linkstamp-compile"
729 action: "c-compile"
730 action: "c++-compile"
731 action: "c++-module-codegen"
732 action: "c++-module-compile"
733 expand_if_all_available: "pic"
734 flag_group {
735 flag: "-fPIC"
736 }
737 }
738 }
739
740 feature {
741 name: "preprocessor_defines"
742 flag_set {
743 action: "preprocess-assemble"
744 action: "linkstamp-compile"
745 action: "c-compile"
746 action: "c++-compile"
747 action: "c++-header-parsing"
748 action: "c++-module-compile"
749 action: "clif-match"
750 flag_group {
751 iterate_over: "preprocessor_defines"
752 flag: "-D%{preprocessor_defines}"
753 }
754 }
755 }
756
757 feature {
758 name: "include_paths"
759 flag_set {
760 action: "preprocess-assemble"
761 action: "c-compile"
762 action: "c++-compile"
763 action: "c++-header-parsing"
764 action: "c++-header-preprocessing"
765 action: "c++-module-compile"
766 flag_group {
767 flag: "-iquote"
768 flag: "%{quote_include_paths}"
769 iterate_over: "quote_include_paths"
770 }
771 flag_group {
772 flag: "-I%{include_paths}"
773 iterate_over: "include_paths"
774 }
775 flag_group {
776 flag: "-isystem"
777 flag: "%{system_include_paths}"
778 iterate_over: "system_include_paths"
779 }
780 }
781 }
782
783 feature {
784 name: "opt_post"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700785 flag_set {
786 action: "preprocess-assemble"
787 action: "c-compile"
788 action: "c++-compile"
789 action: "c++-header-parsing"
790 action: "c++-header-preprocessing"
791 action: "c++-module-compile"
792 flag_group {
793 flag: "-DAOS_DEBUG=0"
794 }
795 }
796 }
797
798 feature {
799 name: "dbg"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700800 flag_set {
801 action: "preprocess-assemble"
802 action: "c-compile"
803 action: "c++-compile"
804 action: "c++-header-parsing"
805 action: "c++-header-preprocessing"
806 action: "c++-module-compile"
807 flag_group {
808 flag: "-DAOS_DEBUG=1"
809 }
810 flag_group {
811 flag: "-fno-omit-frame-pointer"
812 }
813 }
814 }
815
816 feature {
817 name: "fastbuild"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700818 flag_set {
819 action: "preprocess-assemble"
820 action: "c-compile"
821 action: "c++-compile"
822 action: "c++-header-parsing"
823 action: "c++-header-preprocessing"
824 action: "c++-module-compile"
825 flag_group {
826 flag: "-DAOS_DEBUG=0"
827 }
828 }
829 }
830
831 feature {
832 name: "all_modes"
Austin Schuhef147de2018-10-27 21:19:00 -0700833 enabled: true
Brian Silverman7b8899e2018-06-30 19:19:24 -0700834 flag_set {
835 action: "preprocess-assemble"
836 action: "assemble"
837 action: "c-compile"
838 flag_group {
839 flag: "-std=gnu99"
840 }
841 }
842 flag_set {
843 action: "c++-compile"
844 action: "c++-header-parsing"
845 action: "c++-header-preprocessing"
846 action: "c++-module-compile"
847 flag_group {
848 flag: "-std=gnu++1y"
Austin Schuhf6b94632019-02-02 22:11:27 -0800849 flag: "-fno-sized-deallocation"
Brian Silverman7b8899e2018-06-30 19:19:24 -0700850 }
851 }
852 flag_set {
853 action: "preprocess-assemble"
854 action: "assemble"
855 action: "c++-link"
856 action: "c++-compile"
857 action: "c++-header-parsing"
858 action: "c++-header-preprocessing"
859 action: "c++-module-compile"
860 action: "c-compile"
861 flag_group {
862 # We always want to compile with -pthread semantics.
863 flag: "-pthread"
864 }
865 }
866 }
867
Brian Silverman7b8899e2018-06-30 19:19:24 -0700868 # Anticipated future default.
869 # This makes GCC and Clang do what we want when called through symlinks.
870 unfiltered_cxx_flag: "-no-canonical-prefixes"
871 linker_flag: "-no-canonical-prefixes"
872
Brian Silverman7b8899e2018-06-30 19:19:24 -0700873 # Make C++ compilation deterministic. Use linkstamping instead of these
874 # compiler symbols.
875 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
876 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
877 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
878 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
879
Brian Silverman7b8899e2018-06-30 19:19:24 -0700880 linker_flag: "-Wl,-z,relro,-z,now"
881
882 # Pretty much everything needs this, including parts of the glibc STL...
883 linker_flag: "-lm"
884
Brian Silverman7b8899e2018-06-30 19:19:24 -0700885 # Have GCC return the exit code from ld.
886 linker_flag: "-pass-exit-codes"
887
888 # Stamp the binary with a unique identifier.
889 linker_flag: "-Wl,--build-id=md5"
890 linker_flag: "-Wl,--hash-style=gnu"
891 #linker_flag: "-Wl,--warn-execstack"
892 #linker_flag: "-Wl,--detect-odr-violations"
893
Brian Silverman7b8899e2018-06-30 19:19:24 -0700894 feature {
895 name: "pie_for_linking"
896 enabled: true
897 flag_set {
898 action: "c++-link-executable"
899 flag_group {
900 flag: "-pie"
901 }
902 }
903 }
904}
905
906toolchain {
907 abi_version: "clang_3.6"
908 abi_libc_version: "glibc_2.19"
909 builtin_sysroot: ""
910 compiler: "clang"
911 host_system_name: "linux"
912 needsPic: true
913 supports_gold_linker: false
914 supports_incremental_linker: false
915 supports_fission: false
916 supports_interface_shared_objects: false
917 supports_normalizing_ar: true
918 supports_start_end_lib: false
919 supports_thin_archives: true
920 target_libc: "glibc_2.19"
921 target_cpu: "armhf-debian"
922 target_system_name: "arm_a15"
923 toolchain_identifier: "clang_linux_armhf"
924
925 tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" }
926 tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
927 tool_path { name: "cpp" path: "linaro_linux_gcc/clang_bin/clang" }
928 tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" }
929 tool_path { name: "gcc" path: "linaro_linux_gcc/clang_bin/clang" }
930 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
931 # C(++) compiles invoke the compiler (as that is the one knowing where
932 # to find libraries), but we provide LD so other rules can invoke the linker.
933 tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
934 tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" }
935 tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" }
936 objcopy_embed_flag: "-I"
937 objcopy_embed_flag: "binary"
938 tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" }
939 tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" }
940 linking_mode_flags { mode: DYNAMIC }
941
942 compiler_flag: "-target"
943 compiler_flag: "armv7a-arm-linux-gnueabif"
944 compiler_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
945 compiler_flag: "-mfloat-abi=hard"
946 compiler_flag: "-mfpu=vfpv3-d16"
947
948 compiler_flag: "-nostdinc"
949 compiler_flag: "-isystem"
950 compiler_flag: "/usr/lib/clang/3.6/include"
951 compiler_flag: "-isystem"
952 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include"
953 compiler_flag: "-isystem"
954 compiler_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/include"
955 compiler_flag: "-isystem"
956 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed"
957 cxx_flag: "-isystem"
958 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf"
959 cxx_flag: "-isystem"
960 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3"
961 cxx_flag: "-isystem"
962 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3/arm-linux-gnueabihf"
963 cxx_flag: "-isystem"
964 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3"
965
966 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%"
967 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/include)%"
968 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/lib/include)%"
969 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)%"
970 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%/c++/4.9.3"
971 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
972 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)%"
973 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
974 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
975 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/include)%/c++/4.9.3"
976 cxx_builtin_include_directory: '/usr/lib/clang/3.6/include'
977
978 linker_flag: "-target"
979 linker_flag: "armv7a-arm-linux-gnueabif"
980 linker_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
981 linker_flag: "-lstdc++"
982 linker_flag: "-Ltools/cpp/linaro_linux_gcc/clang_more_libs"
983 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/lib"
984 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/lib"
985 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/lib"
986 linker_flag: "-Bexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/bin"
987 linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3"
988
989 feature {
990 name: "opt"
991 implies: "all_modes"
992 flag_set {
993 action: "preprocess-assemble"
994 action: "c-compile"
995 action: "c++-compile"
996 action: "c++-header-parsing"
997 action: "c++-header-preprocessing"
998 action: "c++-module-compile"
999 flag_group {
1000 flag: "-DAOS_DEBUG=0"
1001 }
1002 }
1003 }
1004
1005 feature {
1006 name: "dbg"
1007 implies: "all_modes"
1008 flag_set {
1009 action: "preprocess-assemble"
1010 action: "c-compile"
1011 action: "c++-compile"
1012 action: "c++-header-parsing"
1013 action: "c++-header-preprocessing"
1014 action: "c++-module-compile"
1015 flag_group {
1016 flag: "-DAOS_DEBUG=1"
1017 }
1018 flag_group {
1019 flag: "-fno-omit-frame-pointer"
1020 }
1021 }
1022 }
1023
1024 feature {
1025 name: "fastbuild"
1026 implies: "all_modes"
1027 flag_set {
1028 action: "preprocess-assemble"
1029 action: "c-compile"
1030 action: "c++-compile"
1031 action: "c++-header-parsing"
1032 action: "c++-header-preprocessing"
1033 action: "c++-module-compile"
1034 flag_group {
1035 flag: "-DAOS_DEBUG=0"
1036 }
1037 }
1038 }
1039
1040 feature {
1041 name: "all_modes"
1042 flag_set {
1043 action: "preprocess-assemble"
1044 action: "assemble"
1045 action: "c-compile"
1046 flag_group {
1047 flag: "-std=gnu99"
1048 }
1049 }
1050 flag_set {
1051 action: "c++-compile"
1052 action: "c++-header-parsing"
1053 action: "c++-header-preprocessing"
1054 action: "c++-module-compile"
1055 flag_group {
1056 flag: "-std=gnu++1y"
1057 }
1058 }
1059 flag_set {
1060 action: "preprocess-assemble"
1061 action: "assemble"
1062 action: "c++-link"
1063 action: "c++-compile"
1064 action: "c++-header-parsing"
1065 action: "c++-header-preprocessing"
1066 action: "c++-module-compile"
1067 action: "c-compile"
1068 flag_group {
1069 # We always want to compile with -pthread semantics.
1070 flag: "-pthread"
1071 }
1072 }
1073 }
1074
1075 # Anticipated future default.
1076 # This makes GCC and Clang do what we want when called through symlinks.
1077 unfiltered_cxx_flag: "-no-canonical-prefixes"
1078 linker_flag: "-no-canonical-prefixes"
1079
1080 # Things that the code wants defined.
1081 compiler_flag: "-D__STDC_FORMAT_MACROS"
1082 compiler_flag: "-D__STDC_CONSTANT_MACROS"
1083 compiler_flag: "-D__STDC_LIMIT_MACROS"
1084 compiler_flag: "-D_FILE_OFFSET_BITS=64"
1085 # TODO(Brian): Rename this or something.
1086 compiler_flag: "-DAOS_ARCHITECTURE_armhf"
1087
1088 # Make C++ compilation deterministic. Use linkstamping instead of these
1089 # compiler symbols.
1090 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
1091 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
1092 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
1093 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
1094
1095 # Security hardening on by default.
1096 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
1097 # We need to undef it before redefining it as some distributions now have
1098 # it enabled by default.
1099 compiler_flag: "-U_FORTIFY_SOURCE"
1100 compiler_flag: "-fstack-protector"
1101 compiler_flag: "-fPIE"
1102 linker_flag: "-Wl,-z,relro,-z,now"
1103
1104 # Pretty much everything needs this, including parts of the glibc STL...
1105 linker_flag: "-lm"
1106
1107 # Enable coloring even if there's no attached terminal. Bazel removes the
1108 # escape sequences if --nocolor is specified.
1109 compiler_flag: "-fdiagnostics-color=always"
1110
1111 compiler_flag: "-Wall"
1112 compiler_flag: "-Wextra"
1113 compiler_flag: "-Wpointer-arith"
1114 compiler_flag: "-Wstrict-aliasing"
1115 compiler_flag: "-Wcast-qual"
1116 compiler_flag: "-Wcast-align"
1117 compiler_flag: "-Wwrite-strings"
1118 compiler_flag: "-Wtype-limits"
1119 compiler_flag: "-Wsign-compare"
1120 compiler_flag: "-Wformat=2"
1121 compiler_flag: "-Werror"
1122 compiler_flag: "-Wunused-local-typedefs"
1123
1124 # Keep stack frames for debugging, even in opt mode.
1125 compiler_flag: "-fno-omit-frame-pointer"
1126
1127 # Don't use temp files while compiling.
1128 compiler_flag: "-pipe"
1129
1130 # Stamp the binary with a unique identifier.
1131 linker_flag: "-Wl,--build-id=md5"
1132 linker_flag: "-Wl,--hash-style=gnu"
1133 #linker_flag: "-Wl,--warn-execstack"
1134 #linker_flag: "-Wl,--detect-odr-violations"
1135
1136 # Enable debug symbols.
1137 compiler_flag: "-ggdb3"
1138
1139 compilation_mode_flags {
1140 mode: OPT
1141
1142 compiler_flag: "-O2"
1143
1144 # Disable assertions
1145 compiler_flag: "-DNDEBUG"
1146 compiler_flag: "-D_FORTIFY_SOURCE=1"
1147
1148 # Removal of unused code and data at link time (can this increase binary size in some cases?).
1149 compiler_flag: "-ffunction-sections"
1150 compiler_flag: "-fdata-sections"
1151 linker_flag: "-Wl,--gc-sections"
1152 }
1153 feature {
1154 name: "pie_for_linking"
1155 enabled: true
1156 flag_set {
1157 action: "c++-link-executable"
1158 flag_group {
1159 flag: "-pie"
1160 }
1161 }
1162 }
1163}