blob: bfe3e80aff1744280a7f3448d9b477ba729f212b [file] [log] [blame]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01001major_version: "local"
2minor_version: ""
Damien Martin-Guillereze1349ec2015-03-12 11:00:44 +00003default_target_cpu: "same_as_host"
Philipp Wollermann19f34132015-06-12 08:39:25 +00004
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01005default_toolchain {
6 cpu: "k8"
7 toolchain_identifier: "local_linux"
8}
9default_toolchain {
Philipp Wollermann19f34132015-06-12 08:39:25 +000010 cpu: "piii"
11 toolchain_identifier: "local_linux"
12}
13default_toolchain {
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010014 cpu: "darwin"
15 toolchain_identifier: "local_darwin"
16}
Lukacs Berkia93c63b2015-07-29 15:32:19 +000017default_toolchain {
Doug Rabson709bc612015-08-25 14:12:00 +000018 cpu: "freebsd"
19 toolchain_identifier: "local_freebsd"
20}
21default_toolchain {
Lukacs Berkia93c63b2015-07-29 15:32:19 +000022 cpu: "armeabi-v7a"
23 toolchain_identifier: "stub_armeabi-v7a"
24}
Zhong Wang8c288132015-08-12 15:06:08 +000025default_toolchain {
26 cpu: "arm"
27 toolchain_identifier: "local_linux"
28}
Dmitry Lomov458ccd02016-02-02 20:30:32 +000029default_toolchain {
30 cpu: "x64_windows"
31 toolchain_identifier: "local_windows_msys64"
32}
Yun Peng114ead32016-04-07 16:39:19 +000033default_toolchain {
34 cpu: "x64_windows_msvc"
35 toolchain_identifier: "vc_14_0_x64"
36}
namrata-ibm155bd642016-10-11 09:59:27 +000037default_toolchain {
38 cpu: "s390x"
39 toolchain_identifier: "local_linux"
40}
Zhong Wang8c288132015-08-12 15:06:08 +000041
Nishidha Panpaliyaaaee64e2016-12-20 18:19:43 +000042default_toolchain {
43 cpu: "ppc"
44 toolchain_identifier: "local_linux"
45}
Cal Peyser1b6535c2016-12-22 21:27:24 +000046
47default_toolchain {
48 cpu: "ios_x86_64"
49 toolchain_identifier: "ios_x86_64"
50}
51
Zhong Wang8c288132015-08-12 15:06:08 +000052toolchain {
Lukacs Berkia93c63b2015-07-29 15:32:19 +000053 abi_version: "armeabi-v7a"
54 abi_libc_version: "armeabi-v7a"
55 builtin_sysroot: ""
56 compiler: "compiler"
57 host_system_name: "armeabi-v7a"
58 needsPic: true
59 supports_gold_linker: false
60 supports_incremental_linker: false
61 supports_fission: false
62 supports_interface_shared_objects: false
63 supports_normalizing_ar: false
64 supports_start_end_lib: false
Lukacs Berkia93c63b2015-07-29 15:32:19 +000065 target_libc: "armeabi-v7a"
66 target_cpu: "armeabi-v7a"
67 target_system_name: "armeabi-v7a"
68 toolchain_identifier: "stub_armeabi-v7a"
69
70 tool_path { name: "ar" path: "/bin/false" }
71 tool_path { name: "compat-ld" path: "/bin/false" }
72 tool_path { name: "cpp" path: "/bin/false" }
73 tool_path { name: "dwp" path: "/bin/false" }
74 tool_path { name: "gcc" path: "/bin/false" }
75 tool_path { name: "gcov" path: "/bin/false" }
76 tool_path { name: "ld" path: "/bin/false" }
77
78 tool_path { name: "nm" path: "/bin/false" }
79 tool_path { name: "objcopy" path: "/bin/false" }
80 tool_path { name: "objdump" path: "/bin/false" }
81 tool_path { name: "strip" path: "/bin/false" }
Googler3dd9cc62016-02-08 16:00:09 +000082 linking_mode_flags { mode: DYNAMIC }
Lukacs Berkia93c63b2015-07-29 15:32:19 +000083}
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010084
85toolchain {
86 abi_version: "local"
87 abi_libc_version: "local"
88 builtin_sysroot: ""
89 compiler: "compiler"
90 host_system_name: "local"
91 needsPic: true
92 supports_gold_linker: false
93 supports_incremental_linker: false
94 supports_fission: false
95 supports_interface_shared_objects: false
96 supports_normalizing_ar: false
97 supports_start_end_lib: false
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010098 target_libc: "local"
99 target_cpu: "local"
100 target_system_name: "local"
101 toolchain_identifier: "local_linux"
102
103 tool_path { name: "ar" path: "/usr/bin/ar" }
104 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
105 tool_path { name: "cpp" path: "/usr/bin/cpp" }
106 tool_path { name: "dwp" path: "/usr/bin/dwp" }
107 tool_path { name: "gcc" path: "/usr/bin/gcc" }
108 cxx_flag: "-std=c++0x"
109 linker_flag: "-lstdc++"
Han-Wen Nienhuys4988a6d2015-04-08 13:36:58 +0000110 linker_flag: "-B/usr/bin/"
111
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100112 # TODO(bazel-team): In theory, the path here ought to exactly match the path
113 # used by gcc. That works because bazel currently doesn't track files at
114 # absolute locations and has no remote execution, yet. However, this will need
115 # to be fixed, maybe with auto-detection?
116 cxx_builtin_include_directory: "/usr/lib/gcc/"
117 cxx_builtin_include_directory: "/usr/local/include"
118 cxx_builtin_include_directory: "/usr/include"
119 tool_path { name: "gcov" path: "/usr/bin/gcov" }
Han-Wen Nienhuys15f1f862015-06-09 06:19:25 +0000120
121 # C(++) compiles invoke the compiler (as that is the one knowing where
122 # to find libraries), but we provide LD so other rules can invoke the linker.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100123 tool_path { name: "ld" path: "/usr/bin/ld" }
Han-Wen Nienhuys15f1f862015-06-09 06:19:25 +0000124
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100125 tool_path { name: "nm" path: "/usr/bin/nm" }
126 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
127 objcopy_embed_flag: "-I"
128 objcopy_embed_flag: "binary"
129 tool_path { name: "objdump" path: "/usr/bin/objdump" }
130 tool_path { name: "strip" path: "/usr/bin/strip" }
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000131
132 # Anticipated future default.
133 unfiltered_cxx_flag: "-no-canonical-prefixes"
Lukacs Berki763f1392016-01-07 09:29:08 +0000134 unfiltered_cxx_flag: "-fno-canonical-system-headers"
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000135
136 # Make C++ compilation deterministic. Use linkstamping instead of these
137 # compiler symbols.
138 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
139 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
140 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
141 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
142
143 # Security hardening on by default.
144 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
145 # We need to undef it before redefining it as some distributions now have
146 # it enabled by default.
147 compiler_flag: "-U_FORTIFY_SOURCE"
148 compiler_flag: "-D_FORTIFY_SOURCE=1"
149 compiler_flag: "-fstack-protector"
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000150 linker_flag: "-Wl,-z,relro,-z,now"
151
152 # Enable coloring even if there's no attached terminal. Bazel removes the
153 # escape sequences if --nocolor is specified. This isn't supported by gcc
154 # on Ubuntu 14.04.
155 # compiler_flag: "-fcolor-diagnostics"
156
157 # All warnings are enabled. Maybe enable -Werror as well?
158 compiler_flag: "-Wall"
159 # Enable a few more warnings that aren't part of -Wall.
160 compiler_flag: "-Wunused-but-set-parameter"
161 # But disable some that are problematic.
162 compiler_flag: "-Wno-free-nonheap-object" # has false positives
163
164 # Keep stack frames for debugging, even in opt mode.
165 compiler_flag: "-fno-omit-frame-pointer"
166
167 # Anticipated future default.
168 linker_flag: "-no-canonical-prefixes"
169 # Have gcc return the exit code from ld.
170 linker_flag: "-pass-exit-codes"
171 # Stamp the binary with a unique identifier.
172 linker_flag: "-Wl,--build-id=md5"
173 linker_flag: "-Wl,--hash-style=gnu"
174 # Gold linker only? Can we enable this by default?
175 # linker_flag: "-Wl,--warn-execstack"
176 # linker_flag: "-Wl,--detect-odr-violations"
177
178 compilation_mode_flags {
179 mode: DBG
180 # Enable debug symbols.
181 compiler_flag: "-g"
182 }
183 compilation_mode_flags {
184 mode: OPT
185
186 # No debug symbols.
187 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
188 # even generally? However, that can't happen here, as it requires special
189 # handling in Bazel.
190 compiler_flag: "-g0"
191
192 # Conservative choice for -O
193 # -O3 can increase binary size and even slow down the resulting binaries.
194 # Profile first and / or use FDO if you need better performance than this.
195 compiler_flag: "-O2"
196
197 # Disable assertions
198 compiler_flag: "-DNDEBUG"
199
200 # Removal of unused code and data at link time (can this increase binary size in some cases?).
201 compiler_flag: "-ffunction-sections"
202 compiler_flag: "-fdata-sections"
203 linker_flag: "-Wl,--gc-sections"
204 }
Googler3dd9cc62016-02-08 16:00:09 +0000205 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100206}
207
208toolchain {
209 abi_version: "local"
210 abi_libc_version: "local"
211 builtin_sysroot: ""
212 compiler: "compiler"
213 host_system_name: "local"
214 needsPic: true
215 target_libc: "macosx"
216 target_cpu: "darwin"
217 target_system_name: "local"
218 toolchain_identifier: "local_darwin"
219
220 tool_path { name: "ar" path: "/usr/bin/libtool" }
221 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
222 tool_path { name: "cpp" path: "/usr/bin/cpp" }
223 tool_path { name: "dwp" path: "/usr/bin/dwp" }
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +0000224 tool_path { name: "gcc" path: "osx_cc_wrapper.sh" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100225 cxx_flag: "-std=c++0x"
226 ar_flag: "-static"
227 ar_flag: "-s"
228 ar_flag: "-o"
229 linker_flag: "-lstdc++"
Damien Martin-Guillerezefd5d312015-05-15 14:05:10 +0000230 linker_flag: "-undefined"
231 linker_flag: "dynamic_lookup"
David Chenb86809e2016-05-17 08:29:50 +0000232 linker_flag: "-headerpad_max_install_names"
Ulf Adams568c3942015-10-29 12:18:42 +0000233 # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper
234 # setting from the local compiler, and also how to make incremental builds correct.
235 cxx_builtin_include_directory: "/"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100236 tool_path { name: "gcov" path: "/usr/bin/gcov" }
237 tool_path { name: "ld" path: "/usr/bin/ld" }
238 tool_path { name: "nm" path: "/usr/bin/nm" }
239 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
240 objcopy_embed_flag: "-I"
241 objcopy_embed_flag: "binary"
242 tool_path { name: "objdump" path: "/usr/bin/objdump" }
243 tool_path { name: "strip" path: "/usr/bin/strip" }
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000244
245 # Anticipated future default.
246 unfiltered_cxx_flag: "-no-canonical-prefixes"
Lukacs Berki763f1392016-01-07 09:29:08 +0000247
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000248 # Make C++ compilation deterministic. Use linkstamping instead of these
249 # compiler symbols.
250 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
251 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
252 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
253 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
254
255 # Security hardening on by default.
256 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
257 compiler_flag: "-D_FORTIFY_SOURCE=1"
258 compiler_flag: "-fstack-protector"
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000259
260 # Enable coloring even if there's no attached terminal. Bazel removes the
261 # escape sequences if --nocolor is specified.
262 compiler_flag: "-fcolor-diagnostics"
263
264 # All warnings are enabled. Maybe enable -Werror as well?
265 compiler_flag: "-Wall"
266 # Enable a few more warnings that aren't part of -Wall.
267 compiler_flag: "-Wthread-safety"
268 compiler_flag: "-Wself-assign"
269
270 # Keep stack frames for debugging, even in opt mode.
271 compiler_flag: "-fno-omit-frame-pointer"
272
273 # Anticipated future default.
274 linker_flag: "-no-canonical-prefixes"
275
276 compilation_mode_flags {
277 mode: DBG
278 # Enable debug symbols.
279 compiler_flag: "-g"
280 }
281 compilation_mode_flags {
282 mode: OPT
283 # No debug symbols.
284 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or even generally?
285 # However, that can't happen here, as it requires special handling in Bazel.
286 compiler_flag: "-g0"
287
288 # Conservative choice for -O
289 # -O3 can increase binary size and even slow down the resulting binaries.
290 # Profile first and / or use FDO if you need better performance than this.
291 compiler_flag: "-O2"
292
293 # Disable assertions
294 compiler_flag: "-DNDEBUG"
295
296 # Removal of unused code and data at link time (can this increase binary size in some cases?).
297 compiler_flag: "-ffunction-sections"
298 compiler_flag: "-fdata-sections"
299 }
Googler3dd9cc62016-02-08 16:00:09 +0000300 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100301}
302
303toolchain {
304 abi_version: "local"
305 abi_libc_version: "local"
306 builtin_sysroot: ""
Doug Rabson709bc612015-08-25 14:12:00 +0000307 compiler: "compiler"
308 host_system_name: "local"
309 needsPic: true
310 supports_gold_linker: false
311 supports_incremental_linker: false
312 supports_fission: false
313 supports_interface_shared_objects: false
314 supports_normalizing_ar: false
315 supports_start_end_lib: false
Doug Rabson709bc612015-08-25 14:12:00 +0000316 target_libc: "local"
317 target_cpu: "freebsd"
318 target_system_name: "local"
319 toolchain_identifier: "local_freebsd"
320
321 tool_path { name: "ar" path: "/usr/bin/ar" }
322 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
323 tool_path { name: "cpp" path: "/usr/bin/cpp" }
324 tool_path { name: "dwp" path: "/usr/bin/dwp" }
325 tool_path { name: "gcc" path: "/usr/bin/clang" }
326 cxx_flag: "-std=c++0x"
327 linker_flag: "-lstdc++"
328 linker_flag: "-B/usr/bin/"
329
330 # TODO(bazel-team): In theory, the path here ought to exactly match the path
331 # used by gcc. That works because bazel currently doesn't track files at
332 # absolute locations and has no remote execution, yet. However, this will need
333 # to be fixed, maybe with auto-detection?
Piotr Sikora2bb61c12016-10-21 16:00:06 +0000334 cxx_builtin_include_directory: "/usr/lib/clang"
Doug Rabson709bc612015-08-25 14:12:00 +0000335 cxx_builtin_include_directory: "/usr/local/include"
336 cxx_builtin_include_directory: "/usr/include"
337 tool_path { name: "gcov" path: "/usr/bin/gcov" }
338
339 # C(++) compiles invoke the compiler (as that is the one knowing where
340 # to find libraries), but we provide LD so other rules can invoke the linker.
341 tool_path { name: "ld" path: "/usr/bin/ld" }
342
343 tool_path { name: "nm" path: "/usr/bin/nm" }
344 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
345 objcopy_embed_flag: "-I"
346 objcopy_embed_flag: "binary"
347 tool_path { name: "objdump" path: "/usr/bin/objdump" }
348 tool_path { name: "strip" path: "/usr/bin/strip" }
349
350 # Anticipated future default.
351 unfiltered_cxx_flag: "-no-canonical-prefixes"
352
353 # Make C++ compilation deterministic. Use linkstamping instead of these
354 # compiler symbols.
355 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
356 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
357 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
358 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
359
360 # Security hardening on by default.
361 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
362 # We need to undef it before redefining it as some distributions now have
363 # it enabled by default.
364 compiler_flag: "-U_FORTIFY_SOURCE"
365 compiler_flag: "-D_FORTIFY_SOURCE=1"
366 compiler_flag: "-fstack-protector"
Doug Rabson709bc612015-08-25 14:12:00 +0000367 linker_flag: "-Wl,-z,relro,-z,now"
368
369 # Enable coloring even if there's no attached terminal. Bazel removes the
370 # escape sequences if --nocolor is specified. This isn't supported by gcc
371 # on Ubuntu 14.04.
372 # compiler_flag: "-fcolor-diagnostics"
373
374 # All warnings are enabled. Maybe enable -Werror as well?
375 compiler_flag: "-Wall"
376 # Enable a few more warnings that aren't part of -Wall.
377 #compiler_flag: "-Wunused-but-set-parameter"
378 # But disable some that are problematic.
379 #compiler_flag: "-Wno-free-nonheap-object" # has false positives
380
381 # Keep stack frames for debugging, even in opt mode.
382 compiler_flag: "-fno-omit-frame-pointer"
383
384 # Anticipated future default.
385 linker_flag: "-no-canonical-prefixes"
386 # Have gcc return the exit code from ld.
387 #linker_flag: "-pass-exit-codes"
388 # Stamp the binary with a unique identifier.
389 #linker_flag: "-Wl,--build-id=md5"
390 linker_flag: "-Wl,--hash-style=gnu"
391 # Gold linker only? Can we enable this by default?
392 # linker_flag: "-Wl,--warn-execstack"
393 # linker_flag: "-Wl,--detect-odr-violations"
394
395 compilation_mode_flags {
396 mode: DBG
397 # Enable debug symbols.
398 compiler_flag: "-g"
399 }
400 compilation_mode_flags {
401 mode: OPT
402
403 # No debug symbols.
404 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
405 # even generally? However, that can't happen here, as it requires special
406 # handling in Bazel.
407 compiler_flag: "-g0"
408
409 # Conservative choice for -O
410 # -O3 can increase binary size and even slow down the resulting binaries.
411 # Profile first and / or use FDO if you need better performance than this.
412 compiler_flag: "-O2"
413
414 # Disable assertions
415 compiler_flag: "-DNDEBUG"
416
417 # Removal of unused code and data at link time (can this increase binary size in some cases?).
418 compiler_flag: "-ffunction-sections"
419 compiler_flag: "-fdata-sections"
420 linker_flag: "-Wl,--gc-sections"
421 }
Googler3dd9cc62016-02-08 16:00:09 +0000422 linking_mode_flags { mode: DYNAMIC }
Doug Rabson709bc612015-08-25 14:12:00 +0000423}
424
425toolchain {
426 abi_version: "local"
427 abi_libc_version: "local"
428 builtin_sysroot: ""
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100429 compiler: "windows_mingw"
430 host_system_name: "local"
431 needsPic: false
432 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000433 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100434 target_system_name: "local"
435 toolchain_identifier: "local_windows_mingw"
436
437 tool_path { name: "ar" path: "C:/mingw/bin/ar" }
438 tool_path { name: "compat-ld" path: "C:/mingw/bin/ld" }
439 tool_path { name: "cpp" path: "C:/mingw/bin/cpp" }
440 tool_path { name: "dwp" path: "C:/mingw/bin/dwp" }
441 tool_path { name: "gcc" path: "C:/mingw/bin/gcc" }
442 cxx_flag: "-std=c++0x"
443 # TODO(bazel-team): In theory, the path here ought to exactly match the path
444 # used by gcc. That works because bazel currently doesn't track files at
445 # absolute locations and has no remote execution, yet. However, this will need
446 # to be fixed, maybe with auto-detection?
447 cxx_builtin_include_directory: "C:/mingw/include"
448 cxx_builtin_include_directory: "C:/mingw/lib/gcc"
449 tool_path { name: "gcov" path: "C:/mingw/bin/gcov" }
450 tool_path { name: "ld" path: "C:/mingw/bin/ld" }
451 tool_path { name: "nm" path: "C:/mingw/bin/nm" }
452 tool_path { name: "objcopy" path: "C:/mingw/bin/objcopy" }
453 objcopy_embed_flag: "-I"
454 objcopy_embed_flag: "binary"
455 tool_path { name: "objdump" path: "C:/mingw/bin/objdump" }
456 tool_path { name: "strip" path: "C:/mingw/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000457 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100458}
459
460toolchain {
461 abi_version: "local"
462 abi_libc_version: "local"
463 builtin_sysroot: ""
464 compiler: "windows_msys64_mingw64"
465 host_system_name: "local"
466 needsPic: false
467 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000468 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100469 target_system_name: "local"
470 toolchain_identifier: "local_windows_msys64_mingw64"
471
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000472 tool_path { name: "ar" path: "C:/tools/msys64/mingw64/bin/ar" }
473 tool_path { name: "compat-ld" path: "C:/tools/msys64/mingw64/bin/ld" }
474 tool_path { name: "cpp" path: "C:/tools/msys64/mingw64/bin/cpp" }
475 tool_path { name: "dwp" path: "C:/tools/msys64/mingw64/bin/dwp" }
476 tool_path { name: "gcc" path: "C:/tools/msys64/mingw64/bin/gcc" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100477 cxx_flag: "-std=c++0x"
478 # TODO(bazel-team): In theory, the path here ought to exactly match the path
479 # used by gcc. That works because bazel currently doesn't track files at
480 # absolute locations and has no remote execution, yet. However, this will need
481 # to be fixed, maybe with auto-detection?
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000482 cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include"
483 tool_path { name: "gcov" path: "C:/tools/msys64/mingw64/bin/gcov" }
484 tool_path { name: "ld" path: "C:/tools/msys64/mingw64/bin/ld" }
485 tool_path { name: "nm" path: "C:/tools/msys64/mingw64/bin/nm" }
486 tool_path { name: "objcopy" path: "C:/tools/msys64/mingw64/bin/objcopy" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100487 objcopy_embed_flag: "-I"
488 objcopy_embed_flag: "binary"
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000489 tool_path { name: "objdump" path: "C:/tools/msys64/mingw64/bin/objdump" }
490 tool_path { name: "strip" path: "C:/tools/msys64/mingw64/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000491 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100492}
493
494toolchain {
495 abi_version: "local"
496 abi_libc_version: "local"
497 builtin_sysroot: ""
498 compiler: "windows_clang"
499 host_system_name: "local"
500 needsPic: false
501 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000502 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100503 target_system_name: "local"
504 toolchain_identifier: "local_windows_clang"
505
506 tool_path { name: "ar" path: "C:/mingw/bin/ar" }
507 tool_path { name: "compat-ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
508 tool_path { name: "cpp" path: "C:/Program Files (x86)/LLVM/bin/cpp" }
509 tool_path { name: "dwp" path: "C:/Program Files (x86)/LLVM/bin/dwp" }
510 tool_path { name: "gcc" path: "C:/Program Files (x86)/LLVM/bin/clang" }
511 cxx_flag: "-std=c++0x"
512 # TODO(bazel-team): In theory, the path here ought to exactly match the path
513 # used by gcc. That works because bazel currently doesn't track files at
514 # absolute locations and has no remote execution, yet. However, this will need
515 # to be fixed, maybe with auto-detection?
516 cxx_builtin_include_directory: "/usr/lib/gcc/"
517 cxx_builtin_include_directory: "/usr/local/include"
518 cxx_builtin_include_directory: "/usr/include"
519 tool_path { name: "gcov" path: "C:/Program Files (x86)/LLVM/bin/gcov" }
520 tool_path { name: "ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
521 tool_path { name: "nm" path: "C:/Program Files (x86)/LLVM/bin/nm" }
522 tool_path { name: "objcopy" path: "C:/Program Files (x86)/LLVM/bin/objcopy" }
523 objcopy_embed_flag: "-I"
524 objcopy_embed_flag: "binary"
525 tool_path { name: "objdump" path: "C:/Program Files (x86)/LLVM/bin/objdump" }
526 tool_path { name: "strip" path: "C:/Program Files (x86)/LLVM/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000527 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100528}
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000529
530toolchain {
531 abi_version: "local"
532 abi_libc_version: "local"
533 builtin_sysroot: ""
534 compiler: "windows_msys64"
535 host_system_name: "local"
536 needsPic: false
537 target_libc: "local"
538 target_cpu: "x64_windows"
539 target_system_name: "local"
540 toolchain_identifier: "local_windows_msys64"
541
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000542 tool_path { name: "ar" path: "C:/tools/msys64/usr/bin/ar" }
543 tool_path { name: "compat-ld" path: "C:/tools/msys64/usr/bin/ld" }
544 tool_path { name: "cpp" path: "C:/tools/msys64/usr/bin/cpp" }
545 tool_path { name: "dwp" path: "C:/tools/msys64/usr/bin/dwp" }
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000546 # Use gcc instead of g++ so that C will compile correctly.
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000547 tool_path { name: "gcc" path: "C:/tools/msys64/usr/bin/gcc" }
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000548 cxx_flag: "-std=gnu++0x"
549 linker_flag: "-lstdc++"
550 # TODO(bazel-team): In theory, the path here ought to exactly match the path
551 # used by gcc. That works because bazel currently doesn't track files at
552 # absolute locations and has no remote execution, yet. However, this will need
553 # to be fixed, maybe with auto-detection?
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000554 cxx_builtin_include_directory: "C:/tools/msys64/"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000555 cxx_builtin_include_directory: "/usr/"
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000556 tool_path { name: "gcov" path: "C:/tools/msys64/usr/bin/gcov" }
557 tool_path { name: "ld" path: "C:/tools/msys64/usr/bin/ld" }
558 tool_path { name: "nm" path: "C:/tools/msys64/usr/bin/nm" }
559 tool_path { name: "objcopy" path: "C:/tools/msys64/usr/bin/objcopy" }
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000560 objcopy_embed_flag: "-I"
561 objcopy_embed_flag: "binary"
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000562 tool_path { name: "objdump" path: "C:/tools/msys64/usr/bin/objdump" }
563 tool_path { name: "strip" path: "C:/tools/msys64/usr/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000564 linking_mode_flags { mode: DYNAMIC }
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000565}
Yun Peng114ead32016-04-07 16:39:19 +0000566
567toolchain {
568 toolchain_identifier: "vc_14_0_x64"
569 host_system_name: "local"
570 target_system_name: "local"
571
572 abi_version: "local"
573 abi_libc_version: "local"
Yun Peng57be3442016-04-25 14:08:41 +0000574 target_cpu: "x64_windows_msvc"
Yun Peng114ead32016-04-07 16:39:19 +0000575 compiler: "cl"
576 target_libc: "msvcrt140"
577 default_python_version: "python2.7"
578 cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE"
Yun Penge52ebec2016-05-10 08:56:38 +0000579 cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/"
580 cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/8.1/include/"
581 cxx_builtin_include_directory: "C:/Program Files (x86)/GnuWin32/include/"
582 cxx_builtin_include_directory: "C:/python_27_amd64/files/include"
Yun Peng114ead32016-04-07 16:39:19 +0000583 tool_path {
584 name: "ar"
585 path: "wrapper/bin/msvc_link.bat"
586 }
587 tool_path {
588 name: "cpp"
589 path: "wrapper/bin/msvc_cl.bat"
590 }
591 tool_path {
592 name: "gcc"
593 path: "wrapper/bin/msvc_cl.bat"
594 }
595 tool_path {
596 name: "gcov"
597 path: "wrapper/bin/msvc_nop.bat"
598 }
599 tool_path {
600 name: "ld"
601 path: "wrapper/bin/msvc_link.bat"
602 }
603 tool_path {
604 name: "nm"
605 path: "wrapper/bin/msvc_nop.bat"
606 }
607 tool_path {
608 name: "objcopy"
609 path: "wrapper/bin/msvc_nop.bat"
610 }
611 tool_path {
612 name: "objdump"
613 path: "wrapper/bin/msvc_nop.bat"
614 }
615 tool_path {
616 name: "strip"
617 path: "wrapper/bin/msvc_nop.bat"
618 }
619 supports_gold_linker: false
Yun Peng114ead32016-04-07 16:39:19 +0000620 supports_start_end_lib: false
621 supports_interface_shared_objects: false
622 supports_incremental_linker: false
623 supports_normalizing_ar: true
624 needsPic: false
625
626 compiler_flag: "-m64"
Yun Penge52ebec2016-05-10 08:56:38 +0000627 compiler_flag: "/D__inline__=__inline"
Yun Peng114ead32016-04-07 16:39:19 +0000628 # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
629 compiler_flag: "/DOS_WINDOWS=OS_WINDOWS"
630 compiler_flag: "/DCOMPILER_MSVC"
631
632 # Don't pollute with GDI macros in windows.h.
633 compiler_flag: "/DNOGDI"
634 # Don't define min/max macros in windows.h.
635 compiler_flag: "/DNOMINMAX"
636 compiler_flag: "/DPRAGMA_SUPPORTED"
637 # Platform defines.
Yun Penge52ebec2016-05-10 08:56:38 +0000638 compiler_flag: "/D_WIN32_WINNT=0x0600"
Yun Peng114ead32016-04-07 16:39:19 +0000639 # Turn off warning messages.
640 compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
641 compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
642 compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
643 # Use math constants (M_PI, etc.) from the math library
644 compiler_flag: "/D_USE_MATH_DEFINES"
Yun Peng114ead32016-04-07 16:39:19 +0000645
646 # Useful options to have on for compilation.
647 # Suppress startup banner.
648 compiler_flag: "/nologo"
Yun Peng114ead32016-04-07 16:39:19 +0000649 # Increase the capacity of object files to 2^32 sections.
650 compiler_flag: "/bigobj"
651 # Allocate 500MB for precomputed headers.
652 compiler_flag: "/Zm500"
653 # Use unsigned char by default.
654 compiler_flag: "/J"
655 # Use function level linking.
656 compiler_flag: "/Gy"
657 # Use string pooling.
658 compiler_flag: "/GF"
659 # Warning level 3 (could possibly go to 4 in the future).
660 compiler_flag: "/W3"
661 # Catch both asynchronous (structured) and synchronous (C++) exceptions.
662 compiler_flag: "/EHsc"
663
664 # Globally disabled warnings.
665 # Don't warn about elements of array being be default initialized.
666 compiler_flag: "/wd4351"
667 # Don't warn about no matching delete found.
668 compiler_flag: "/wd4291"
669 # Don't warn about diamond inheritance patterns.
670 compiler_flag: "/wd4250"
671 # Don't warn about insecure functions (e.g. non _s functions).
672 compiler_flag: "/wd4996"
673
674 linker_flag: "-m64"
675
Yun Peng6b6ff762016-06-30 14:19:41 +0000676 feature {
677 name: 'include_paths'
678 flag_set {
679 action: 'preprocess-assemble'
680 action: 'c-compile'
681 action: 'c++-compile'
682 action: 'c++-header-parsing'
683 action: 'c++-header-preprocessing'
684 action: 'c++-module-compile'
685 flag_group {
686 flag: '/I%{quote_include_paths}'
687 }
688 flag_group {
689 flag: '/I%{include_paths}'
690 }
691 flag_group {
692 flag: '/I%{system_include_paths}'
693 }
694 }
695 }
696
697 feature {
698 name: 'dependency_file'
699 flag_set {
700 action: 'assemble'
701 action: 'preprocess-assemble'
702 action: 'c-compile'
703 action: 'c++-compile'
704 action: 'c++-module-compile'
705 action: 'c++-header-preprocessing'
706 action: 'c++-header-parsing'
707 expand_if_all_available: 'dependency_file'
708 flag_group {
709 flag: '/DEPENDENCY_FILE'
710 flag: '%{dependency_file}'
711 }
712 }
713 }
714
715 # Stop passing -frandom-seed option
716 feature {
717 name: 'random_seed'
718 }
719
720 # This feature is just for enabling flag_set in action_config for -c and -o options during the transitional period
721 feature {
722 name: 'compile_action_flags_in_flag_set'
723 }
724
725 action_config {
726 config_name: 'c-compile'
727 action_name: 'c-compile'
728 tool {
729 tool_path: 'wrapper/bin/msvc_cl.bat'
730 }
731 flag_set {
732 flag_group {
733 flag: '/c'
734 flag: '%{source_file}'
735 }
736 }
737 flag_set {
738 expand_if_all_available: 'output_object_file'
739 flag_group {
740 flag: '/Fo%{output_object_file}'
741 }
742 }
743 flag_set {
744 expand_if_all_available: 'output_assembly_file'
745 flag_group {
746 flag: '/Fa%{output_assembly_file}'
747 }
748 }
749 flag_set {
750 expand_if_all_available: 'output_preprocess_file'
751 flag_group {
752 flag: '/P'
753 flag: '/Fi%{output_preprocess_file}'
754 }
755 }
756 }
757
758 action_config {
759 config_name: 'c++-compile'
760 action_name: 'c++-compile'
761 tool {
762 tool_path: 'wrapper/bin/msvc_cl.bat'
763 }
764 flag_set {
765 flag_group {
766 flag: '/c'
767 flag: '%{source_file}'
768 }
769 }
770 flag_set {
771 expand_if_all_available: 'output_object_file'
772 flag_group {
773 flag: '/Fo%{output_object_file}'
774 }
775 }
776 flag_set {
777 expand_if_all_available: 'output_assembly_file'
778 flag_group {
779 flag: '/Fa%{output_assembly_file}'
780 }
781 }
782 flag_set {
783 expand_if_all_available: 'output_preprocess_file'
784 flag_group {
785 flag: '/P'
786 flag: '/Fi%{output_preprocess_file}'
787 }
788 }
789 }
790
Yun Peng114ead32016-04-07 16:39:19 +0000791 compilation_mode_flags {
792 mode: DBG
793 compiler_flag: "/DDEBUG=1"
794 # This will signal the wrapper that we are doing a debug build, which sets
795 # some internal state of the toolchain wrapper. It is intentionally a "-"
796 # flag to make this very obvious.
797 compiler_flag: "-g"
798 compiler_flag: "/Od"
799 compiler_flag: "-Xcompilation-mode=dbg"
800 }
801
802 compilation_mode_flags {
803 mode: FASTBUILD
804 compiler_flag: "/DNDEBUG"
805 compiler_flag: "/Od"
806 compiler_flag: "-Xcompilation-mode=fastbuild"
807 }
808
809 compilation_mode_flags {
810 mode: OPT
811 compiler_flag: "/DNDEBUG"
812 compiler_flag: "/O2"
813 compiler_flag: "-Xcompilation-mode=opt"
814 }
815}
Cal Peyser1b6535c2016-12-22 21:27:24 +0000816
817# Stub crosstool to allow construction of apple crosstool configuration in a
818# static configuration set.
819# TODO(b/33804121): Remove this once dynamic configurations are in place.
820toolchain {
821 toolchain_identifier: "ios_x86_64"
822 host_system_name: "x86_64-apple-macosx"
823 target_system_name: "x86_64-apple-ios"
824 target_cpu: "ios_x86_64"
825 target_libc: "ios"
826 compiler: "compiler"
827 abi_version: "local"
828 abi_libc_version: "local"
829 supports_gold_linker: false
830 supports_incremental_linker: false
831 supports_fission: false
832 supports_interface_shared_objects: false
833 supports_normalizing_ar: false
834 supports_start_end_lib: false
835
836 tool_path { name: "ar" path: "/bin/false" }
837 tool_path { name: "compat-ld" path: "/bin/false" }
838 tool_path { name: "cpp" path: "/bin/false" }
839 tool_path { name: "dwp" path: "/bin/false" }
840 tool_path { name: "gcc" path: "/bin/false" }
841 tool_path { name: "gcov" path: "/bin/false" }
842 tool_path { name: "ld" path: "/bin/false" }
843
844 tool_path { name: "nm" path: "/bin/false" }
845 tool_path { name: "objcopy" path: "/bin/false" }
846 tool_path { name: "objdump" path: "/bin/false" }
847 tool_path { name: "strip" path: "/bin/false" }
848 linking_mode_flags { mode: DYNAMIC }
849}