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