blob: 7e6efdb85a165aee1e7bb51f6c1d99c4f46c311b [file] [log] [blame]
Brian Silverman12b3fc52015-10-11 19:38:33 -04001major_version: "local"
2minor_version: ""
3default_target_cpu: "same_as_host"
4
5default_toolchain {
Austin Schuh23da18b2015-10-11 20:52:49 -07006 cpu: "roborio"
7 toolchain_identifier: "roborio_linux"
8}
9
10default_toolchain {
Brian Silverman12b3fc52015-10-11 19:38:33 -040011 cpu: "k8"
Austin Schuh23da18b2015-10-11 20:52:49 -070012 toolchain_identifier: "k8_linux"
Brian Silverman12b3fc52015-10-11 19:38:33 -040013}
14
15default_toolchain {
16 cpu: "armeabi-v7a"
17 toolchain_identifier: "stub_armeabi-v7a"
18}
19
Brian Silverman0d57fc82016-01-24 21:02:53 -050020default_toolchain {
21 cpu: "armhf-debian"
22 toolchain_identifier: "clang_linux_armhf"
23}
Brian Silverman12b3fc52015-10-11 19:38:33 -040024
Brian Silverman8b638692017-06-26 23:10:26 -070025default_toolchain {
26 cpu: "cortex-m4f"
27 toolchain_identifier: "cortex-m4f"
28}
29
Brian Silverman12b3fc52015-10-11 19:38:33 -040030toolchain {
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: ""
Austin Schuh23da18b2015-10-11 20:52:49 -070067 compiler: "clang"
Brian Silverman12b3fc52015-10-11 19:38:33 -040068 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"
Austin Schuh23da18b2015-10-11 20:52:49 -070078 target_cpu: "k8"
79 target_system_name: "k8"
80 toolchain_identifier: "k8_linux"
Brian Silverman12b3fc52015-10-11 19:38:33 -040081
82 tool_path { name: "ar" path: "/usr/bin/ar" }
83 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
84 tool_path { name: "cpp" path: "/usr/bin/cpp" }
85 tool_path { name: "dwp" path: "/usr/bin/dwp" }
86 tool_path { name: "gcc" path: "/usr/bin/clang-3.6" }
87 tool_path { name: "gcov" path: "/usr/bin/gcov" }
88 # C(++) compiles invoke the compiler (as that is the one knowing where
89 # to find libraries), but we provide LD so other rules can invoke the linker.
90 tool_path { name: "ld" path: "/usr/bin/ld" }
91 tool_path { name: "nm" path: "/usr/bin/nm" }
92 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
93 objcopy_embed_flag: "-I"
94 objcopy_embed_flag: "binary"
95 tool_path { name: "objdump" path: "/usr/bin/objdump" }
96 tool_path { name: "strip" path: "/usr/bin/strip" }
Brian Silverman6d350402016-03-05 01:15:46 -050097 linking_mode_flags { mode: DYNAMIC }
Brian Silverman12b3fc52015-10-11 19:38:33 -040098
99 # TODO(bazel-team): In theory, the path here ought to exactly match the path
100 # used by gcc. That works because bazel currently doesn't track files at
101 # absolute locations and has no remote execution, yet. However, this will need
102 # to be fixed, maybe with auto-detection?
Austin Schuh7b684d32015-10-21 20:17:09 -0700103 cxx_builtin_include_directory: '/usr/include/c++/4.9'
104 cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu/c++/4.9'
105 cxx_builtin_include_directory: '/usr/include/c++/4.9/backward'
106 cxx_builtin_include_directory: '/usr/local/include'
107 cxx_builtin_include_directory: '/usr/lib/llvm-3.6/lib/clang/3.6.2/include'
108 cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu'
109 cxx_builtin_include_directory: '/usr/include'
Brian Silverman0d57fc82016-01-24 21:02:53 -0500110 cxx_builtin_include_directory: '/usr/lib/clang/3.6.2/include'
Brian Silverman12b3fc52015-10-11 19:38:33 -0400111
112 linker_flag: "-lstdc++"
113 linker_flag: "-B/usr/bin/"
114
115 feature {
116 name: "opt"
117 implies: "all_modes"
118 flag_set {
119 action: "preprocess-assemble"
120 action: "c-compile"
121 action: "c++-compile"
122 action: "c++-header-parsing"
123 action: "c++-header-preprocessing"
124 action: "c++-module-compile"
125 flag_group {
126 flag: "-DAOS_DEBUG=0"
127 }
128 }
129 }
130
131 feature {
132 name: "dbg"
133 implies: "all_modes"
134 flag_set {
135 action: "preprocess-assemble"
136 action: "c-compile"
137 action: "c++-compile"
138 action: "c++-header-parsing"
139 action: "c++-header-preprocessing"
140 action: "c++-module-compile"
141 flag_group {
142 flag: "-DAOS_DEBUG=1"
143 }
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500144 flag_group {
145 flag: "-fno-omit-frame-pointer"
146 }
Brian Silverman12b3fc52015-10-11 19:38:33 -0400147 }
148 }
149
150 feature {
151 name: "fastbuild"
152 implies: "all_modes"
153 flag_set {
154 action: "preprocess-assemble"
155 action: "c-compile"
156 action: "c++-compile"
157 action: "c++-header-parsing"
158 action: "c++-header-preprocessing"
159 action: "c++-module-compile"
160 flag_group {
161 flag: "-DAOS_DEBUG=0"
162 }
163 }
164 }
165
166 feature {
167 name: "all_modes"
168 flag_set {
Austin Schuha20ae722015-11-01 12:29:38 -0800169 action: "preprocess-assemble"
170 action: "assemble"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400171 action: "c-compile"
172 flag_group {
173 flag: "-std=gnu99"
174 }
175 }
176 flag_set {
177 action: "c++-compile"
178 action: "c++-header-parsing"
179 action: "c++-header-preprocessing"
180 action: "c++-module-compile"
181 flag_group {
Austin Schuha20ae722015-11-01 12:29:38 -0800182 flag: "-std=gnu++1y"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400183 }
Brian Silverman23a1b342015-10-11 23:44:09 -0400184 }
185 flag_set {
186 action: "preprocess-assemble"
Austin Schuh23da18b2015-10-11 20:52:49 -0700187 action: "assemble"
188 action: "c++-link"
Brian Silverman23a1b342015-10-11 23:44:09 -0400189 action: "c++-compile"
190 action: "c++-header-parsing"
191 action: "c++-header-preprocessing"
192 action: "c++-module-compile"
Austin Schuh23da18b2015-10-11 20:52:49 -0700193 action: "c-compile"
Brian Silverman5dc00072015-10-12 00:38:14 -0400194 flag_group {
Brian Silverman12b3fc52015-10-11 19:38:33 -0400195 # We always want to compile with -pthread semantics.
Brian Silverman5dc00072015-10-12 00:38:14 -0400196 flag: "-pthread"
197 }
Brian Silverman12b3fc52015-10-11 19:38:33 -0400198 }
199 }
200
201 # Anticipated future default.
202 # This makes GCC and Clang do what we want when called through symlinks.
203 unfiltered_cxx_flag: "-no-canonical-prefixes"
204 linker_flag: "-no-canonical-prefixes"
205
206 # Things that the code wants defined.
207 compiler_flag: "-D__STDC_FORMAT_MACROS"
208 compiler_flag: "-D__STDC_CONSTANT_MACROS"
209 compiler_flag: "-D__STDC_LIMIT_MACROS"
210 compiler_flag: "-D_FILE_OFFSET_BITS=64"
211 # TODO(Brian): Rename this or something.
Austin Schuh23da18b2015-10-11 20:52:49 -0700212 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400213
214 linker_flag: "-fuse-ld=gold"
215
Brian Silverman12b3fc52015-10-11 19:38:33 -0400216 # Make C++ compilation deterministic. Use linkstamping instead of these
217 # compiler symbols.
218 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
219 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
220 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
221 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
222
223 # Security hardening on by default.
224 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
225 # We need to undef it before redefining it as some distributions now have
226 # it enabled by default.
227 compiler_flag: "-U_FORTIFY_SOURCE"
228 compiler_flag: "-D_FORTIFY_SOURCE=1"
229 compiler_flag: "-fstack-protector"
230 compiler_flag: "-fPIE"
231 linker_flag: "-pie"
232 linker_flag: "-Wl,-z,relro,-z,now"
233
234 # Pretty much everything needs this, including parts of the glibc STL...
235 linker_flag: "-lm"
236
237 # Enable coloring even if there's no attached terminal. Bazel removes the
238 # escape sequences if --nocolor is specified.
239 compiler_flag: "-fcolor-diagnostics"
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500240 compiler_flag: "-fmessage-length=80"
241 compiler_flag: "-fmacro-backtrace-limit=0"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400242
243 compiler_flag: "-Wall"
244 compiler_flag: "-Wextra"
245 compiler_flag: "-Wswitch-enum"
246 compiler_flag: "-Wpointer-arith"
Brian Silverman594be0d2015-10-31 17:56:23 -0400247 compiler_flag: "-Wstrict-aliasing"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400248 compiler_flag: "-Wcast-qual"
249 compiler_flag: "-Wcast-align"
250 compiler_flag: "-Wwrite-strings"
251 compiler_flag: "-Wtype-limits"
252 compiler_flag: "-Wsign-compare"
253 compiler_flag: "-Wformat=2"
254 compiler_flag: "-Werror"
255
256 # Keep stack frames for debugging, even in opt mode.
257 compiler_flag: "-fno-omit-frame-pointer"
258
259 # Don't use temp files while compiling.
260 compiler_flag: "-pipe"
261
Brian Silverman12b3fc52015-10-11 19:38:33 -0400262 # Stamp the binary with a unique identifier.
263 linker_flag: "-Wl,--build-id=md5"
264 linker_flag: "-Wl,--hash-style=gnu"
265 linker_flag: "-Wl,--warn-execstack"
266 linker_flag: "-Wl,--detect-odr-violations"
267
Brian Silvermand2540402015-11-28 18:35:00 -0500268 # Enable debug symbols.
269 compiler_flag: "-ggdb3"
270
Brian Silverman12b3fc52015-10-11 19:38:33 -0400271 compilation_mode_flags {
272 mode: OPT
273
Austin Schuha20ae722015-11-01 12:29:38 -0800274 compiler_flag: "-O2"
Brian Silverman12b3fc52015-10-11 19:38:33 -0400275
276 # Disable assertions
277 compiler_flag: "-DNDEBUG"
278
279 # Removal of unused code and data at link time (can this increase binary size in some cases?).
280 compiler_flag: "-ffunction-sections"
281 compiler_flag: "-fdata-sections"
282 linker_flag: "-Wl,--gc-sections"
283 }
284}
Austin Schuh23da18b2015-10-11 20:52:49 -0700285
286toolchain {
287 abi_version: "roborio"
288 abi_libc_version: "roborio"
289 builtin_sysroot: ""
290 compiler: "gcc"
291 host_system_name: "roborio"
292 needsPic: true
293 supports_gold_linker: false
294 supports_incremental_linker: false
295 supports_fission: false
296 supports_interface_shared_objects: false
297 supports_normalizing_ar: false
298 supports_start_end_lib: false
299 supports_thin_archives: false
300 target_libc: "roborio"
301 target_cpu: "roborio"
302 target_system_name: "roborio"
303 toolchain_identifier: "roborio_linux"
304
Austin Schuh55139fe2015-10-14 23:55:24 -0700305 tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
306 tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
307 tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
308 tool_path { name: "dwp" path: "/bin/false" }
309 tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
310 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700311 # C(++) compiles invoke the compiler (as that is the one knowing where
312 # to find libraries), but we provide LD so other rules can invoke the linker.
Austin Schuh55139fe2015-10-14 23:55:24 -0700313 tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
314 tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
315 tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
Austin Schuh23da18b2015-10-11 20:52:49 -0700316 objcopy_embed_flag: "-I"
317 objcopy_embed_flag: "binary"
Austin Schuh55139fe2015-10-14 23:55:24 -0700318 tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
319 tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
Brian Silverman6d350402016-03-05 01:15:46 -0500320 linking_mode_flags { mode: DYNAMIC }
Austin Schuh23da18b2015-10-11 20:52:49 -0700321
Brian Silverman826e1cd2016-01-31 18:26:00 -0500322 compiler_flag: "--sysroot=external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi"
Austin Schuh044e18b2015-10-21 20:17:09 -0700323 compiler_flag: "-nostdinc"
324 compiler_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500325 compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include",
Austin Schuh044e18b2015-10-21 20:17:09 -0700326 compiler_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500327 compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed"
Austin Schuh044e18b2015-10-21 20:17:09 -0700328 compiler_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500329 compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700330
331 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500332 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3"
Austin Schuh044e18b2015-10-21 20:17:09 -0700333 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500334 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3/arm-frc-linux-gnueabi"
Austin Schuh044e18b2015-10-21 20:17:09 -0700335 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500336 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/4.9.3/backward"
Austin Schuh044e18b2015-10-21 20:17:09 -0700337 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500338 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700339 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500340 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed"
Austin Schuh044e18b2015-10-21 20:17:09 -0700341 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500342 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700343 cxx_flag: "-isystem"
Brian Silverman826e1cd2016-01-31 18:26:00 -0500344 cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include"
Austin Schuh044e18b2015-10-21 20:17:09 -0700345
Austin Schuh23da18b2015-10-11 20:52:49 -0700346 # TODO(bazel-team): In theory, the path here ought to exactly match the path
347 # used by gcc. That works because bazel currently doesn't track files at
348 # absolute locations and has no remote execution, yet. However, this will need
349 # to be fixed, maybe with auto-detection?
Brian Silverman826e1cd2016-01-31 18:26:00 -0500350 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3"
351 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/arm-frc-linux-gnueabi"
352 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/backward"
353 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include)%"
354 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.3/include-fixed)%"
355 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%"
356 cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/usr/include)%"
Austin Schuh23da18b2015-10-11 20:52:49 -0700357
358 linker_flag: "-lstdc++"
Brian Silvermanb200c172017-01-02 17:35:35 -0800359 linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs"
Austin Schuh23da18b2015-10-11 20:52:49 -0700360
361 feature {
362 name: "opt"
363 implies: "all_modes"
364 flag_set {
365 action: "preprocess-assemble"
366 action: "c-compile"
367 action: "c++-compile"
368 action: "c++-header-parsing"
369 action: "c++-header-preprocessing"
370 action: "c++-module-compile"
371 flag_group {
372 flag: "-DAOS_DEBUG=0"
373 }
374 }
375 }
376
377 feature {
378 name: "dbg"
379 implies: "all_modes"
380 flag_set {
381 action: "preprocess-assemble"
382 action: "c-compile"
383 action: "c++-compile"
384 action: "c++-header-parsing"
385 action: "c++-header-preprocessing"
386 action: "c++-module-compile"
387 flag_group {
388 flag: "-DAOS_DEBUG=1"
389 }
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500390 flag_group {
391 flag: "-fno-omit-frame-pointer"
392 }
Austin Schuh23da18b2015-10-11 20:52:49 -0700393 }
394 }
395
396 feature {
397 name: "fastbuild"
398 implies: "all_modes"
399 flag_set {
400 action: "preprocess-assemble"
401 action: "c-compile"
402 action: "c++-compile"
403 action: "c++-header-parsing"
404 action: "c++-header-preprocessing"
405 action: "c++-module-compile"
406 flag_group {
407 flag: "-DAOS_DEBUG=0"
408 }
409 }
410 }
411
412 feature {
413 name: "all_modes"
414 flag_set {
Austin Schuh23da18b2015-10-11 20:52:49 -0700415 action: "preprocess-assemble"
416 action: "assemble"
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500417 action: "c-compile"
Austin Schuh23da18b2015-10-11 20:52:49 -0700418 flag_group {
419 flag: "-std=gnu99"
420 }
421 }
422 flag_set {
423 action: "c++-compile"
424 action: "c++-header-parsing"
425 action: "c++-header-preprocessing"
426 action: "c++-module-compile"
427 flag_group {
428 flag: "-std=gnu++1y"
429 }
430 }
431 flag_set {
432 action: "preprocess-assemble"
433 action: "assemble"
434 action: "c++-link"
435 action: "c++-compile"
436 action: "c++-header-parsing"
437 action: "c++-header-preprocessing"
438 action: "c++-module-compile"
439 action: "c-compile"
440 flag_group {
441 # We always want to compile with -pthread semantics.
442 flag: "-pthread"
443 }
444 }
445 }
446
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500447 compiler_flag: "-mfpu=neon"
448 # TODO(brians): See if it will run with this enabled.
449 #compiler_flag: "-mhwdiv=arm,thumb"
450
Austin Schuh23da18b2015-10-11 20:52:49 -0700451 # Anticipated future default.
452 # This makes GCC and Clang do what we want when called through symlinks.
453 unfiltered_cxx_flag: "-no-canonical-prefixes"
454 linker_flag: "-no-canonical-prefixes"
455
456 # Things that the code wants defined.
457 compiler_flag: "-D__STDC_FORMAT_MACROS"
458 compiler_flag: "-D__STDC_CONSTANT_MACROS"
459 compiler_flag: "-D__STDC_LIMIT_MACROS"
460 compiler_flag: "-D_FILE_OFFSET_BITS=64"
461 # TODO(Brian): Rename this or something.
Austin Schuha20ae722015-11-01 12:29:38 -0800462 compiler_flag: "-DAOS_ARCHITECTURE_arm_frc"
Austin Schuh23da18b2015-10-11 20:52:49 -0700463
464 #linker_flag: "-fuse-ld=gold"
465
Austin Schuh23da18b2015-10-11 20:52:49 -0700466 # Make C++ compilation deterministic. Use linkstamping instead of these
467 # compiler symbols.
468 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
469 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
470 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
471 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
472
473 # Security hardening on by default.
474 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
475 # We need to undef it before redefining it as some distributions now have
476 # it enabled by default.
477 compiler_flag: "-U_FORTIFY_SOURCE"
478 compiler_flag: "-fstack-protector"
479 compiler_flag: "-fPIE"
480 linker_flag: "-pie"
481 linker_flag: "-Wl,-z,relro,-z,now"
482
483 # Pretty much everything needs this, including parts of the glibc STL...
484 linker_flag: "-lm"
485
486 # Enable coloring even if there's no attached terminal. Bazel removes the
487 # escape sequences if --nocolor is specified.
488 compiler_flag: "-fdiagnostics-color=always"
489
490 compiler_flag: "-Wall"
491 compiler_flag: "-Wextra"
492 compiler_flag: "-Wswitch-enum"
493 compiler_flag: "-Wpointer-arith"
Brian Silverman594be0d2015-10-31 17:56:23 -0400494 compiler_flag: "-Wstrict-aliasing"
Austin Schuh23da18b2015-10-11 20:52:49 -0700495 compiler_flag: "-Wcast-qual"
496 compiler_flag: "-Wcast-align"
497 compiler_flag: "-Wwrite-strings"
498 compiler_flag: "-Wtype-limits"
499 compiler_flag: "-Wsign-compare"
500 compiler_flag: "-Wformat=2"
501 compiler_flag: "-Werror"
Brian Silvermana4a4ea62015-11-27 10:27:53 -0500502 compiler_flag: "-Wunused-local-typedefs"
Austin Schuh23da18b2015-10-11 20:52:49 -0700503
504 # Keep stack frames for debugging, even in opt mode.
505 compiler_flag: "-fno-omit-frame-pointer"
506 compiler_flag: "-D__has_feature(x)=0"
507
508 # Don't use temp files while compiling.
509 compiler_flag: "-pipe"
510
511 # Have GCC return the exit code from ld.
512 linker_flag: "-pass-exit-codes"
513
514 # Stamp the binary with a unique identifier.
515 linker_flag: "-Wl,--build-id=md5"
516 linker_flag: "-Wl,--hash-style=gnu"
517 #linker_flag: "-Wl,--warn-execstack"
518 #linker_flag: "-Wl,--detect-odr-violations"
519
Brian Silvermand2540402015-11-28 18:35:00 -0500520 # Enable debug symbols.
521 compiler_flag: "-ggdb3"
522
Austin Schuh23da18b2015-10-11 20:52:49 -0700523 compilation_mode_flags {
524 mode: OPT
525
Brian Silverman594be0d2015-10-31 17:56:23 -0400526 compiler_flag: "-O2"
Austin Schuh23da18b2015-10-11 20:52:49 -0700527
528 # Disable assertions
529 compiler_flag: "-DNDEBUG"
530 compiler_flag: "-D_FORTIFY_SOURCE=1"
531
532 # Removal of unused code and data at link time (can this increase binary size in some cases?).
533 compiler_flag: "-ffunction-sections"
534 compiler_flag: "-fdata-sections"
535 linker_flag: "-Wl,--gc-sections"
536 }
537}
Brian Silverman0d57fc82016-01-24 21:02:53 -0500538
539toolchain {
540 abi_version: "clang_3.6"
541 abi_libc_version: "glibc_2.19"
542 builtin_sysroot: ""
543 compiler: "clang"
544 host_system_name: "roborio"
545 needsPic: true
546 supports_gold_linker: false
547 supports_incremental_linker: false
548 supports_fission: false
549 supports_interface_shared_objects: false
550 supports_normalizing_ar: true
551 supports_start_end_lib: false
552 supports_thin_archives: true
553 target_libc: "glibc_2.19"
554 target_cpu: "armhf-debian"
555 target_system_name: "arm_a15"
556 toolchain_identifier: "clang_linux_armhf"
557
558 tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" }
559 tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
560 tool_path { name: "cpp" path: "linaro_linux_gcc/clang_bin/clang" }
561 tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" }
562 tool_path { name: "gcc" path: "linaro_linux_gcc/clang_bin/clang" }
563 tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
564 # C(++) compiles invoke the compiler (as that is the one knowing where
565 # to find libraries), but we provide LD so other rules can invoke the linker.
566 tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" }
567 tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" }
568 tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" }
569 objcopy_embed_flag: "-I"
570 objcopy_embed_flag: "binary"
571 tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" }
572 tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" }
Brian Silverman6d350402016-03-05 01:15:46 -0500573 linking_mode_flags { mode: DYNAMIC }
Brian Silverman0d57fc82016-01-24 21:02:53 -0500574
575 compiler_flag: "-target"
576 compiler_flag: "armv7a-arm-linux-gnueabif"
Austin Schuh61660832016-03-04 21:56:39 -0800577 compiler_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500578 compiler_flag: "-mfloat-abi=hard"
579 compiler_flag: "-mfpu=vfpv3-d16"
580
581 compiler_flag: "-nostdinc"
582 compiler_flag: "-isystem"
583 compiler_flag: "/usr/lib/clang/3.6/include"
584 compiler_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800585 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500586 compiler_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800587 compiler_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/include"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500588 compiler_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800589 compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500590 cxx_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800591 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500592 cxx_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800593 cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500594 cxx_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800595 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3/arm-linux-gnueabihf"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500596 cxx_flag: "-isystem"
Austin Schuh61660832016-03-04 21:56:39 -0800597 cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500598
Austin Schuh61660832016-03-04 21:56:39 -0800599 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%"
600 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/include)%"
601 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/lib/include)%"
602 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)%"
603 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%/c++/4.9.3"
604 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
605 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)%"
606 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include)%"
607 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%"
608 cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/include)%/c++/4.9.3"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500609 cxx_builtin_include_directory: '/usr/lib/clang/3.6/include'
610
611 linker_flag: "-target"
612 linker_flag: "armv7a-arm-linux-gnueabif"
Austin Schuh61660832016-03-04 21:56:39 -0800613 linker_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500614 linker_flag: "-lstdc++"
615 linker_flag: "-Ltools/cpp/linaro_linux_gcc/clang_more_libs"
Austin Schuh61660832016-03-04 21:56:39 -0800616 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/lib"
617 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/lib"
618 linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/lib"
619 linker_flag: "-Bexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/bin"
Brian Silverman0d57fc82016-01-24 21:02:53 -0500620 linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3"
621
622 feature {
623 name: "opt"
624 implies: "all_modes"
625 flag_set {
626 action: "preprocess-assemble"
627 action: "c-compile"
628 action: "c++-compile"
629 action: "c++-header-parsing"
630 action: "c++-header-preprocessing"
631 action: "c++-module-compile"
632 flag_group {
633 flag: "-DAOS_DEBUG=0"
634 }
635 }
636 }
637
638 feature {
639 name: "dbg"
640 implies: "all_modes"
641 flag_set {
642 action: "preprocess-assemble"
643 action: "c-compile"
644 action: "c++-compile"
645 action: "c++-header-parsing"
646 action: "c++-header-preprocessing"
647 action: "c++-module-compile"
648 flag_group {
649 flag: "-DAOS_DEBUG=1"
650 }
651 flag_group {
652 flag: "-fno-omit-frame-pointer"
653 }
654 }
655 }
656
657 feature {
658 name: "fastbuild"
659 implies: "all_modes"
660 flag_set {
661 action: "preprocess-assemble"
662 action: "c-compile"
663 action: "c++-compile"
664 action: "c++-header-parsing"
665 action: "c++-header-preprocessing"
666 action: "c++-module-compile"
667 flag_group {
668 flag: "-DAOS_DEBUG=0"
669 }
670 }
671 }
672
673 feature {
674 name: "all_modes"
675 flag_set {
676 action: "preprocess-assemble"
677 action: "assemble"
678 action: "c-compile"
679 flag_group {
680 flag: "-std=gnu99"
681 }
682 }
683 flag_set {
684 action: "c++-compile"
685 action: "c++-header-parsing"
686 action: "c++-header-preprocessing"
687 action: "c++-module-compile"
688 flag_group {
689 flag: "-std=gnu++1y"
690 }
691 }
692 flag_set {
693 action: "preprocess-assemble"
694 action: "assemble"
695 action: "c++-link"
696 action: "c++-compile"
697 action: "c++-header-parsing"
698 action: "c++-header-preprocessing"
699 action: "c++-module-compile"
700 action: "c-compile"
701 flag_group {
702 # We always want to compile with -pthread semantics.
703 flag: "-pthread"
704 }
705 }
706 }
707
708 # Anticipated future default.
709 # This makes GCC and Clang do what we want when called through symlinks.
710 unfiltered_cxx_flag: "-no-canonical-prefixes"
711 linker_flag: "-no-canonical-prefixes"
712
713 # Things that the code wants defined.
714 compiler_flag: "-D__STDC_FORMAT_MACROS"
715 compiler_flag: "-D__STDC_CONSTANT_MACROS"
716 compiler_flag: "-D__STDC_LIMIT_MACROS"
717 compiler_flag: "-D_FILE_OFFSET_BITS=64"
718 # TODO(Brian): Rename this or something.
719 compiler_flag: "-DAOS_ARCHITECTURE_armhf"
720
721 # Make C++ compilation deterministic. Use linkstamping instead of these
722 # compiler symbols.
723 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
724 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
725 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
726 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
727
728 # Security hardening on by default.
729 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
730 # We need to undef it before redefining it as some distributions now have
731 # it enabled by default.
732 compiler_flag: "-U_FORTIFY_SOURCE"
733 compiler_flag: "-fstack-protector"
734 compiler_flag: "-fPIE"
735 linker_flag: "-pie"
736 linker_flag: "-Wl,-z,relro,-z,now"
737
738 # Pretty much everything needs this, including parts of the glibc STL...
739 linker_flag: "-lm"
740
741 # Enable coloring even if there's no attached terminal. Bazel removes the
742 # escape sequences if --nocolor is specified.
743 compiler_flag: "-fdiagnostics-color=always"
744
745 compiler_flag: "-Wall"
746 compiler_flag: "-Wextra"
747 compiler_flag: "-Wswitch-enum"
748 compiler_flag: "-Wpointer-arith"
749 compiler_flag: "-Wstrict-aliasing"
750 compiler_flag: "-Wcast-qual"
751 compiler_flag: "-Wcast-align"
752 compiler_flag: "-Wwrite-strings"
753 compiler_flag: "-Wtype-limits"
754 compiler_flag: "-Wsign-compare"
755 compiler_flag: "-Wformat=2"
756 compiler_flag: "-Werror"
757 compiler_flag: "-Wunused-local-typedefs"
758
759 # Keep stack frames for debugging, even in opt mode.
760 compiler_flag: "-fno-omit-frame-pointer"
761
762 # Don't use temp files while compiling.
763 compiler_flag: "-pipe"
764
765 # Stamp the binary with a unique identifier.
766 linker_flag: "-Wl,--build-id=md5"
767 linker_flag: "-Wl,--hash-style=gnu"
768 #linker_flag: "-Wl,--warn-execstack"
769 #linker_flag: "-Wl,--detect-odr-violations"
770
771 # Enable debug symbols.
772 compiler_flag: "-ggdb3"
773
774 compilation_mode_flags {
775 mode: OPT
776
777 compiler_flag: "-O2"
778
779 # Disable assertions
780 compiler_flag: "-DNDEBUG"
781 compiler_flag: "-D_FORTIFY_SOURCE=1"
782
783 # Removal of unused code and data at link time (can this increase binary size in some cases?).
784 compiler_flag: "-ffunction-sections"
785 compiler_flag: "-fdata-sections"
786 linker_flag: "-Wl,--gc-sections"
787 }
788}
Brian Silverman8b638692017-06-26 23:10:26 -0700789
790toolchain {
791 abi_version: "cortex-m4f"
792 abi_libc_version: "cortex-m4f"
793 builtin_sysroot: ""
794 compiler: "gcc"
795 host_system_name: "local"
796 needsPic: false
797 supports_gold_linker: false
798 supports_incremental_linker: false
799 supports_fission: false
800 supports_interface_shared_objects: false
801 supports_normalizing_ar: false
802 supports_start_end_lib: false
803 supports_thin_archives: false
804 target_libc: "cortex-m4f"
805 target_cpu: "cortex-m4f"
806 target_system_name: "cortex-m4f"
807 toolchain_identifier: "cortex-m4f"
808
809 tool_path { name: "ar" path: "/usr/bin/arm-none-eabi-ar" }
810 tool_path { name: "compat-ld" path: "/usr/bin/arm-none-eabi-ld" }
811 tool_path { name: "cpp" path: "/usr/bin/arm-none-eabi-cpp" }
812 tool_path { name: "dwp" path: "/usr/bin/arm-none-eabi-dwp" }
813 tool_path { name: "gcc" path: "/usr/bin/arm-none-eabi-gcc" }
814 tool_path { name: "gcov" path: "/usr/bin/arm-none-eabi-gcov" }
815 # C(++) compiles invoke the compiler (as that is the one knowing where
816 # to find libraries), but we provide LD so other rules can invoke the linker.
817 tool_path { name: "ld" path: "/usr/bin/arm-none-eabi-ld" }
818 tool_path { name: "nm" path: "/usr/bin/arm-none-eabi-nm" }
819 tool_path { name: "objcopy" path: "/usr/bin/arm-none-eabi-objcopy" }
820 objcopy_embed_flag: "-I"
821 objcopy_embed_flag: "binary"
822 tool_path { name: "objdump" path: "/usr/bin/arm-none-eabi-objdump" }
823 tool_path { name: "strip" path: "/usr/bin/arm-none-eabi-strip" }
824 linking_mode_flags { mode: FULLY_STATIC }
825
826 # TODO(bazel-team): In theory, the path here ought to exactly match the path
827 # used by gcc. That works because bazel currently doesn't track files at
828 # absolute locations and has no remote execution, yet. However, this will need
829 # to be fixed, maybe with auto-detection?
830 cxx_builtin_include_directory: '/usr/lib/gcc/arm-none-eabi/4.8/include'
831 cxx_builtin_include_directory: '/usr/lib/gcc/arm-none-eabi/4.8/include-fixed'
832 cxx_builtin_include_directory: '/usr/lib/arm-none-eabi/include'
833 cxx_builtin_include_directory: '/usr/include/newlib',
834
835 feature {
836 name: "dbg"
837 implies: "all_modes"
838 flag_set {
839 action: "preprocess-assemble"
840 action: "c-compile"
841 action: "c++-compile"
842 action: "c++-header-parsing"
843 action: "c++-header-preprocessing"
844 action: "c++-module-compile"
845 flag_group {
846 flag: "-fno-omit-frame-pointer"
847 }
848 }
849 }
850
851 feature {
852 name: "opt"
853 implies: "all_modes"
854 }
855 feature {
856 name: "fastbuild"
857 implies: "all_modes"
858 }
859
860 feature {
861 name: "all_modes"
862 flag_set {
863 action: "preprocess-assemble"
864 action: "assemble"
865 action: "c-compile"
866 flag_group {
867 flag: "--std=gnu99"
868 }
869 }
870 flag_set {
871 action: "c++-compile"
872 action: "c++-header-parsing"
873 action: "c++-header-preprocessing"
874 action: "c++-module-compile"
875 flag_group {
876 flag: "--std=gnu++11"
877 flag: "-fno-exceptions"
878 flag: "-fno-rtti"
879 }
880 }
881 }
882
883 # Anticipated future default.
884 # This makes GCC and Clang do what we want when called through symlinks.
885 unfiltered_cxx_flag: "-no-canonical-prefixes"
886 linker_flag: "-no-canonical-prefixes"
887
888 # Things that the code wants defined.
889 compiler_flag: "-D__STDC_FORMAT_MACROS"
890 compiler_flag: "-D__STDC_CONSTANT_MACROS"
891 compiler_flag: "-D__STDC_LIMIT_MACROS"
892 compiler_flag: "-D__MK64FX512__"
893 compiler_flag: "-DF_CPU=120000000"
894 compiler_flag: "-Wl,--gc-sections"
895
896 # Make C++ compilation deterministic. Use linkstamping instead of these
897 # compiler symbols.
898 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
899 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
900 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
901 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
902
903 # Security hardening on by default.
904 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
905 # We need to undef it before redefining it as some distributions now have
906 # it enabled by default.
907 compiler_flag: "-fstack-protector"
908 compiler_flag: "-mcpu=cortex-m4"
909 compiler_flag: "-mfpu=fpv4-sp-d16"
910 compiler_flag: "-mthumb"
911 compiler_flag: "-mfloat-abi=hard"
912 compiler_flag: "-fno-strict-aliasing"
913 linker_flag: "-mcpu=cortex-m4"
914 linker_flag: "-mfpu=fpv4-sp-d16"
915 linker_flag: "-mthumb"
916 linker_flag: "-mfloat-abi=hard"
917 linker_flag: "-fno-strict-aliasing"
918 linker_flag: "--specs=nano.specs"
919
920 # Pretty much everything needs this, including parts of the glibc STL...
921 linker_flag: "-lgcc"
922 linker_flag: "-lstdc++"
923 linker_flag: "-lm"
924 linker_flag: "-lc"
925 linker_flag: "-Tmotors/core/mk64fx512.ld"
926
927 compiler_flag: "-fmessage-length=80"
928
929 compiler_flag: "-Wall"
930 compiler_flag: "-Wextra"
931 compiler_flag: "-Wswitch-enum"
932 compiler_flag: "-Wpointer-arith"
933 compiler_flag: "-Wcast-qual"
934 compiler_flag: "-Wwrite-strings"
935 compiler_flag: "-Wtype-limits"
936 compiler_flag: "-Wsign-compare"
937 compiler_flag: "-Wformat=2"
938 compiler_flag: "-Werror"
939 compiler_flag: "-Wstrict-aliasing=2"
940
941 # Be annoying about using doubles places we probably didn't mean to, because
942 # the FPU only does single-precision.
943 compiler_flag: "-Wdouble-promotion"
944
945 # Don't use temp files while compiling.
946 compiler_flag: "-pipe"
947
948 # Stamp the binary with a unique identifier.
949 # TODO(austin): Put these back in.
950 #linker_flag: "-Wl,--build-id=md5"
951 #linker_flag: "-Wl,--hash-style=gnu"
952
953 # Enable debug symbols.
954 compiler_flag: "-g"
955
956 # Commons symbols are weird and not what we want, so just give multiple
957 # declaration errors instead.
958 compiler_flag: "-fno-common"
959
960 compilation_mode_flags {
961 mode: OPT
962
963 # Freescale recommends this combination for reducing cycle count.
964 # http://www.nxp.com/assets/documents/data/en/application-notes/AN4808.pdf
965 compiler_flag: "-O2"
966 compiler_flag: "-finline-functions"
967
968 # This is definitely worth it for us. It makes the FPU a lot more useful,
969 # especially with complex arithmetic, which matters a lot.
970 compiler_flag: "-ffast-math"
971
972 # It seems like this is a good idea, at least for the number crunching code.
973 # Might want to look into moving it to copts on specific rules if the code
974 # size increase becomes a problem.
975 compiler_flag: "-funroll-loops"
976
977 # Disable assertions
978 compiler_flag: "-DNDEBUG"
979
980 # Removal of unused code and data at link time (can this increase binary size in some cases?).
981 compiler_flag: "-ffunction-sections"
982 #compiler_flag: "-fdata-sections"
983 linker_flag: "-Wl,--gc-sections"
984 }
985
986 feature {
987 name: 'include_paths'
988 flag_set {
989 action: 'preprocess-assemble'
990 action: 'c-compile'
991 action: 'c++-compile'
992 action: 'c++-header-parsing'
993 action: 'c++-header-preprocessing'
994 action: 'c++-module-compile'
995 flag_group {
996 flag: '-iquote'
997 flag: '%{quote_include_paths}'
998 }
999 flag_group {
1000 flag: '-I%{include_paths}'
1001 }
1002 flag_group {
1003 flag: '-iquote'
1004 flag: '%{system_include_paths}'
1005 }
1006 }
1007 }
1008}