blob: 1eef9de16385b9a385f1fa9f5fa4062665842a2c [file] [log] [blame]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01001major_version: "local"
2minor_version: ""
davideleoni90033aa6c2017-05-15 15:16:04 +02003
Zhong Wang8c288132015-08-12 15:06:08 +00004toolchain {
Lukacs Berkia93c63b2015-07-29 15:32:19 +00005 abi_version: "armeabi-v7a"
6 abi_libc_version: "armeabi-v7a"
7 builtin_sysroot: ""
8 compiler: "compiler"
9 host_system_name: "armeabi-v7a"
10 needsPic: true
Lukacs Berkia93c63b2015-07-29 15:32:19 +000011 supports_incremental_linker: false
12 supports_fission: false
13 supports_interface_shared_objects: false
14 supports_normalizing_ar: false
15 supports_start_end_lib: false
Lukacs Berkia93c63b2015-07-29 15:32:19 +000016 target_libc: "armeabi-v7a"
17 target_cpu: "armeabi-v7a"
18 target_system_name: "armeabi-v7a"
19 toolchain_identifier: "stub_armeabi-v7a"
20
21 tool_path { name: "ar" path: "/bin/false" }
22 tool_path { name: "compat-ld" path: "/bin/false" }
23 tool_path { name: "cpp" path: "/bin/false" }
24 tool_path { name: "dwp" path: "/bin/false" }
25 tool_path { name: "gcc" path: "/bin/false" }
26 tool_path { name: "gcov" path: "/bin/false" }
27 tool_path { name: "ld" path: "/bin/false" }
28
29 tool_path { name: "nm" path: "/bin/false" }
30 tool_path { name: "objcopy" path: "/bin/false" }
31 tool_path { name: "objdump" path: "/bin/false" }
32 tool_path { name: "strip" path: "/bin/false" }
Googler3dd9cc62016-02-08 16:00:09 +000033 linking_mode_flags { mode: DYNAMIC }
Lukacs Berkia93c63b2015-07-29 15:32:19 +000034}
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010035
36toolchain {
37 abi_version: "local"
38 abi_libc_version: "local"
39 builtin_sysroot: ""
40 compiler: "compiler"
41 host_system_name: "local"
42 needsPic: true
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010043 supports_incremental_linker: false
44 supports_fission: false
45 supports_interface_shared_objects: false
46 supports_normalizing_ar: false
47 supports_start_end_lib: false
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010048 target_libc: "local"
49 target_cpu: "local"
50 target_system_name: "local"
51 toolchain_identifier: "local_linux"
52
53 tool_path { name: "ar" path: "/usr/bin/ar" }
54 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
55 tool_path { name: "cpp" path: "/usr/bin/cpp" }
56 tool_path { name: "dwp" path: "/usr/bin/dwp" }
57 tool_path { name: "gcc" path: "/usr/bin/gcc" }
58 cxx_flag: "-std=c++0x"
59 linker_flag: "-lstdc++"
Han-Wen Nienhuys4988a6d2015-04-08 13:36:58 +000060
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010061 # TODO(bazel-team): In theory, the path here ought to exactly match the path
62 # used by gcc. That works because bazel currently doesn't track files at
63 # absolute locations and has no remote execution, yet. However, this will need
64 # to be fixed, maybe with auto-detection?
65 cxx_builtin_include_directory: "/usr/lib/gcc/"
66 cxx_builtin_include_directory: "/usr/local/include"
67 cxx_builtin_include_directory: "/usr/include"
68 tool_path { name: "gcov" path: "/usr/bin/gcov" }
Han-Wen Nienhuys15f1f862015-06-09 06:19:25 +000069
70 # C(++) compiles invoke the compiler (as that is the one knowing where
71 # to find libraries), but we provide LD so other rules can invoke the linker.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010072 tool_path { name: "ld" path: "/usr/bin/ld" }
Han-Wen Nienhuys15f1f862015-06-09 06:19:25 +000073
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010074 tool_path { name: "nm" path: "/usr/bin/nm" }
75 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
76 objcopy_embed_flag: "-I"
77 objcopy_embed_flag: "binary"
78 tool_path { name: "objdump" path: "/usr/bin/objdump" }
79 tool_path { name: "strip" path: "/usr/bin/strip" }
Ulf Adamsee8fcd32015-07-17 07:52:42 +000080
81 # Anticipated future default.
82 unfiltered_cxx_flag: "-no-canonical-prefixes"
Lukacs Berki763f1392016-01-07 09:29:08 +000083 unfiltered_cxx_flag: "-fno-canonical-system-headers"
Ulf Adamsee8fcd32015-07-17 07:52:42 +000084
85 # Make C++ compilation deterministic. Use linkstamping instead of these
86 # compiler symbols.
87 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
88 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
89 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
90 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
91
92 # Security hardening on by default.
93 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
94 # We need to undef it before redefining it as some distributions now have
95 # it enabled by default.
96 compiler_flag: "-U_FORTIFY_SOURCE"
97 compiler_flag: "-D_FORTIFY_SOURCE=1"
98 compiler_flag: "-fstack-protector"
Ulf Adamsee8fcd32015-07-17 07:52:42 +000099 linker_flag: "-Wl,-z,relro,-z,now"
100
101 # Enable coloring even if there's no attached terminal. Bazel removes the
102 # escape sequences if --nocolor is specified. This isn't supported by gcc
103 # on Ubuntu 14.04.
104 # compiler_flag: "-fcolor-diagnostics"
105
106 # All warnings are enabled. Maybe enable -Werror as well?
107 compiler_flag: "-Wall"
108 # Enable a few more warnings that aren't part of -Wall.
109 compiler_flag: "-Wunused-but-set-parameter"
110 # But disable some that are problematic.
111 compiler_flag: "-Wno-free-nonheap-object" # has false positives
112
113 # Keep stack frames for debugging, even in opt mode.
114 compiler_flag: "-fno-omit-frame-pointer"
115
116 # Anticipated future default.
117 linker_flag: "-no-canonical-prefixes"
118 # Have gcc return the exit code from ld.
119 linker_flag: "-pass-exit-codes"
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000120 # Gold linker only? Can we enable this by default?
121 # linker_flag: "-Wl,--warn-execstack"
122 # linker_flag: "-Wl,--detect-odr-violations"
123
124 compilation_mode_flags {
125 mode: DBG
126 # Enable debug symbols.
127 compiler_flag: "-g"
128 }
129 compilation_mode_flags {
130 mode: OPT
131
132 # No debug symbols.
133 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
134 # even generally? However, that can't happen here, as it requires special
135 # handling in Bazel.
136 compiler_flag: "-g0"
137
138 # Conservative choice for -O
139 # -O3 can increase binary size and even slow down the resulting binaries.
140 # Profile first and / or use FDO if you need better performance than this.
141 compiler_flag: "-O2"
142
143 # Disable assertions
144 compiler_flag: "-DNDEBUG"
145
146 # Removal of unused code and data at link time (can this increase binary size in some cases?).
147 compiler_flag: "-ffunction-sections"
148 compiler_flag: "-fdata-sections"
149 linker_flag: "-Wl,--gc-sections"
150 }
Googler3dd9cc62016-02-08 16:00:09 +0000151 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100152}
153
154toolchain {
155 abi_version: "local"
156 abi_libc_version: "local"
157 builtin_sysroot: ""
158 compiler: "compiler"
159 host_system_name: "local"
160 needsPic: true
161 target_libc: "macosx"
162 target_cpu: "darwin"
163 target_system_name: "local"
164 toolchain_identifier: "local_darwin"
165
166 tool_path { name: "ar" path: "/usr/bin/libtool" }
167 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
168 tool_path { name: "cpp" path: "/usr/bin/cpp" }
169 tool_path { name: "dwp" path: "/usr/bin/dwp" }
Damien Martin-Guillerez8fa5ae62016-03-02 16:24:13 +0000170 tool_path { name: "gcc" path: "osx_cc_wrapper.sh" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100171 cxx_flag: "-std=c++0x"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100172 linker_flag: "-lstdc++"
Damien Martin-Guillerezefd5d312015-05-15 14:05:10 +0000173 linker_flag: "-undefined"
174 linker_flag: "dynamic_lookup"
David Chenb86809e2016-05-17 08:29:50 +0000175 linker_flag: "-headerpad_max_install_names"
Ulf Adams568c3942015-10-29 12:18:42 +0000176 # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper
177 # setting from the local compiler, and also how to make incremental builds correct.
178 cxx_builtin_include_directory: "/"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100179 tool_path { name: "gcov" path: "/usr/bin/gcov" }
180 tool_path { name: "ld" path: "/usr/bin/ld" }
181 tool_path { name: "nm" path: "/usr/bin/nm" }
182 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
183 objcopy_embed_flag: "-I"
184 objcopy_embed_flag: "binary"
185 tool_path { name: "objdump" path: "/usr/bin/objdump" }
186 tool_path { name: "strip" path: "/usr/bin/strip" }
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000187
188 # Anticipated future default.
189 unfiltered_cxx_flag: "-no-canonical-prefixes"
Lukacs Berki763f1392016-01-07 09:29:08 +0000190
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000191 # Make C++ compilation deterministic. Use linkstamping instead of these
192 # compiler symbols.
193 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
194 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
195 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
196 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
197
198 # Security hardening on by default.
199 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
200 compiler_flag: "-D_FORTIFY_SOURCE=1"
201 compiler_flag: "-fstack-protector"
Ulf Adamsee8fcd32015-07-17 07:52:42 +0000202
203 # Enable coloring even if there's no attached terminal. Bazel removes the
204 # escape sequences if --nocolor is specified.
205 compiler_flag: "-fcolor-diagnostics"
206
207 # All warnings are enabled. Maybe enable -Werror as well?
208 compiler_flag: "-Wall"
209 # Enable a few more warnings that aren't part of -Wall.
210 compiler_flag: "-Wthread-safety"
211 compiler_flag: "-Wself-assign"
212
213 # Keep stack frames for debugging, even in opt mode.
214 compiler_flag: "-fno-omit-frame-pointer"
215
216 # Anticipated future default.
217 linker_flag: "-no-canonical-prefixes"
218
219 compilation_mode_flags {
220 mode: DBG
221 # Enable debug symbols.
222 compiler_flag: "-g"
223 }
224 compilation_mode_flags {
225 mode: OPT
226 # No debug symbols.
227 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or even generally?
228 # However, that can't happen here, as it requires special handling in Bazel.
229 compiler_flag: "-g0"
230
231 # Conservative choice for -O
232 # -O3 can increase binary size and even slow down the resulting binaries.
233 # Profile first and / or use FDO if you need better performance than this.
234 compiler_flag: "-O2"
235
236 # Disable assertions
237 compiler_flag: "-DNDEBUG"
238
239 # Removal of unused code and data at link time (can this increase binary size in some cases?).
240 compiler_flag: "-ffunction-sections"
241 compiler_flag: "-fdata-sections"
242 }
Googler3dd9cc62016-02-08 16:00:09 +0000243 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100244}
245
246toolchain {
247 abi_version: "local"
248 abi_libc_version: "local"
249 builtin_sysroot: ""
Doug Rabson709bc612015-08-25 14:12:00 +0000250 compiler: "compiler"
251 host_system_name: "local"
252 needsPic: true
Doug Rabson709bc612015-08-25 14:12:00 +0000253 supports_incremental_linker: false
254 supports_fission: false
255 supports_interface_shared_objects: false
256 supports_normalizing_ar: false
257 supports_start_end_lib: false
Doug Rabson709bc612015-08-25 14:12:00 +0000258 target_libc: "local"
259 target_cpu: "freebsd"
260 target_system_name: "local"
261 toolchain_identifier: "local_freebsd"
262
263 tool_path { name: "ar" path: "/usr/bin/ar" }
264 tool_path { name: "compat-ld" path: "/usr/bin/ld" }
265 tool_path { name: "cpp" path: "/usr/bin/cpp" }
266 tool_path { name: "dwp" path: "/usr/bin/dwp" }
267 tool_path { name: "gcc" path: "/usr/bin/clang" }
268 cxx_flag: "-std=c++0x"
269 linker_flag: "-lstdc++"
Doug Rabson709bc612015-08-25 14:12:00 +0000270
271 # TODO(bazel-team): In theory, the path here ought to exactly match the path
272 # used by gcc. That works because bazel currently doesn't track files at
273 # absolute locations and has no remote execution, yet. However, this will need
274 # to be fixed, maybe with auto-detection?
Piotr Sikora2bb61c12016-10-21 16:00:06 +0000275 cxx_builtin_include_directory: "/usr/lib/clang"
Doug Rabson709bc612015-08-25 14:12:00 +0000276 cxx_builtin_include_directory: "/usr/local/include"
277 cxx_builtin_include_directory: "/usr/include"
278 tool_path { name: "gcov" path: "/usr/bin/gcov" }
279
280 # C(++) compiles invoke the compiler (as that is the one knowing where
281 # to find libraries), but we provide LD so other rules can invoke the linker.
282 tool_path { name: "ld" path: "/usr/bin/ld" }
283
284 tool_path { name: "nm" path: "/usr/bin/nm" }
285 tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
286 objcopy_embed_flag: "-I"
287 objcopy_embed_flag: "binary"
288 tool_path { name: "objdump" path: "/usr/bin/objdump" }
289 tool_path { name: "strip" path: "/usr/bin/strip" }
290
291 # Anticipated future default.
292 unfiltered_cxx_flag: "-no-canonical-prefixes"
293
294 # Make C++ compilation deterministic. Use linkstamping instead of these
295 # compiler symbols.
296 unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
297 unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
298 unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
299 unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
300
301 # Security hardening on by default.
302 # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
303 # We need to undef it before redefining it as some distributions now have
304 # it enabled by default.
305 compiler_flag: "-U_FORTIFY_SOURCE"
306 compiler_flag: "-D_FORTIFY_SOURCE=1"
307 compiler_flag: "-fstack-protector"
Doug Rabson709bc612015-08-25 14:12:00 +0000308 linker_flag: "-Wl,-z,relro,-z,now"
309
310 # Enable coloring even if there's no attached terminal. Bazel removes the
311 # escape sequences if --nocolor is specified. This isn't supported by gcc
312 # on Ubuntu 14.04.
313 # compiler_flag: "-fcolor-diagnostics"
314
315 # All warnings are enabled. Maybe enable -Werror as well?
316 compiler_flag: "-Wall"
317 # Enable a few more warnings that aren't part of -Wall.
318 #compiler_flag: "-Wunused-but-set-parameter"
319 # But disable some that are problematic.
320 #compiler_flag: "-Wno-free-nonheap-object" # has false positives
321
322 # Keep stack frames for debugging, even in opt mode.
323 compiler_flag: "-fno-omit-frame-pointer"
324
325 # Anticipated future default.
326 linker_flag: "-no-canonical-prefixes"
327 # Have gcc return the exit code from ld.
328 #linker_flag: "-pass-exit-codes"
329 # Stamp the binary with a unique identifier.
Doug Rabson709bc612015-08-25 14:12:00 +0000330 # Gold linker only? Can we enable this by default?
331 # linker_flag: "-Wl,--warn-execstack"
332 # linker_flag: "-Wl,--detect-odr-violations"
333
334 compilation_mode_flags {
335 mode: DBG
336 # Enable debug symbols.
337 compiler_flag: "-g"
338 }
339 compilation_mode_flags {
340 mode: OPT
341
342 # No debug symbols.
343 # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
344 # even generally? However, that can't happen here, as it requires special
345 # handling in Bazel.
346 compiler_flag: "-g0"
347
348 # Conservative choice for -O
349 # -O3 can increase binary size and even slow down the resulting binaries.
350 # Profile first and / or use FDO if you need better performance than this.
351 compiler_flag: "-O2"
352
353 # Disable assertions
354 compiler_flag: "-DNDEBUG"
355
356 # Removal of unused code and data at link time (can this increase binary size in some cases?).
357 compiler_flag: "-ffunction-sections"
358 compiler_flag: "-fdata-sections"
359 linker_flag: "-Wl,--gc-sections"
360 }
Googler3dd9cc62016-02-08 16:00:09 +0000361 linking_mode_flags { mode: DYNAMIC }
Doug Rabson709bc612015-08-25 14:12:00 +0000362}
363
364toolchain {
365 abi_version: "local"
366 abi_libc_version: "local"
367 builtin_sysroot: ""
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100368 compiler: "windows_mingw"
369 host_system_name: "local"
370 needsPic: false
371 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000372 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100373 target_system_name: "local"
374 toolchain_identifier: "local_windows_mingw"
375
376 tool_path { name: "ar" path: "C:/mingw/bin/ar" }
377 tool_path { name: "compat-ld" path: "C:/mingw/bin/ld" }
378 tool_path { name: "cpp" path: "C:/mingw/bin/cpp" }
379 tool_path { name: "dwp" path: "C:/mingw/bin/dwp" }
380 tool_path { name: "gcc" path: "C:/mingw/bin/gcc" }
381 cxx_flag: "-std=c++0x"
382 # TODO(bazel-team): In theory, the path here ought to exactly match the path
383 # used by gcc. That works because bazel currently doesn't track files at
384 # absolute locations and has no remote execution, yet. However, this will need
385 # to be fixed, maybe with auto-detection?
386 cxx_builtin_include_directory: "C:/mingw/include"
387 cxx_builtin_include_directory: "C:/mingw/lib/gcc"
388 tool_path { name: "gcov" path: "C:/mingw/bin/gcov" }
389 tool_path { name: "ld" path: "C:/mingw/bin/ld" }
390 tool_path { name: "nm" path: "C:/mingw/bin/nm" }
391 tool_path { name: "objcopy" path: "C:/mingw/bin/objcopy" }
392 objcopy_embed_flag: "-I"
393 objcopy_embed_flag: "binary"
394 tool_path { name: "objdump" path: "C:/mingw/bin/objdump" }
395 tool_path { name: "strip" path: "C:/mingw/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000396 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100397}
398
399toolchain {
400 abi_version: "local"
401 abi_libc_version: "local"
402 builtin_sysroot: ""
403 compiler: "windows_msys64_mingw64"
404 host_system_name: "local"
405 needsPic: false
406 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000407 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100408 target_system_name: "local"
409 toolchain_identifier: "local_windows_msys64_mingw64"
410
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000411 tool_path { name: "ar" path: "C:/tools/msys64/mingw64/bin/ar" }
412 tool_path { name: "compat-ld" path: "C:/tools/msys64/mingw64/bin/ld" }
413 tool_path { name: "cpp" path: "C:/tools/msys64/mingw64/bin/cpp" }
414 tool_path { name: "dwp" path: "C:/tools/msys64/mingw64/bin/dwp" }
415 tool_path { name: "gcc" path: "C:/tools/msys64/mingw64/bin/gcc" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100416 cxx_flag: "-std=c++0x"
417 # TODO(bazel-team): In theory, the path here ought to exactly match the path
418 # used by gcc. That works because bazel currently doesn't track files at
419 # absolute locations and has no remote execution, yet. However, this will need
420 # to be fixed, maybe with auto-detection?
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000421 cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include"
422 tool_path { name: "gcov" path: "C:/tools/msys64/mingw64/bin/gcov" }
423 tool_path { name: "ld" path: "C:/tools/msys64/mingw64/bin/ld" }
424 tool_path { name: "nm" path: "C:/tools/msys64/mingw64/bin/nm" }
425 tool_path { name: "objcopy" path: "C:/tools/msys64/mingw64/bin/objcopy" }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100426 objcopy_embed_flag: "-I"
427 objcopy_embed_flag: "binary"
Lukacs Berki7a5d59e2016-02-24 15:33:46 +0000428 tool_path { name: "objdump" path: "C:/tools/msys64/mingw64/bin/objdump" }
429 tool_path { name: "strip" path: "C:/tools/msys64/mingw64/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000430 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100431}
432
433toolchain {
434 abi_version: "local"
435 abi_libc_version: "local"
436 builtin_sysroot: ""
437 compiler: "windows_clang"
438 host_system_name: "local"
439 needsPic: false
440 target_libc: "local"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000441 target_cpu: "x64_windows"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100442 target_system_name: "local"
443 toolchain_identifier: "local_windows_clang"
444
445 tool_path { name: "ar" path: "C:/mingw/bin/ar" }
446 tool_path { name: "compat-ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
447 tool_path { name: "cpp" path: "C:/Program Files (x86)/LLVM/bin/cpp" }
448 tool_path { name: "dwp" path: "C:/Program Files (x86)/LLVM/bin/dwp" }
449 tool_path { name: "gcc" path: "C:/Program Files (x86)/LLVM/bin/clang" }
450 cxx_flag: "-std=c++0x"
451 # TODO(bazel-team): In theory, the path here ought to exactly match the path
452 # used by gcc. That works because bazel currently doesn't track files at
453 # absolute locations and has no remote execution, yet. However, this will need
454 # to be fixed, maybe with auto-detection?
455 cxx_builtin_include_directory: "/usr/lib/gcc/"
456 cxx_builtin_include_directory: "/usr/local/include"
457 cxx_builtin_include_directory: "/usr/include"
458 tool_path { name: "gcov" path: "C:/Program Files (x86)/LLVM/bin/gcov" }
459 tool_path { name: "ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
460 tool_path { name: "nm" path: "C:/Program Files (x86)/LLVM/bin/nm" }
461 tool_path { name: "objcopy" path: "C:/Program Files (x86)/LLVM/bin/objcopy" }
462 objcopy_embed_flag: "-I"
463 objcopy_embed_flag: "binary"
464 tool_path { name: "objdump" path: "C:/Program Files (x86)/LLVM/bin/objdump" }
465 tool_path { name: "strip" path: "C:/Program Files (x86)/LLVM/bin/strip" }
Googler3dd9cc62016-02-08 16:00:09 +0000466 linking_mode_flags { mode: DYNAMIC }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100467}
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000468
469toolchain {
hlopko21903f92017-04-27 17:37:31 +0200470 abi_version: "local"
471 abi_libc_version: "local"
472 builtin_sysroot: ""
473 compiler: "windows_msys64"
474 host_system_name: "local"
475 needsPic: false
476 target_libc: "local"
477 target_cpu: "x64_windows"
478 target_system_name: "local"
479 toolchain_identifier: "local_windows_msys64"
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000480
hlopko21903f92017-04-27 17:37:31 +0200481 tool_path { name: "ar" path: "C:/tools/msys64/usr/bin/ar" }
482 tool_path { name: "compat-ld" path: "C:/tools/msys64/usr/bin/ld" }
483 tool_path { name: "cpp" path: "C:/tools/msys64/usr/bin/cpp" }
484 tool_path { name: "dwp" path: "C:/tools/msys64/usr/bin/dwp" }
485 # Use gcc instead of g++ so that C will compile correctly.
486 tool_path { name: "gcc" path: "C:/tools/msys64/usr/bin/gcc" }
487 cxx_flag: "-std=gnu++0x"
488 linker_flag: "-lstdc++"
489 # TODO(bazel-team): In theory, the path here ought to exactly match the path
490 # used by gcc. That works because bazel currently doesn't track files at
491 # absolute locations and has no remote execution, yet. However, this will need
492 # to be fixed, maybe with auto-detection?
493 cxx_builtin_include_directory: "C:/tools/msys64/"
494 cxx_builtin_include_directory: "/usr/"
495 tool_path { name: "gcov" path: "C:/tools/msys64/usr/bin/gcov" }
496 tool_path { name: "ld" path: "C:/tools/msys64/usr/bin/ld" }
497 tool_path { name: "nm" path: "C:/tools/msys64/usr/bin/nm" }
498 tool_path { name: "objcopy" path: "C:/tools/msys64/usr/bin/objcopy" }
499 objcopy_embed_flag: "-I"
500 objcopy_embed_flag: "binary"
501 tool_path { name: "objdump" path: "C:/tools/msys64/usr/bin/objdump" }
502 tool_path { name: "strip" path: "C:/tools/msys64/usr/bin/strip" }
503 linking_mode_flags { mode: DYNAMIC }
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000504}
Yun Peng114ead32016-04-07 16:39:19 +0000505
506toolchain {
507 toolchain_identifier: "vc_14_0_x64"
508 host_system_name: "local"
509 target_system_name: "local"
510
511 abi_version: "local"
512 abi_libc_version: "local"
Yun Peng57be3442016-04-25 14:08:41 +0000513 target_cpu: "x64_windows_msvc"
Yun Peng114ead32016-04-07 16:39:19 +0000514 compiler: "cl"
515 target_libc: "msvcrt140"
516 default_python_version: "python2.7"
517 cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE"
Yun Penge52ebec2016-05-10 08:56:38 +0000518 cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/"
519 cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/8.1/include/"
520 cxx_builtin_include_directory: "C:/Program Files (x86)/GnuWin32/include/"
521 cxx_builtin_include_directory: "C:/python_27_amd64/files/include"
Yun Peng114ead32016-04-07 16:39:19 +0000522 tool_path {
523 name: "ar"
524 path: "wrapper/bin/msvc_link.bat"
525 }
526 tool_path {
527 name: "cpp"
528 path: "wrapper/bin/msvc_cl.bat"
529 }
530 tool_path {
531 name: "gcc"
532 path: "wrapper/bin/msvc_cl.bat"
533 }
534 tool_path {
535 name: "gcov"
536 path: "wrapper/bin/msvc_nop.bat"
537 }
538 tool_path {
539 name: "ld"
540 path: "wrapper/bin/msvc_link.bat"
541 }
542 tool_path {
543 name: "nm"
544 path: "wrapper/bin/msvc_nop.bat"
545 }
546 tool_path {
547 name: "objcopy"
548 path: "wrapper/bin/msvc_nop.bat"
549 }
550 tool_path {
551 name: "objdump"
552 path: "wrapper/bin/msvc_nop.bat"
553 }
554 tool_path {
555 name: "strip"
556 path: "wrapper/bin/msvc_nop.bat"
557 }
Yun Peng114ead32016-04-07 16:39:19 +0000558 supports_start_end_lib: false
559 supports_interface_shared_objects: false
560 supports_incremental_linker: false
561 supports_normalizing_ar: true
562 needsPic: false
563
564 compiler_flag: "-m64"
Yun Penge52ebec2016-05-10 08:56:38 +0000565 compiler_flag: "/D__inline__=__inline"
Yun Peng114ead32016-04-07 16:39:19 +0000566 # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
Yun Peng114ead32016-04-07 16:39:19 +0000567 compiler_flag: "/DCOMPILER_MSVC"
568
569 # Don't pollute with GDI macros in windows.h.
570 compiler_flag: "/DNOGDI"
571 # Don't define min/max macros in windows.h.
572 compiler_flag: "/DNOMINMAX"
573 compiler_flag: "/DPRAGMA_SUPPORTED"
574 # Platform defines.
pcloudy0bef1f22018-10-05 00:23:50 -0700575 compiler_flag: "/D_WIN32_WINNT=0x0601"
Yun Peng114ead32016-04-07 16:39:19 +0000576 # Turn off warning messages.
577 compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
578 compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
579 compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
580 # Use math constants (M_PI, etc.) from the math library
581 compiler_flag: "/D_USE_MATH_DEFINES"
Yun Peng114ead32016-04-07 16:39:19 +0000582
583 # Useful options to have on for compilation.
584 # Suppress startup banner.
585 compiler_flag: "/nologo"
Yun Peng114ead32016-04-07 16:39:19 +0000586 # Increase the capacity of object files to 2^32 sections.
587 compiler_flag: "/bigobj"
588 # Allocate 500MB for precomputed headers.
589 compiler_flag: "/Zm500"
590 # Use unsigned char by default.
591 compiler_flag: "/J"
592 # Use function level linking.
593 compiler_flag: "/Gy"
594 # Use string pooling.
595 compiler_flag: "/GF"
596 # Warning level 3 (could possibly go to 4 in the future).
597 compiler_flag: "/W3"
598 # Catch both asynchronous (structured) and synchronous (C++) exceptions.
599 compiler_flag: "/EHsc"
600
601 # Globally disabled warnings.
602 # Don't warn about elements of array being be default initialized.
603 compiler_flag: "/wd4351"
604 # Don't warn about no matching delete found.
605 compiler_flag: "/wd4291"
606 # Don't warn about diamond inheritance patterns.
607 compiler_flag: "/wd4250"
608 # Don't warn about insecure functions (e.g. non _s functions).
609 compiler_flag: "/wd4996"
610
611 linker_flag: "-m64"
hlopkof322ba72017-09-08 15:17:18 +0200612 # Stop passing -frandom-seed option
613 feature {
614 name: 'random_seed'
615 }
616
hlopkof322ba72017-09-08 15:17:18 +0200617 action_config {
618 config_name: 'c-compile'
619 action_name: 'c-compile'
620 tool {
621 tool_path: 'wrapper/bin/msvc_cl.bat'
622 }
hlopko6f1a2ec2018-05-16 12:32:32 -0700623 implies: 'compiler_input_flags'
624 implies: 'compiler_output_flags'
hlopkof322ba72017-09-08 15:17:18 +0200625 implies: 'legacy_compile_flags'
626 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200627 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200628 implies: 'unfiltered_compile_flags'
629 }
630
631 action_config {
632 config_name: 'c++-compile'
633 action_name: 'c++-compile'
634 tool {
635 tool_path: 'wrapper/bin/msvc_cl.bat'
636 }
hlopko6f1a2ec2018-05-16 12:32:32 -0700637 implies: 'compiler_input_flags'
638 implies: 'compiler_output_flags'
hlopkof322ba72017-09-08 15:17:18 +0200639 implies: 'legacy_compile_flags'
640 implies: 'user_compile_flags'
hlopkob05bff62017-09-12 10:51:44 +0200641 implies: 'sysroot'
hlopkof322ba72017-09-08 15:17:18 +0200642 implies: 'unfiltered_compile_flags'
643 }
644
645 # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are
646 # not used in this crosstool
647 feature {
648 name: 'legacy_compile_flags'
649 flag_set {
hlopkof322ba72017-09-08 15:17:18 +0200650 action: 'assemble'
651 action: 'preprocess-assemble'
652 action: 'c-compile'
653 action: 'c++-compile'
654 action: 'c++-header-parsing'
hlopkof322ba72017-09-08 15:17:18 +0200655 action: 'c++-module-compile'
656 action: 'c++-module-codegen'
657 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800658 expand_if_all_available: 'legacy_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200659 iterate_over: 'legacy_compile_flags'
660 flag: '%{legacy_compile_flags}'
661 }
662 }
663 }
Yun Peng114ead32016-04-07 16:39:19 +0000664
Yun Peng6b6ff762016-06-30 14:19:41 +0000665 feature {
666 name: 'include_paths'
667 flag_set {
668 action: 'preprocess-assemble'
669 action: 'c-compile'
670 action: 'c++-compile'
671 action: 'c++-header-parsing'
Yun Peng6b6ff762016-06-30 14:19:41 +0000672 action: 'c++-module-compile'
673 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400674 iterate_over: 'quote_include_paths'
Yun Peng6b6ff762016-06-30 14:19:41 +0000675 flag: '/I%{quote_include_paths}'
676 }
677 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400678 iterate_over: 'include_paths'
Yun Peng6b6ff762016-06-30 14:19:41 +0000679 flag: '/I%{include_paths}'
680 }
681 flag_group {
hlopkoec41b8c2017-07-04 04:31:11 -0400682 iterate_over: 'system_include_paths'
Yun Peng6b6ff762016-06-30 14:19:41 +0000683 flag: '/I%{system_include_paths}'
684 }
685 }
686 }
687
688 feature {
689 name: 'dependency_file'
690 flag_set {
691 action: 'assemble'
692 action: 'preprocess-assemble'
693 action: 'c-compile'
694 action: 'c++-compile'
695 action: 'c++-module-compile'
Yun Peng6b6ff762016-06-30 14:19:41 +0000696 action: 'c++-header-parsing'
Yun Peng6b6ff762016-06-30 14:19:41 +0000697 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800698 expand_if_all_available: 'dependency_file'
Yun Peng6b6ff762016-06-30 14:19:41 +0000699 flag: '/DEPENDENCY_FILE'
700 flag: '%{dependency_file}'
701 }
702 }
703 }
704
Yun Peng6b6ff762016-06-30 14:19:41 +0000705 feature {
hlopkof322ba72017-09-08 15:17:18 +0200706 name: 'user_compile_flags'
Yun Peng6b6ff762016-06-30 14:19:41 +0000707 flag_set {
hlopko8328dc92017-09-06 13:34:00 +0200708 action: 'assemble'
709 action: 'preprocess-assemble'
710 action: 'c-compile'
711 action: 'c++-compile'
712 action: 'c++-header-parsing'
hlopko8328dc92017-09-06 13:34:00 +0200713 action: 'c++-module-compile'
714 action: 'c++-module-codegen'
715 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800716 expand_if_all_available: 'user_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200717 iterate_over: 'user_compile_flags'
718 flag: '%{user_compile_flags}'
719 }
720 }
721 }
722
723 feature {
hlopkob05bff62017-09-12 10:51:44 +0200724 name: 'sysroot'
725 flag_set {
hlopkob05bff62017-09-12 10:51:44 +0200726 action: 'assemble'
727 action: 'preprocess-assemble'
728 action: 'c-compile'
729 action: 'c++-compile'
730 action: 'c++-header-parsing'
hlopkob05bff62017-09-12 10:51:44 +0200731 action: 'c++-module-compile'
732 action: 'c++-module-codegen'
733 action: 'c++-link-executable'
734 action: 'c++-link-dynamic-library'
hlopkodad22762018-03-01 13:17:23 -0800735 action: 'c++-link-nodeps-dynamic-library'
hlopkob05bff62017-09-12 10:51:44 +0200736 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800737 expand_if_all_available: 'sysroot'
hlopkob05bff62017-09-12 10:51:44 +0200738 iterate_over: 'sysroot'
739 flag: '--sysroot=%{sysroot}'
740 }
741 }
742 }
743
744 feature {
hlopkof322ba72017-09-08 15:17:18 +0200745 name: 'unfiltered_compile_flags'
746 flag_set {
hlopkof322ba72017-09-08 15:17:18 +0200747 action: 'assemble'
748 action: 'preprocess-assemble'
749 action: 'c-compile'
750 action: 'c++-compile'
751 action: 'c++-header-parsing'
hlopkof322ba72017-09-08 15:17:18 +0200752 action: 'c++-module-compile'
753 action: 'c++-module-codegen'
754 flag_group {
hlopko3ce44b62019-01-02 08:02:29 -0800755 expand_if_all_available: 'unfiltered_compile_flags'
hlopkof322ba72017-09-08 15:17:18 +0200756 iterate_over: 'unfiltered_compile_flags'
757 flag: '%{unfiltered_compile_flags}'
hlopko646cfd82017-08-01 22:26:37 +0200758 }
759 }
Yun Peng6b6ff762016-06-30 14:19:41 +0000760 }
761
hlopko6f1a2ec2018-05-16 12:32:32 -0700762 feature {
763 name: 'compiler_output_flags'
764 flag_set {
765 action: 'assemble'
766 flag_group {
767 expand_if_all_available: 'output_file'
768 expand_if_none_available: 'output_assembly_file'
769 expand_if_none_available: 'output_preprocess_file'
770 flag: '/Fo%{output_file}'
771 flag: '/Zi'
772 }
773 }
774 flag_set {
775 action: 'preprocess-assemble'
776 action: 'c-compile'
777 action: 'c++-compile'
778 action: 'c++-header-parsing'
hlopko6f1a2ec2018-05-16 12:32:32 -0700779 action: 'c++-module-compile'
780 action: 'c++-module-codegen'
781 flag_group {
782 expand_if_all_available: 'output_file'
783 expand_if_none_available: 'output_assembly_file'
784 expand_if_none_available: 'output_preprocess_file'
785 flag: '/Fo%{output_file}'
786 }
787 flag_group {
788 expand_if_all_available: 'output_file'
789 expand_if_all_available: 'output_assembly_file'
790 flag: '/Fa%{output_file}'
791 }
792 flag_group {
793 expand_if_all_available: 'output_file'
794 expand_if_all_available: 'output_preprocess_file'
795 flag: '/P'
796 flag: '/Fi%{output_file}'
797 }
798 }
799 }
800
801 feature {
802 name: 'compiler_input_flags'
803 flag_set {
804 action: 'assemble'
805 action: 'preprocess-assemble'
806 action: 'c-compile'
807 action: 'c++-compile'
808 action: 'c++-header-parsing'
hlopko6f1a2ec2018-05-16 12:32:32 -0700809 action: 'c++-module-compile'
810 action: 'c++-module-codegen'
811 flag_group {
812 expand_if_all_available: 'source_file'
813 flag: '/c'
814 flag: '%{source_file}'
815 }
816 }
817 }
818
Yun Peng114ead32016-04-07 16:39:19 +0000819 compilation_mode_flags {
820 mode: DBG
821 compiler_flag: "/DDEBUG=1"
822 # This will signal the wrapper that we are doing a debug build, which sets
823 # some internal state of the toolchain wrapper. It is intentionally a "-"
824 # flag to make this very obvious.
825 compiler_flag: "-g"
826 compiler_flag: "/Od"
827 compiler_flag: "-Xcompilation-mode=dbg"
828 }
829
830 compilation_mode_flags {
831 mode: FASTBUILD
832 compiler_flag: "/DNDEBUG"
833 compiler_flag: "/Od"
834 compiler_flag: "-Xcompilation-mode=fastbuild"
835 }
836
837 compilation_mode_flags {
838 mode: OPT
839 compiler_flag: "/DNDEBUG"
840 compiler_flag: "/O2"
841 compiler_flag: "-Xcompilation-mode=opt"
842 }
843}