Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 1 | major_version: "local" |
| 2 | minor_version: "" |
Damien Martin-Guillerez | e1349ec | 2015-03-12 11:00:44 +0000 | [diff] [blame] | 3 | default_target_cpu: "same_as_host" |
Philipp Wollermann | 19f3413 | 2015-06-12 08:39:25 +0000 | [diff] [blame] | 4 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 5 | default_toolchain { |
| 6 | cpu: "k8" |
| 7 | toolchain_identifier: "local_linux" |
| 8 | } |
| 9 | default_toolchain { |
Philipp Wollermann | 19f3413 | 2015-06-12 08:39:25 +0000 | [diff] [blame] | 10 | cpu: "piii" |
| 11 | toolchain_identifier: "local_linux" |
| 12 | } |
| 13 | default_toolchain { |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 14 | cpu: "darwin" |
| 15 | toolchain_identifier: "local_darwin" |
| 16 | } |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 17 | default_toolchain { |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 18 | cpu: "freebsd" |
| 19 | toolchain_identifier: "local_freebsd" |
| 20 | } |
| 21 | default_toolchain { |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 22 | cpu: "armeabi-v7a" |
| 23 | toolchain_identifier: "stub_armeabi-v7a" |
| 24 | } |
Zhong Wang | 8c28813 | 2015-08-12 15:06:08 +0000 | [diff] [blame] | 25 | default_toolchain { |
| 26 | cpu: "arm" |
| 27 | toolchain_identifier: "local_linux" |
| 28 | } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 29 | default_toolchain { |
| 30 | cpu: "x64_windows" |
| 31 | toolchain_identifier: "local_windows_msys64" |
| 32 | } |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 33 | default_toolchain { |
| 34 | cpu: "x64_windows_msvc" |
| 35 | toolchain_identifier: "vc_14_0_x64" |
| 36 | } |
Zhong Wang | 8c28813 | 2015-08-12 15:06:08 +0000 | [diff] [blame] | 37 | |
| 38 | toolchain { |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 39 | abi_version: "armeabi-v7a" |
| 40 | abi_libc_version: "armeabi-v7a" |
| 41 | builtin_sysroot: "" |
| 42 | compiler: "compiler" |
| 43 | host_system_name: "armeabi-v7a" |
| 44 | needsPic: true |
| 45 | supports_gold_linker: false |
| 46 | supports_incremental_linker: false |
| 47 | supports_fission: false |
| 48 | supports_interface_shared_objects: false |
| 49 | supports_normalizing_ar: false |
| 50 | supports_start_end_lib: false |
| 51 | supports_thin_archives: false |
| 52 | target_libc: "armeabi-v7a" |
| 53 | target_cpu: "armeabi-v7a" |
| 54 | target_system_name: "armeabi-v7a" |
| 55 | toolchain_identifier: "stub_armeabi-v7a" |
| 56 | |
| 57 | tool_path { name: "ar" path: "/bin/false" } |
| 58 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 59 | tool_path { name: "cpp" path: "/bin/false" } |
| 60 | tool_path { name: "dwp" path: "/bin/false" } |
| 61 | tool_path { name: "gcc" path: "/bin/false" } |
| 62 | tool_path { name: "gcov" path: "/bin/false" } |
| 63 | tool_path { name: "ld" path: "/bin/false" } |
| 64 | |
| 65 | tool_path { name: "nm" path: "/bin/false" } |
| 66 | tool_path { name: "objcopy" path: "/bin/false" } |
| 67 | tool_path { name: "objdump" path: "/bin/false" } |
| 68 | tool_path { name: "strip" path: "/bin/false" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 69 | linking_mode_flags { mode: DYNAMIC } |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 70 | } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 71 | |
| 72 | toolchain { |
| 73 | abi_version: "local" |
| 74 | abi_libc_version: "local" |
| 75 | builtin_sysroot: "" |
| 76 | compiler: "compiler" |
| 77 | host_system_name: "local" |
| 78 | needsPic: true |
| 79 | supports_gold_linker: false |
| 80 | supports_incremental_linker: false |
| 81 | supports_fission: false |
| 82 | supports_interface_shared_objects: false |
| 83 | supports_normalizing_ar: false |
| 84 | supports_start_end_lib: false |
| 85 | supports_thin_archives: false |
| 86 | target_libc: "local" |
| 87 | target_cpu: "local" |
| 88 | target_system_name: "local" |
| 89 | toolchain_identifier: "local_linux" |
| 90 | |
| 91 | tool_path { name: "ar" path: "/usr/bin/ar" } |
| 92 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 93 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 94 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
| 95 | tool_path { name: "gcc" path: "/usr/bin/gcc" } |
| 96 | cxx_flag: "-std=c++0x" |
| 97 | linker_flag: "-lstdc++" |
Han-Wen Nienhuys | 4988a6d | 2015-04-08 13:36:58 +0000 | [diff] [blame] | 98 | linker_flag: "-B/usr/bin/" |
| 99 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 100 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 101 | # used by gcc. That works because bazel currently doesn't track files at |
| 102 | # absolute locations and has no remote execution, yet. However, this will need |
| 103 | # to be fixed, maybe with auto-detection? |
| 104 | cxx_builtin_include_directory: "/usr/lib/gcc/" |
| 105 | cxx_builtin_include_directory: "/usr/local/include" |
| 106 | cxx_builtin_include_directory: "/usr/include" |
| 107 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
Han-Wen Nienhuys | 15f1f86 | 2015-06-09 06:19:25 +0000 | [diff] [blame] | 108 | |
| 109 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 110 | # to find libraries), but we provide LD so other rules can invoke the linker. |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 111 | tool_path { name: "ld" path: "/usr/bin/ld" } |
Han-Wen Nienhuys | 15f1f86 | 2015-06-09 06:19:25 +0000 | [diff] [blame] | 112 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 113 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 114 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 115 | objcopy_embed_flag: "-I" |
| 116 | objcopy_embed_flag: "binary" |
| 117 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 118 | tool_path { name: "strip" path: "/usr/bin/strip" } |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 119 | |
| 120 | # Anticipated future default. |
| 121 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
Lukacs Berki | 763f139 | 2016-01-07 09:29:08 +0000 | [diff] [blame] | 122 | unfiltered_cxx_flag: "-fno-canonical-system-headers" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 123 | |
| 124 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 125 | # compiler symbols. |
| 126 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 127 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 128 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 129 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 130 | |
| 131 | # Security hardening on by default. |
| 132 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 133 | # We need to undef it before redefining it as some distributions now have |
| 134 | # it enabled by default. |
| 135 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 136 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 137 | compiler_flag: "-fstack-protector" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 138 | linker_flag: "-Wl,-z,relro,-z,now" |
| 139 | |
| 140 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 141 | # escape sequences if --nocolor is specified. This isn't supported by gcc |
| 142 | # on Ubuntu 14.04. |
| 143 | # compiler_flag: "-fcolor-diagnostics" |
| 144 | |
| 145 | # All warnings are enabled. Maybe enable -Werror as well? |
| 146 | compiler_flag: "-Wall" |
| 147 | # Enable a few more warnings that aren't part of -Wall. |
| 148 | compiler_flag: "-Wunused-but-set-parameter" |
| 149 | # But disable some that are problematic. |
| 150 | compiler_flag: "-Wno-free-nonheap-object" # has false positives |
| 151 | |
| 152 | # Keep stack frames for debugging, even in opt mode. |
| 153 | compiler_flag: "-fno-omit-frame-pointer" |
| 154 | |
| 155 | # Anticipated future default. |
| 156 | linker_flag: "-no-canonical-prefixes" |
| 157 | # Have gcc return the exit code from ld. |
| 158 | linker_flag: "-pass-exit-codes" |
| 159 | # Stamp the binary with a unique identifier. |
| 160 | linker_flag: "-Wl,--build-id=md5" |
| 161 | linker_flag: "-Wl,--hash-style=gnu" |
| 162 | # Gold linker only? Can we enable this by default? |
| 163 | # linker_flag: "-Wl,--warn-execstack" |
| 164 | # linker_flag: "-Wl,--detect-odr-violations" |
| 165 | |
| 166 | compilation_mode_flags { |
| 167 | mode: DBG |
| 168 | # Enable debug symbols. |
| 169 | compiler_flag: "-g" |
| 170 | } |
| 171 | compilation_mode_flags { |
| 172 | mode: OPT |
| 173 | |
| 174 | # No debug symbols. |
| 175 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or |
| 176 | # even generally? However, that can't happen here, as it requires special |
| 177 | # handling in Bazel. |
| 178 | compiler_flag: "-g0" |
| 179 | |
| 180 | # Conservative choice for -O |
| 181 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 182 | # Profile first and / or use FDO if you need better performance than this. |
| 183 | compiler_flag: "-O2" |
| 184 | |
| 185 | # Disable assertions |
| 186 | compiler_flag: "-DNDEBUG" |
| 187 | |
| 188 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 189 | compiler_flag: "-ffunction-sections" |
| 190 | compiler_flag: "-fdata-sections" |
| 191 | linker_flag: "-Wl,--gc-sections" |
| 192 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 193 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | toolchain { |
| 197 | abi_version: "local" |
| 198 | abi_libc_version: "local" |
| 199 | builtin_sysroot: "" |
| 200 | compiler: "compiler" |
| 201 | host_system_name: "local" |
| 202 | needsPic: true |
| 203 | target_libc: "macosx" |
| 204 | target_cpu: "darwin" |
| 205 | target_system_name: "local" |
| 206 | toolchain_identifier: "local_darwin" |
| 207 | |
| 208 | tool_path { name: "ar" path: "/usr/bin/libtool" } |
| 209 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 210 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 211 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 212 | tool_path { name: "gcc" path: "osx_cc_wrapper.sh" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 213 | cxx_flag: "-std=c++0x" |
| 214 | ar_flag: "-static" |
| 215 | ar_flag: "-s" |
| 216 | ar_flag: "-o" |
| 217 | linker_flag: "-lstdc++" |
Damien Martin-Guillerez | efd5d31 | 2015-05-15 14:05:10 +0000 | [diff] [blame] | 218 | linker_flag: "-undefined" |
| 219 | linker_flag: "dynamic_lookup" |
Ulf Adams | 568c394 | 2015-10-29 12:18:42 +0000 | [diff] [blame] | 220 | # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper |
| 221 | # setting from the local compiler, and also how to make incremental builds correct. |
| 222 | cxx_builtin_include_directory: "/" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 223 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
| 224 | tool_path { name: "ld" path: "/usr/bin/ld" } |
| 225 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 226 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 227 | objcopy_embed_flag: "-I" |
| 228 | objcopy_embed_flag: "binary" |
| 229 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 230 | tool_path { name: "strip" path: "/usr/bin/strip" } |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 231 | |
| 232 | # Anticipated future default. |
| 233 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
Lukacs Berki | 763f139 | 2016-01-07 09:29:08 +0000 | [diff] [blame] | 234 | |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 235 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 236 | # compiler symbols. |
| 237 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 238 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 239 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 240 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 241 | |
| 242 | # Security hardening on by default. |
| 243 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 244 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 245 | compiler_flag: "-fstack-protector" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 246 | |
| 247 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 248 | # escape sequences if --nocolor is specified. |
| 249 | compiler_flag: "-fcolor-diagnostics" |
| 250 | |
| 251 | # All warnings are enabled. Maybe enable -Werror as well? |
| 252 | compiler_flag: "-Wall" |
| 253 | # Enable a few more warnings that aren't part of -Wall. |
| 254 | compiler_flag: "-Wthread-safety" |
| 255 | compiler_flag: "-Wself-assign" |
| 256 | |
| 257 | # Keep stack frames for debugging, even in opt mode. |
| 258 | compiler_flag: "-fno-omit-frame-pointer" |
| 259 | |
| 260 | # Anticipated future default. |
| 261 | linker_flag: "-no-canonical-prefixes" |
| 262 | |
| 263 | compilation_mode_flags { |
| 264 | mode: DBG |
| 265 | # Enable debug symbols. |
| 266 | compiler_flag: "-g" |
| 267 | } |
| 268 | compilation_mode_flags { |
| 269 | mode: OPT |
| 270 | # No debug symbols. |
| 271 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or even generally? |
| 272 | # However, that can't happen here, as it requires special handling in Bazel. |
| 273 | compiler_flag: "-g0" |
| 274 | |
| 275 | # Conservative choice for -O |
| 276 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 277 | # Profile first and / or use FDO if you need better performance than this. |
| 278 | compiler_flag: "-O2" |
| 279 | |
| 280 | # Disable assertions |
| 281 | compiler_flag: "-DNDEBUG" |
| 282 | |
| 283 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 284 | compiler_flag: "-ffunction-sections" |
| 285 | compiler_flag: "-fdata-sections" |
| 286 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 287 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | toolchain { |
| 291 | abi_version: "local" |
| 292 | abi_libc_version: "local" |
| 293 | builtin_sysroot: "" |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 294 | compiler: "compiler" |
| 295 | host_system_name: "local" |
| 296 | needsPic: true |
| 297 | supports_gold_linker: false |
| 298 | supports_incremental_linker: false |
| 299 | supports_fission: false |
| 300 | supports_interface_shared_objects: false |
| 301 | supports_normalizing_ar: false |
| 302 | supports_start_end_lib: false |
| 303 | supports_thin_archives: false |
| 304 | target_libc: "local" |
| 305 | target_cpu: "freebsd" |
| 306 | target_system_name: "local" |
| 307 | toolchain_identifier: "local_freebsd" |
| 308 | |
| 309 | tool_path { name: "ar" path: "/usr/bin/ar" } |
| 310 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 311 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 312 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
| 313 | tool_path { name: "gcc" path: "/usr/bin/clang" } |
| 314 | cxx_flag: "-std=c++0x" |
| 315 | linker_flag: "-lstdc++" |
| 316 | linker_flag: "-B/usr/bin/" |
| 317 | |
| 318 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 319 | # used by gcc. That works because bazel currently doesn't track files at |
| 320 | # absolute locations and has no remote execution, yet. However, this will need |
| 321 | # to be fixed, maybe with auto-detection? |
| 322 | cxx_builtin_include_directory: "/usr/local/include" |
| 323 | cxx_builtin_include_directory: "/usr/include" |
| 324 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
| 325 | |
| 326 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 327 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 328 | tool_path { name: "ld" path: "/usr/bin/ld" } |
| 329 | |
| 330 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 331 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 332 | objcopy_embed_flag: "-I" |
| 333 | objcopy_embed_flag: "binary" |
| 334 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 335 | tool_path { name: "strip" path: "/usr/bin/strip" } |
| 336 | |
| 337 | # Anticipated future default. |
| 338 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 339 | |
| 340 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 341 | # compiler symbols. |
| 342 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 343 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 344 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 345 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 346 | |
| 347 | # Security hardening on by default. |
| 348 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 349 | # We need to undef it before redefining it as some distributions now have |
| 350 | # it enabled by default. |
| 351 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 352 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 353 | compiler_flag: "-fstack-protector" |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 354 | linker_flag: "-Wl,-z,relro,-z,now" |
| 355 | |
| 356 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 357 | # escape sequences if --nocolor is specified. This isn't supported by gcc |
| 358 | # on Ubuntu 14.04. |
| 359 | # compiler_flag: "-fcolor-diagnostics" |
| 360 | |
| 361 | # All warnings are enabled. Maybe enable -Werror as well? |
| 362 | compiler_flag: "-Wall" |
| 363 | # Enable a few more warnings that aren't part of -Wall. |
| 364 | #compiler_flag: "-Wunused-but-set-parameter" |
| 365 | # But disable some that are problematic. |
| 366 | #compiler_flag: "-Wno-free-nonheap-object" # has false positives |
| 367 | |
| 368 | # Keep stack frames for debugging, even in opt mode. |
| 369 | compiler_flag: "-fno-omit-frame-pointer" |
| 370 | |
| 371 | # Anticipated future default. |
| 372 | linker_flag: "-no-canonical-prefixes" |
| 373 | # Have gcc return the exit code from ld. |
| 374 | #linker_flag: "-pass-exit-codes" |
| 375 | # Stamp the binary with a unique identifier. |
| 376 | #linker_flag: "-Wl,--build-id=md5" |
| 377 | linker_flag: "-Wl,--hash-style=gnu" |
| 378 | # Gold linker only? Can we enable this by default? |
| 379 | # linker_flag: "-Wl,--warn-execstack" |
| 380 | # linker_flag: "-Wl,--detect-odr-violations" |
| 381 | |
| 382 | compilation_mode_flags { |
| 383 | mode: DBG |
| 384 | # Enable debug symbols. |
| 385 | compiler_flag: "-g" |
| 386 | } |
| 387 | compilation_mode_flags { |
| 388 | mode: OPT |
| 389 | |
| 390 | # No debug symbols. |
| 391 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or |
| 392 | # even generally? However, that can't happen here, as it requires special |
| 393 | # handling in Bazel. |
| 394 | compiler_flag: "-g0" |
| 395 | |
| 396 | # Conservative choice for -O |
| 397 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 398 | # Profile first and / or use FDO if you need better performance than this. |
| 399 | compiler_flag: "-O2" |
| 400 | |
| 401 | # Disable assertions |
| 402 | compiler_flag: "-DNDEBUG" |
| 403 | |
| 404 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 405 | compiler_flag: "-ffunction-sections" |
| 406 | compiler_flag: "-fdata-sections" |
| 407 | linker_flag: "-Wl,--gc-sections" |
| 408 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 409 | linking_mode_flags { mode: DYNAMIC } |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | toolchain { |
| 413 | abi_version: "local" |
| 414 | abi_libc_version: "local" |
| 415 | builtin_sysroot: "" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 416 | compiler: "windows_mingw" |
| 417 | host_system_name: "local" |
| 418 | needsPic: false |
| 419 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 420 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 421 | target_system_name: "local" |
| 422 | toolchain_identifier: "local_windows_mingw" |
| 423 | |
| 424 | tool_path { name: "ar" path: "C:/mingw/bin/ar" } |
| 425 | tool_path { name: "compat-ld" path: "C:/mingw/bin/ld" } |
| 426 | tool_path { name: "cpp" path: "C:/mingw/bin/cpp" } |
| 427 | tool_path { name: "dwp" path: "C:/mingw/bin/dwp" } |
| 428 | tool_path { name: "gcc" path: "C:/mingw/bin/gcc" } |
| 429 | cxx_flag: "-std=c++0x" |
| 430 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 431 | # used by gcc. That works because bazel currently doesn't track files at |
| 432 | # absolute locations and has no remote execution, yet. However, this will need |
| 433 | # to be fixed, maybe with auto-detection? |
| 434 | cxx_builtin_include_directory: "C:/mingw/include" |
| 435 | cxx_builtin_include_directory: "C:/mingw/lib/gcc" |
| 436 | tool_path { name: "gcov" path: "C:/mingw/bin/gcov" } |
| 437 | tool_path { name: "ld" path: "C:/mingw/bin/ld" } |
| 438 | tool_path { name: "nm" path: "C:/mingw/bin/nm" } |
| 439 | tool_path { name: "objcopy" path: "C:/mingw/bin/objcopy" } |
| 440 | objcopy_embed_flag: "-I" |
| 441 | objcopy_embed_flag: "binary" |
| 442 | tool_path { name: "objdump" path: "C:/mingw/bin/objdump" } |
| 443 | tool_path { name: "strip" path: "C:/mingw/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 444 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | toolchain { |
| 448 | abi_version: "local" |
| 449 | abi_libc_version: "local" |
| 450 | builtin_sysroot: "" |
| 451 | compiler: "windows_msys64_mingw64" |
| 452 | host_system_name: "local" |
| 453 | needsPic: false |
| 454 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 455 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 456 | target_system_name: "local" |
| 457 | toolchain_identifier: "local_windows_msys64_mingw64" |
| 458 | |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 459 | tool_path { name: "ar" path: "C:/tools/msys64/mingw64/bin/ar" } |
| 460 | tool_path { name: "compat-ld" path: "C:/tools/msys64/mingw64/bin/ld" } |
| 461 | tool_path { name: "cpp" path: "C:/tools/msys64/mingw64/bin/cpp" } |
| 462 | tool_path { name: "dwp" path: "C:/tools/msys64/mingw64/bin/dwp" } |
| 463 | tool_path { name: "gcc" path: "C:/tools/msys64/mingw64/bin/gcc" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 464 | cxx_flag: "-std=c++0x" |
| 465 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 466 | # used by gcc. That works because bazel currently doesn't track files at |
| 467 | # absolute locations and has no remote execution, yet. However, this will need |
| 468 | # to be fixed, maybe with auto-detection? |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 469 | cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include" |
| 470 | tool_path { name: "gcov" path: "C:/tools/msys64/mingw64/bin/gcov" } |
| 471 | tool_path { name: "ld" path: "C:/tools/msys64/mingw64/bin/ld" } |
| 472 | tool_path { name: "nm" path: "C:/tools/msys64/mingw64/bin/nm" } |
| 473 | tool_path { name: "objcopy" path: "C:/tools/msys64/mingw64/bin/objcopy" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 474 | objcopy_embed_flag: "-I" |
| 475 | objcopy_embed_flag: "binary" |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 476 | tool_path { name: "objdump" path: "C:/tools/msys64/mingw64/bin/objdump" } |
| 477 | tool_path { name: "strip" path: "C:/tools/msys64/mingw64/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 478 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 479 | } |
| 480 | |
| 481 | toolchain { |
| 482 | abi_version: "local" |
| 483 | abi_libc_version: "local" |
| 484 | builtin_sysroot: "" |
| 485 | compiler: "windows_clang" |
| 486 | host_system_name: "local" |
| 487 | needsPic: false |
| 488 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 489 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 490 | target_system_name: "local" |
| 491 | toolchain_identifier: "local_windows_clang" |
| 492 | |
| 493 | tool_path { name: "ar" path: "C:/mingw/bin/ar" } |
| 494 | tool_path { name: "compat-ld" path: "C:/Program Files (x86)/LLVM/bin/ld" } |
| 495 | tool_path { name: "cpp" path: "C:/Program Files (x86)/LLVM/bin/cpp" } |
| 496 | tool_path { name: "dwp" path: "C:/Program Files (x86)/LLVM/bin/dwp" } |
| 497 | tool_path { name: "gcc" path: "C:/Program Files (x86)/LLVM/bin/clang" } |
| 498 | cxx_flag: "-std=c++0x" |
| 499 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 500 | # used by gcc. That works because bazel currently doesn't track files at |
| 501 | # absolute locations and has no remote execution, yet. However, this will need |
| 502 | # to be fixed, maybe with auto-detection? |
| 503 | cxx_builtin_include_directory: "/usr/lib/gcc/" |
| 504 | cxx_builtin_include_directory: "/usr/local/include" |
| 505 | cxx_builtin_include_directory: "/usr/include" |
| 506 | tool_path { name: "gcov" path: "C:/Program Files (x86)/LLVM/bin/gcov" } |
| 507 | tool_path { name: "ld" path: "C:/Program Files (x86)/LLVM/bin/ld" } |
| 508 | tool_path { name: "nm" path: "C:/Program Files (x86)/LLVM/bin/nm" } |
| 509 | tool_path { name: "objcopy" path: "C:/Program Files (x86)/LLVM/bin/objcopy" } |
| 510 | objcopy_embed_flag: "-I" |
| 511 | objcopy_embed_flag: "binary" |
| 512 | tool_path { name: "objdump" path: "C:/Program Files (x86)/LLVM/bin/objdump" } |
| 513 | tool_path { name: "strip" path: "C:/Program Files (x86)/LLVM/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 514 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 515 | } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 516 | |
| 517 | toolchain { |
| 518 | abi_version: "local" |
| 519 | abi_libc_version: "local" |
| 520 | builtin_sysroot: "" |
| 521 | compiler: "windows_msys64" |
| 522 | host_system_name: "local" |
| 523 | needsPic: false |
| 524 | target_libc: "local" |
| 525 | target_cpu: "x64_windows" |
| 526 | target_system_name: "local" |
| 527 | toolchain_identifier: "local_windows_msys64" |
| 528 | |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 529 | tool_path { name: "ar" path: "C:/tools/msys64/usr/bin/ar" } |
| 530 | tool_path { name: "compat-ld" path: "C:/tools/msys64/usr/bin/ld" } |
| 531 | tool_path { name: "cpp" path: "C:/tools/msys64/usr/bin/cpp" } |
| 532 | tool_path { name: "dwp" path: "C:/tools/msys64/usr/bin/dwp" } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 533 | # Use gcc instead of g++ so that C will compile correctly. |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 534 | tool_path { name: "gcc" path: "C:/tools/msys64/usr/bin/gcc" } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 535 | cxx_flag: "-std=gnu++0x" |
| 536 | linker_flag: "-lstdc++" |
| 537 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 538 | # used by gcc. That works because bazel currently doesn't track files at |
| 539 | # absolute locations and has no remote execution, yet. However, this will need |
| 540 | # to be fixed, maybe with auto-detection? |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 541 | cxx_builtin_include_directory: "C:/tools/msys64/" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 542 | cxx_builtin_include_directory: "/usr/" |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 543 | tool_path { name: "gcov" path: "C:/tools/msys64/usr/bin/gcov" } |
| 544 | tool_path { name: "ld" path: "C:/tools/msys64/usr/bin/ld" } |
| 545 | tool_path { name: "nm" path: "C:/tools/msys64/usr/bin/nm" } |
| 546 | tool_path { name: "objcopy" path: "C:/tools/msys64/usr/bin/objcopy" } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 547 | objcopy_embed_flag: "-I" |
| 548 | objcopy_embed_flag: "binary" |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 549 | tool_path { name: "objdump" path: "C:/tools/msys64/usr/bin/objdump" } |
| 550 | tool_path { name: "strip" path: "C:/tools/msys64/usr/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 551 | linking_mode_flags { mode: DYNAMIC } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 552 | } |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 553 | |
| 554 | toolchain { |
| 555 | toolchain_identifier: "vc_14_0_x64" |
| 556 | host_system_name: "local" |
| 557 | target_system_name: "local" |
| 558 | |
| 559 | abi_version: "local" |
| 560 | abi_libc_version: "local" |
| 561 | target_cpu: "x64_windows" |
| 562 | compiler: "cl" |
| 563 | target_libc: "msvcrt140" |
| 564 | default_python_version: "python2.7" |
| 565 | cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE" |
| 566 | cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/10.0.10240.0/ucrt" |
| 567 | tool_path { |
| 568 | name: "ar" |
| 569 | path: "wrapper/bin/msvc_link.bat" |
| 570 | } |
| 571 | tool_path { |
| 572 | name: "cpp" |
| 573 | path: "wrapper/bin/msvc_cl.bat" |
| 574 | } |
| 575 | tool_path { |
| 576 | name: "gcc" |
| 577 | path: "wrapper/bin/msvc_cl.bat" |
| 578 | } |
| 579 | tool_path { |
| 580 | name: "gcov" |
| 581 | path: "wrapper/bin/msvc_nop.bat" |
| 582 | } |
| 583 | tool_path { |
| 584 | name: "ld" |
| 585 | path: "wrapper/bin/msvc_link.bat" |
| 586 | } |
| 587 | tool_path { |
| 588 | name: "nm" |
| 589 | path: "wrapper/bin/msvc_nop.bat" |
| 590 | } |
| 591 | tool_path { |
| 592 | name: "objcopy" |
| 593 | path: "wrapper/bin/msvc_nop.bat" |
| 594 | } |
| 595 | tool_path { |
| 596 | name: "objdump" |
| 597 | path: "wrapper/bin/msvc_nop.bat" |
| 598 | } |
| 599 | tool_path { |
| 600 | name: "strip" |
| 601 | path: "wrapper/bin/msvc_nop.bat" |
| 602 | } |
| 603 | supports_gold_linker: false |
| 604 | supports_thin_archives: false |
| 605 | supports_start_end_lib: false |
| 606 | supports_interface_shared_objects: false |
| 607 | supports_incremental_linker: false |
| 608 | supports_normalizing_ar: true |
| 609 | needsPic: false |
| 610 | |
| 611 | compiler_flag: "-m64" |
| 612 | |
| 613 | # TODO(pcloudy): Review those flags below, they should be defined by cl.exe |
| 614 | compiler_flag: "/DOS_WINDOWS=OS_WINDOWS" |
| 615 | compiler_flag: "/DCOMPILER_MSVC" |
| 616 | |
| 617 | # Don't pollute with GDI macros in windows.h. |
| 618 | compiler_flag: "/DNOGDI" |
| 619 | # Don't define min/max macros in windows.h. |
| 620 | compiler_flag: "/DNOMINMAX" |
| 621 | compiler_flag: "/DPRAGMA_SUPPORTED" |
| 622 | # Platform defines. |
| 623 | compiler_flag: "/D_WIN32" |
| 624 | compiler_flag: "/DWIN32" |
| 625 | compiler_flag: "/D_WIN32_WINNT=0x0502" |
| 626 | compiler_flag: "/DWINVER=0x0502" |
| 627 | compiler_flag: "/D_MSC_VER=1900" |
| 628 | compiler_flag: "/D_WINDOWS" |
| 629 | # Turn off warning messages. |
| 630 | compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE" |
| 631 | compiler_flag: "/D_CRT_SECURE_NO_WARNINGS" |
| 632 | compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS" |
| 633 | # Use math constants (M_PI, etc.) from the math library |
| 634 | compiler_flag: "/D_USE_MATH_DEFINES" |
| 635 | # Don't bloat namespace with incompatible winsock versions. |
| 636 | compiler_flag: "/DWIN32_LEAN_AND_MEAN" |
| 637 | |
| 638 | # Useful options to have on for compilation. |
| 639 | # Suppress startup banner. |
| 640 | compiler_flag: "/nologo" |
| 641 | # Treat warnings as errors. |
| 642 | compiler_flag: "/WX" |
| 643 | # Increase the capacity of object files to 2^32 sections. |
| 644 | compiler_flag: "/bigobj" |
| 645 | # Allocate 500MB for precomputed headers. |
| 646 | compiler_flag: "/Zm500" |
| 647 | # Use unsigned char by default. |
| 648 | compiler_flag: "/J" |
| 649 | # Use function level linking. |
| 650 | compiler_flag: "/Gy" |
| 651 | # Use string pooling. |
| 652 | compiler_flag: "/GF" |
| 653 | # Warning level 3 (could possibly go to 4 in the future). |
| 654 | compiler_flag: "/W3" |
| 655 | # Catch both asynchronous (structured) and synchronous (C++) exceptions. |
| 656 | compiler_flag: "/EHsc" |
| 657 | |
| 658 | # Globally disabled warnings. |
| 659 | # Don't warn about elements of array being be default initialized. |
| 660 | compiler_flag: "/wd4351" |
| 661 | # Don't warn about no matching delete found. |
| 662 | compiler_flag: "/wd4291" |
| 663 | # Don't warn about diamond inheritance patterns. |
| 664 | compiler_flag: "/wd4250" |
| 665 | # Don't warn about insecure functions (e.g. non _s functions). |
| 666 | compiler_flag: "/wd4996" |
| 667 | |
| 668 | linker_flag: "-m64" |
| 669 | |
| 670 | compilation_mode_flags { |
| 671 | mode: DBG |
| 672 | compiler_flag: "/DDEBUG=1" |
| 673 | # This will signal the wrapper that we are doing a debug build, which sets |
| 674 | # some internal state of the toolchain wrapper. It is intentionally a "-" |
| 675 | # flag to make this very obvious. |
| 676 | compiler_flag: "-g" |
| 677 | compiler_flag: "/Od" |
| 678 | compiler_flag: "-Xcompilation-mode=dbg" |
| 679 | } |
| 680 | |
| 681 | compilation_mode_flags { |
| 682 | mode: FASTBUILD |
| 683 | compiler_flag: "/DNDEBUG" |
| 684 | compiler_flag: "/Od" |
| 685 | compiler_flag: "-Xcompilation-mode=fastbuild" |
| 686 | } |
| 687 | |
| 688 | compilation_mode_flags { |
| 689 | mode: OPT |
| 690 | compiler_flag: "/DNDEBUG" |
| 691 | compiler_flag: "/O2" |
| 692 | compiler_flag: "-Xcompilation-mode=opt" |
| 693 | } |
| 694 | } |