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 | } |
namrata-ibm | 155bd64 | 2016-10-11 09:59:27 +0000 | [diff] [blame] | 37 | default_toolchain { |
| 38 | cpu: "s390x" |
| 39 | toolchain_identifier: "local_linux" |
| 40 | } |
Zhong Wang | 8c28813 | 2015-08-12 15:06:08 +0000 | [diff] [blame] | 41 | |
Nishidha Panpaliya | aaee64e | 2016-12-20 18:19:43 +0000 | [diff] [blame] | 42 | default_toolchain { |
| 43 | cpu: "ppc" |
| 44 | toolchain_identifier: "local_linux" |
| 45 | } |
Cal Peyser | 1b6535c | 2016-12-22 21:27:24 +0000 | [diff] [blame] | 46 | |
| 47 | default_toolchain { |
davideleoni90 | 033aa6c | 2017-05-15 15:16:04 +0200 | [diff] [blame] | 48 | cpu: "ppc64" |
| 49 | toolchain_identifier: "local_linux" |
| 50 | } |
| 51 | |
| 52 | default_toolchain { |
Cal Peyser | 1b6535c | 2016-12-22 21:27:24 +0000 | [diff] [blame] | 53 | cpu: "ios_x86_64" |
| 54 | toolchain_identifier: "ios_x86_64" |
| 55 | } |
| 56 | |
Zhong Wang | 8c28813 | 2015-08-12 15:06:08 +0000 | [diff] [blame] | 57 | toolchain { |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 58 | abi_version: "armeabi-v7a" |
| 59 | abi_libc_version: "armeabi-v7a" |
| 60 | builtin_sysroot: "" |
| 61 | compiler: "compiler" |
| 62 | host_system_name: "armeabi-v7a" |
| 63 | needsPic: true |
| 64 | supports_gold_linker: false |
| 65 | supports_incremental_linker: false |
| 66 | supports_fission: false |
| 67 | supports_interface_shared_objects: false |
| 68 | supports_normalizing_ar: false |
| 69 | supports_start_end_lib: false |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 70 | target_libc: "armeabi-v7a" |
| 71 | target_cpu: "armeabi-v7a" |
| 72 | target_system_name: "armeabi-v7a" |
| 73 | toolchain_identifier: "stub_armeabi-v7a" |
| 74 | |
| 75 | tool_path { name: "ar" path: "/bin/false" } |
| 76 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 77 | tool_path { name: "cpp" path: "/bin/false" } |
| 78 | tool_path { name: "dwp" path: "/bin/false" } |
| 79 | tool_path { name: "gcc" path: "/bin/false" } |
| 80 | tool_path { name: "gcov" path: "/bin/false" } |
| 81 | tool_path { name: "ld" path: "/bin/false" } |
| 82 | |
| 83 | tool_path { name: "nm" path: "/bin/false" } |
| 84 | tool_path { name: "objcopy" path: "/bin/false" } |
| 85 | tool_path { name: "objdump" path: "/bin/false" } |
| 86 | tool_path { name: "strip" path: "/bin/false" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 87 | linking_mode_flags { mode: DYNAMIC } |
Lukacs Berki | a93c63b | 2015-07-29 15:32:19 +0000 | [diff] [blame] | 88 | } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 89 | |
| 90 | toolchain { |
| 91 | abi_version: "local" |
| 92 | abi_libc_version: "local" |
| 93 | builtin_sysroot: "" |
| 94 | compiler: "compiler" |
| 95 | host_system_name: "local" |
| 96 | needsPic: true |
| 97 | supports_gold_linker: false |
| 98 | supports_incremental_linker: false |
| 99 | supports_fission: false |
| 100 | supports_interface_shared_objects: false |
| 101 | supports_normalizing_ar: false |
| 102 | supports_start_end_lib: false |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 103 | target_libc: "local" |
| 104 | target_cpu: "local" |
| 105 | target_system_name: "local" |
| 106 | toolchain_identifier: "local_linux" |
| 107 | |
| 108 | tool_path { name: "ar" path: "/usr/bin/ar" } |
| 109 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 110 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 111 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
| 112 | tool_path { name: "gcc" path: "/usr/bin/gcc" } |
| 113 | cxx_flag: "-std=c++0x" |
| 114 | linker_flag: "-lstdc++" |
Han-Wen Nienhuys | 4988a6d | 2015-04-08 13:36:58 +0000 | [diff] [blame] | 115 | linker_flag: "-B/usr/bin/" |
| 116 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 117 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 118 | # used by gcc. That works because bazel currently doesn't track files at |
| 119 | # absolute locations and has no remote execution, yet. However, this will need |
| 120 | # to be fixed, maybe with auto-detection? |
| 121 | cxx_builtin_include_directory: "/usr/lib/gcc/" |
| 122 | cxx_builtin_include_directory: "/usr/local/include" |
| 123 | cxx_builtin_include_directory: "/usr/include" |
| 124 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
Han-Wen Nienhuys | 15f1f86 | 2015-06-09 06:19:25 +0000 | [diff] [blame] | 125 | |
| 126 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 127 | # 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] | 128 | tool_path { name: "ld" path: "/usr/bin/ld" } |
Han-Wen Nienhuys | 15f1f86 | 2015-06-09 06:19:25 +0000 | [diff] [blame] | 129 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 130 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 131 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 132 | objcopy_embed_flag: "-I" |
| 133 | objcopy_embed_flag: "binary" |
| 134 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 135 | tool_path { name: "strip" path: "/usr/bin/strip" } |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 136 | |
| 137 | # Anticipated future default. |
| 138 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
Lukacs Berki | 763f139 | 2016-01-07 09:29:08 +0000 | [diff] [blame] | 139 | unfiltered_cxx_flag: "-fno-canonical-system-headers" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 140 | |
| 141 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 142 | # compiler symbols. |
| 143 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 144 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 145 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 146 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 147 | |
| 148 | # Security hardening on by default. |
| 149 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 150 | # We need to undef it before redefining it as some distributions now have |
| 151 | # it enabled by default. |
| 152 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 153 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 154 | compiler_flag: "-fstack-protector" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 155 | linker_flag: "-Wl,-z,relro,-z,now" |
| 156 | |
| 157 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 158 | # escape sequences if --nocolor is specified. This isn't supported by gcc |
| 159 | # on Ubuntu 14.04. |
| 160 | # compiler_flag: "-fcolor-diagnostics" |
| 161 | |
| 162 | # All warnings are enabled. Maybe enable -Werror as well? |
| 163 | compiler_flag: "-Wall" |
| 164 | # Enable a few more warnings that aren't part of -Wall. |
| 165 | compiler_flag: "-Wunused-but-set-parameter" |
| 166 | # But disable some that are problematic. |
| 167 | compiler_flag: "-Wno-free-nonheap-object" # has false positives |
| 168 | |
| 169 | # Keep stack frames for debugging, even in opt mode. |
| 170 | compiler_flag: "-fno-omit-frame-pointer" |
| 171 | |
| 172 | # Anticipated future default. |
| 173 | linker_flag: "-no-canonical-prefixes" |
| 174 | # Have gcc return the exit code from ld. |
| 175 | linker_flag: "-pass-exit-codes" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 176 | # Gold linker only? Can we enable this by default? |
| 177 | # linker_flag: "-Wl,--warn-execstack" |
| 178 | # linker_flag: "-Wl,--detect-odr-violations" |
| 179 | |
| 180 | compilation_mode_flags { |
| 181 | mode: DBG |
| 182 | # Enable debug symbols. |
| 183 | compiler_flag: "-g" |
| 184 | } |
| 185 | compilation_mode_flags { |
| 186 | mode: OPT |
| 187 | |
| 188 | # No debug symbols. |
| 189 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or |
| 190 | # even generally? However, that can't happen here, as it requires special |
| 191 | # handling in Bazel. |
| 192 | compiler_flag: "-g0" |
| 193 | |
| 194 | # Conservative choice for -O |
| 195 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 196 | # Profile first and / or use FDO if you need better performance than this. |
| 197 | compiler_flag: "-O2" |
| 198 | |
| 199 | # Disable assertions |
| 200 | compiler_flag: "-DNDEBUG" |
| 201 | |
| 202 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 203 | compiler_flag: "-ffunction-sections" |
| 204 | compiler_flag: "-fdata-sections" |
| 205 | linker_flag: "-Wl,--gc-sections" |
| 206 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 207 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | toolchain { |
| 211 | abi_version: "local" |
| 212 | abi_libc_version: "local" |
| 213 | builtin_sysroot: "" |
| 214 | compiler: "compiler" |
| 215 | host_system_name: "local" |
| 216 | needsPic: true |
| 217 | target_libc: "macosx" |
| 218 | target_cpu: "darwin" |
| 219 | target_system_name: "local" |
| 220 | toolchain_identifier: "local_darwin" |
| 221 | |
| 222 | tool_path { name: "ar" path: "/usr/bin/libtool" } |
| 223 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 224 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 225 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
Damien Martin-Guillerez | 8fa5ae6 | 2016-03-02 16:24:13 +0000 | [diff] [blame] | 226 | tool_path { name: "gcc" path: "osx_cc_wrapper.sh" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 227 | cxx_flag: "-std=c++0x" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 228 | linker_flag: "-lstdc++" |
Damien Martin-Guillerez | efd5d31 | 2015-05-15 14:05:10 +0000 | [diff] [blame] | 229 | linker_flag: "-undefined" |
| 230 | linker_flag: "dynamic_lookup" |
David Chen | b86809e | 2016-05-17 08:29:50 +0000 | [diff] [blame] | 231 | linker_flag: "-headerpad_max_install_names" |
Ulf Adams | 568c394 | 2015-10-29 12:18:42 +0000 | [diff] [blame] | 232 | # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper |
| 233 | # setting from the local compiler, and also how to make incremental builds correct. |
| 234 | cxx_builtin_include_directory: "/" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 235 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
| 236 | tool_path { name: "ld" path: "/usr/bin/ld" } |
| 237 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 238 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 239 | objcopy_embed_flag: "-I" |
| 240 | objcopy_embed_flag: "binary" |
| 241 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 242 | tool_path { name: "strip" path: "/usr/bin/strip" } |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 243 | |
| 244 | # Anticipated future default. |
| 245 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
Lukacs Berki | 763f139 | 2016-01-07 09:29:08 +0000 | [diff] [blame] | 246 | |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 247 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 248 | # compiler symbols. |
| 249 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 250 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 251 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 252 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 253 | |
| 254 | # Security hardening on by default. |
| 255 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 256 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 257 | compiler_flag: "-fstack-protector" |
Ulf Adams | ee8fcd3 | 2015-07-17 07:52:42 +0000 | [diff] [blame] | 258 | |
| 259 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 260 | # escape sequences if --nocolor is specified. |
| 261 | compiler_flag: "-fcolor-diagnostics" |
| 262 | |
| 263 | # All warnings are enabled. Maybe enable -Werror as well? |
| 264 | compiler_flag: "-Wall" |
| 265 | # Enable a few more warnings that aren't part of -Wall. |
| 266 | compiler_flag: "-Wthread-safety" |
| 267 | compiler_flag: "-Wself-assign" |
| 268 | |
| 269 | # Keep stack frames for debugging, even in opt mode. |
| 270 | compiler_flag: "-fno-omit-frame-pointer" |
| 271 | |
| 272 | # Anticipated future default. |
| 273 | linker_flag: "-no-canonical-prefixes" |
| 274 | |
| 275 | compilation_mode_flags { |
| 276 | mode: DBG |
| 277 | # Enable debug symbols. |
| 278 | compiler_flag: "-g" |
| 279 | } |
| 280 | compilation_mode_flags { |
| 281 | mode: OPT |
| 282 | # No debug symbols. |
| 283 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or even generally? |
| 284 | # However, that can't happen here, as it requires special handling in Bazel. |
| 285 | compiler_flag: "-g0" |
| 286 | |
| 287 | # Conservative choice for -O |
| 288 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 289 | # Profile first and / or use FDO if you need better performance than this. |
| 290 | compiler_flag: "-O2" |
| 291 | |
| 292 | # Disable assertions |
| 293 | compiler_flag: "-DNDEBUG" |
| 294 | |
| 295 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 296 | compiler_flag: "-ffunction-sections" |
| 297 | compiler_flag: "-fdata-sections" |
| 298 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 299 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | toolchain { |
| 303 | abi_version: "local" |
| 304 | abi_libc_version: "local" |
| 305 | builtin_sysroot: "" |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 306 | compiler: "compiler" |
| 307 | host_system_name: "local" |
| 308 | needsPic: true |
| 309 | supports_gold_linker: false |
| 310 | supports_incremental_linker: false |
| 311 | supports_fission: false |
| 312 | supports_interface_shared_objects: false |
| 313 | supports_normalizing_ar: false |
| 314 | supports_start_end_lib: false |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 315 | target_libc: "local" |
| 316 | target_cpu: "freebsd" |
| 317 | target_system_name: "local" |
| 318 | toolchain_identifier: "local_freebsd" |
| 319 | |
| 320 | tool_path { name: "ar" path: "/usr/bin/ar" } |
| 321 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 322 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 323 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
| 324 | tool_path { name: "gcc" path: "/usr/bin/clang" } |
| 325 | cxx_flag: "-std=c++0x" |
| 326 | linker_flag: "-lstdc++" |
| 327 | linker_flag: "-B/usr/bin/" |
| 328 | |
| 329 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 330 | # used by gcc. That works because bazel currently doesn't track files at |
| 331 | # absolute locations and has no remote execution, yet. However, this will need |
| 332 | # to be fixed, maybe with auto-detection? |
Piotr Sikora | 2bb61c1 | 2016-10-21 16:00:06 +0000 | [diff] [blame] | 333 | cxx_builtin_include_directory: "/usr/lib/clang" |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 334 | cxx_builtin_include_directory: "/usr/local/include" |
| 335 | cxx_builtin_include_directory: "/usr/include" |
| 336 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
| 337 | |
| 338 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 339 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 340 | tool_path { name: "ld" path: "/usr/bin/ld" } |
| 341 | |
| 342 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 343 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 344 | objcopy_embed_flag: "-I" |
| 345 | objcopy_embed_flag: "binary" |
| 346 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 347 | tool_path { name: "strip" path: "/usr/bin/strip" } |
| 348 | |
| 349 | # Anticipated future default. |
| 350 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 351 | |
| 352 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 353 | # compiler symbols. |
| 354 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 355 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 356 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 357 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 358 | |
| 359 | # Security hardening on by default. |
| 360 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 361 | # We need to undef it before redefining it as some distributions now have |
| 362 | # it enabled by default. |
| 363 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 364 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 365 | compiler_flag: "-fstack-protector" |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 366 | linker_flag: "-Wl,-z,relro,-z,now" |
| 367 | |
| 368 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 369 | # escape sequences if --nocolor is specified. This isn't supported by gcc |
| 370 | # on Ubuntu 14.04. |
| 371 | # compiler_flag: "-fcolor-diagnostics" |
| 372 | |
| 373 | # All warnings are enabled. Maybe enable -Werror as well? |
| 374 | compiler_flag: "-Wall" |
| 375 | # Enable a few more warnings that aren't part of -Wall. |
| 376 | #compiler_flag: "-Wunused-but-set-parameter" |
| 377 | # But disable some that are problematic. |
| 378 | #compiler_flag: "-Wno-free-nonheap-object" # has false positives |
| 379 | |
| 380 | # Keep stack frames for debugging, even in opt mode. |
| 381 | compiler_flag: "-fno-omit-frame-pointer" |
| 382 | |
| 383 | # Anticipated future default. |
| 384 | linker_flag: "-no-canonical-prefixes" |
| 385 | # Have gcc return the exit code from ld. |
| 386 | #linker_flag: "-pass-exit-codes" |
| 387 | # Stamp the binary with a unique identifier. |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 388 | # Gold linker only? Can we enable this by default? |
| 389 | # linker_flag: "-Wl,--warn-execstack" |
| 390 | # linker_flag: "-Wl,--detect-odr-violations" |
| 391 | |
| 392 | compilation_mode_flags { |
| 393 | mode: DBG |
| 394 | # Enable debug symbols. |
| 395 | compiler_flag: "-g" |
| 396 | } |
| 397 | compilation_mode_flags { |
| 398 | mode: OPT |
| 399 | |
| 400 | # No debug symbols. |
| 401 | # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or |
| 402 | # even generally? However, that can't happen here, as it requires special |
| 403 | # handling in Bazel. |
| 404 | compiler_flag: "-g0" |
| 405 | |
| 406 | # Conservative choice for -O |
| 407 | # -O3 can increase binary size and even slow down the resulting binaries. |
| 408 | # Profile first and / or use FDO if you need better performance than this. |
| 409 | compiler_flag: "-O2" |
| 410 | |
| 411 | # Disable assertions |
| 412 | compiler_flag: "-DNDEBUG" |
| 413 | |
| 414 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 415 | compiler_flag: "-ffunction-sections" |
| 416 | compiler_flag: "-fdata-sections" |
| 417 | linker_flag: "-Wl,--gc-sections" |
| 418 | } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 419 | linking_mode_flags { mode: DYNAMIC } |
Doug Rabson | 709bc61 | 2015-08-25 14:12:00 +0000 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | toolchain { |
| 423 | abi_version: "local" |
| 424 | abi_libc_version: "local" |
| 425 | builtin_sysroot: "" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 426 | compiler: "windows_mingw" |
| 427 | host_system_name: "local" |
| 428 | needsPic: false |
| 429 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 430 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 431 | target_system_name: "local" |
| 432 | toolchain_identifier: "local_windows_mingw" |
| 433 | |
| 434 | tool_path { name: "ar" path: "C:/mingw/bin/ar" } |
| 435 | tool_path { name: "compat-ld" path: "C:/mingw/bin/ld" } |
| 436 | tool_path { name: "cpp" path: "C:/mingw/bin/cpp" } |
| 437 | tool_path { name: "dwp" path: "C:/mingw/bin/dwp" } |
| 438 | tool_path { name: "gcc" path: "C:/mingw/bin/gcc" } |
| 439 | cxx_flag: "-std=c++0x" |
| 440 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 441 | # used by gcc. That works because bazel currently doesn't track files at |
| 442 | # absolute locations and has no remote execution, yet. However, this will need |
| 443 | # to be fixed, maybe with auto-detection? |
| 444 | cxx_builtin_include_directory: "C:/mingw/include" |
| 445 | cxx_builtin_include_directory: "C:/mingw/lib/gcc" |
| 446 | tool_path { name: "gcov" path: "C:/mingw/bin/gcov" } |
| 447 | tool_path { name: "ld" path: "C:/mingw/bin/ld" } |
| 448 | tool_path { name: "nm" path: "C:/mingw/bin/nm" } |
| 449 | tool_path { name: "objcopy" path: "C:/mingw/bin/objcopy" } |
| 450 | objcopy_embed_flag: "-I" |
| 451 | objcopy_embed_flag: "binary" |
| 452 | tool_path { name: "objdump" path: "C:/mingw/bin/objdump" } |
| 453 | tool_path { name: "strip" path: "C:/mingw/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 454 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | toolchain { |
| 458 | abi_version: "local" |
| 459 | abi_libc_version: "local" |
| 460 | builtin_sysroot: "" |
| 461 | compiler: "windows_msys64_mingw64" |
| 462 | host_system_name: "local" |
| 463 | needsPic: false |
| 464 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 465 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 466 | target_system_name: "local" |
| 467 | toolchain_identifier: "local_windows_msys64_mingw64" |
| 468 | |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 469 | tool_path { name: "ar" path: "C:/tools/msys64/mingw64/bin/ar" } |
| 470 | tool_path { name: "compat-ld" path: "C:/tools/msys64/mingw64/bin/ld" } |
| 471 | tool_path { name: "cpp" path: "C:/tools/msys64/mingw64/bin/cpp" } |
| 472 | tool_path { name: "dwp" path: "C:/tools/msys64/mingw64/bin/dwp" } |
| 473 | tool_path { name: "gcc" path: "C:/tools/msys64/mingw64/bin/gcc" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 474 | cxx_flag: "-std=c++0x" |
| 475 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 476 | # used by gcc. That works because bazel currently doesn't track files at |
| 477 | # absolute locations and has no remote execution, yet. However, this will need |
| 478 | # to be fixed, maybe with auto-detection? |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 479 | cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include" |
| 480 | tool_path { name: "gcov" path: "C:/tools/msys64/mingw64/bin/gcov" } |
| 481 | tool_path { name: "ld" path: "C:/tools/msys64/mingw64/bin/ld" } |
| 482 | tool_path { name: "nm" path: "C:/tools/msys64/mingw64/bin/nm" } |
| 483 | tool_path { name: "objcopy" path: "C:/tools/msys64/mingw64/bin/objcopy" } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 484 | objcopy_embed_flag: "-I" |
| 485 | objcopy_embed_flag: "binary" |
Lukacs Berki | 7a5d59e | 2016-02-24 15:33:46 +0000 | [diff] [blame] | 486 | tool_path { name: "objdump" path: "C:/tools/msys64/mingw64/bin/objdump" } |
| 487 | tool_path { name: "strip" path: "C:/tools/msys64/mingw64/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 488 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 489 | } |
| 490 | |
| 491 | toolchain { |
| 492 | abi_version: "local" |
| 493 | abi_libc_version: "local" |
| 494 | builtin_sysroot: "" |
| 495 | compiler: "windows_clang" |
| 496 | host_system_name: "local" |
| 497 | needsPic: false |
| 498 | target_libc: "local" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 499 | target_cpu: "x64_windows" |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 500 | target_system_name: "local" |
| 501 | toolchain_identifier: "local_windows_clang" |
| 502 | |
| 503 | tool_path { name: "ar" path: "C:/mingw/bin/ar" } |
| 504 | tool_path { name: "compat-ld" path: "C:/Program Files (x86)/LLVM/bin/ld" } |
| 505 | tool_path { name: "cpp" path: "C:/Program Files (x86)/LLVM/bin/cpp" } |
| 506 | tool_path { name: "dwp" path: "C:/Program Files (x86)/LLVM/bin/dwp" } |
| 507 | tool_path { name: "gcc" path: "C:/Program Files (x86)/LLVM/bin/clang" } |
| 508 | cxx_flag: "-std=c++0x" |
| 509 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 510 | # used by gcc. That works because bazel currently doesn't track files at |
| 511 | # absolute locations and has no remote execution, yet. However, this will need |
| 512 | # to be fixed, maybe with auto-detection? |
| 513 | cxx_builtin_include_directory: "/usr/lib/gcc/" |
| 514 | cxx_builtin_include_directory: "/usr/local/include" |
| 515 | cxx_builtin_include_directory: "/usr/include" |
| 516 | tool_path { name: "gcov" path: "C:/Program Files (x86)/LLVM/bin/gcov" } |
| 517 | tool_path { name: "ld" path: "C:/Program Files (x86)/LLVM/bin/ld" } |
| 518 | tool_path { name: "nm" path: "C:/Program Files (x86)/LLVM/bin/nm" } |
| 519 | tool_path { name: "objcopy" path: "C:/Program Files (x86)/LLVM/bin/objcopy" } |
| 520 | objcopy_embed_flag: "-I" |
| 521 | objcopy_embed_flag: "binary" |
| 522 | tool_path { name: "objdump" path: "C:/Program Files (x86)/LLVM/bin/objdump" } |
| 523 | tool_path { name: "strip" path: "C:/Program Files (x86)/LLVM/bin/strip" } |
Googler | 3dd9cc6 | 2016-02-08 16:00:09 +0000 | [diff] [blame] | 524 | linking_mode_flags { mode: DYNAMIC } |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 525 | } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 526 | |
| 527 | toolchain { |
hlopko | 21903f9 | 2017-04-27 17:37:31 +0200 | [diff] [blame] | 528 | abi_version: "local" |
| 529 | abi_libc_version: "local" |
| 530 | builtin_sysroot: "" |
| 531 | compiler: "windows_msys64" |
| 532 | host_system_name: "local" |
| 533 | needsPic: false |
| 534 | target_libc: "local" |
| 535 | target_cpu: "x64_windows" |
| 536 | target_system_name: "local" |
| 537 | toolchain_identifier: "local_windows_msys64" |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 538 | |
hlopko | 21903f9 | 2017-04-27 17:37:31 +0200 | [diff] [blame] | 539 | tool_path { name: "ar" path: "C:/tools/msys64/usr/bin/ar" } |
| 540 | tool_path { name: "compat-ld" path: "C:/tools/msys64/usr/bin/ld" } |
| 541 | tool_path { name: "cpp" path: "C:/tools/msys64/usr/bin/cpp" } |
| 542 | tool_path { name: "dwp" path: "C:/tools/msys64/usr/bin/dwp" } |
| 543 | # Use gcc instead of g++ so that C will compile correctly. |
| 544 | tool_path { name: "gcc" path: "C:/tools/msys64/usr/bin/gcc" } |
| 545 | cxx_flag: "-std=gnu++0x" |
| 546 | linker_flag: "-lstdc++" |
| 547 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 548 | # used by gcc. That works because bazel currently doesn't track files at |
| 549 | # absolute locations and has no remote execution, yet. However, this will need |
| 550 | # to be fixed, maybe with auto-detection? |
| 551 | cxx_builtin_include_directory: "C:/tools/msys64/" |
| 552 | cxx_builtin_include_directory: "/usr/" |
| 553 | tool_path { name: "gcov" path: "C:/tools/msys64/usr/bin/gcov" } |
| 554 | tool_path { name: "ld" path: "C:/tools/msys64/usr/bin/ld" } |
| 555 | tool_path { name: "nm" path: "C:/tools/msys64/usr/bin/nm" } |
| 556 | tool_path { name: "objcopy" path: "C:/tools/msys64/usr/bin/objcopy" } |
| 557 | objcopy_embed_flag: "-I" |
| 558 | objcopy_embed_flag: "binary" |
| 559 | tool_path { name: "objdump" path: "C:/tools/msys64/usr/bin/objdump" } |
| 560 | tool_path { name: "strip" path: "C:/tools/msys64/usr/bin/strip" } |
| 561 | linking_mode_flags { mode: DYNAMIC } |
Dmitry Lomov | 458ccd0 | 2016-02-02 20:30:32 +0000 | [diff] [blame] | 562 | } |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 563 | |
| 564 | toolchain { |
| 565 | toolchain_identifier: "vc_14_0_x64" |
| 566 | host_system_name: "local" |
| 567 | target_system_name: "local" |
| 568 | |
| 569 | abi_version: "local" |
| 570 | abi_libc_version: "local" |
Yun Peng | 57be344 | 2016-04-25 14:08:41 +0000 | [diff] [blame] | 571 | target_cpu: "x64_windows_msvc" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 572 | compiler: "cl" |
| 573 | target_libc: "msvcrt140" |
| 574 | default_python_version: "python2.7" |
| 575 | cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE" |
Yun Peng | e52ebec | 2016-05-10 08:56:38 +0000 | [diff] [blame] | 576 | cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/" |
| 577 | cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/8.1/include/" |
| 578 | cxx_builtin_include_directory: "C:/Program Files (x86)/GnuWin32/include/" |
| 579 | cxx_builtin_include_directory: "C:/python_27_amd64/files/include" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 580 | tool_path { |
| 581 | name: "ar" |
| 582 | path: "wrapper/bin/msvc_link.bat" |
| 583 | } |
| 584 | tool_path { |
| 585 | name: "cpp" |
| 586 | path: "wrapper/bin/msvc_cl.bat" |
| 587 | } |
| 588 | tool_path { |
| 589 | name: "gcc" |
| 590 | path: "wrapper/bin/msvc_cl.bat" |
| 591 | } |
| 592 | tool_path { |
| 593 | name: "gcov" |
| 594 | path: "wrapper/bin/msvc_nop.bat" |
| 595 | } |
| 596 | tool_path { |
| 597 | name: "ld" |
| 598 | path: "wrapper/bin/msvc_link.bat" |
| 599 | } |
| 600 | tool_path { |
| 601 | name: "nm" |
| 602 | path: "wrapper/bin/msvc_nop.bat" |
| 603 | } |
| 604 | tool_path { |
| 605 | name: "objcopy" |
| 606 | path: "wrapper/bin/msvc_nop.bat" |
| 607 | } |
| 608 | tool_path { |
| 609 | name: "objdump" |
| 610 | path: "wrapper/bin/msvc_nop.bat" |
| 611 | } |
| 612 | tool_path { |
| 613 | name: "strip" |
| 614 | path: "wrapper/bin/msvc_nop.bat" |
| 615 | } |
| 616 | supports_gold_linker: false |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 617 | supports_start_end_lib: false |
| 618 | supports_interface_shared_objects: false |
| 619 | supports_incremental_linker: false |
| 620 | supports_normalizing_ar: true |
| 621 | needsPic: false |
| 622 | |
| 623 | compiler_flag: "-m64" |
Yun Peng | e52ebec | 2016-05-10 08:56:38 +0000 | [diff] [blame] | 624 | compiler_flag: "/D__inline__=__inline" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 625 | # TODO(pcloudy): Review those flags below, they should be defined by cl.exe |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 626 | compiler_flag: "/DCOMPILER_MSVC" |
| 627 | |
| 628 | # Don't pollute with GDI macros in windows.h. |
| 629 | compiler_flag: "/DNOGDI" |
| 630 | # Don't define min/max macros in windows.h. |
| 631 | compiler_flag: "/DNOMINMAX" |
| 632 | compiler_flag: "/DPRAGMA_SUPPORTED" |
| 633 | # Platform defines. |
Yun Peng | e52ebec | 2016-05-10 08:56:38 +0000 | [diff] [blame] | 634 | compiler_flag: "/D_WIN32_WINNT=0x0600" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 635 | # Turn off warning messages. |
| 636 | compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE" |
| 637 | compiler_flag: "/D_CRT_SECURE_NO_WARNINGS" |
| 638 | compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS" |
| 639 | # Use math constants (M_PI, etc.) from the math library |
| 640 | compiler_flag: "/D_USE_MATH_DEFINES" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 641 | |
| 642 | # Useful options to have on for compilation. |
| 643 | # Suppress startup banner. |
| 644 | compiler_flag: "/nologo" |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 645 | # Increase the capacity of object files to 2^32 sections. |
| 646 | compiler_flag: "/bigobj" |
| 647 | # Allocate 500MB for precomputed headers. |
| 648 | compiler_flag: "/Zm500" |
| 649 | # Use unsigned char by default. |
| 650 | compiler_flag: "/J" |
| 651 | # Use function level linking. |
| 652 | compiler_flag: "/Gy" |
| 653 | # Use string pooling. |
| 654 | compiler_flag: "/GF" |
| 655 | # Warning level 3 (could possibly go to 4 in the future). |
| 656 | compiler_flag: "/W3" |
| 657 | # Catch both asynchronous (structured) and synchronous (C++) exceptions. |
| 658 | compiler_flag: "/EHsc" |
| 659 | |
| 660 | # Globally disabled warnings. |
| 661 | # Don't warn about elements of array being be default initialized. |
| 662 | compiler_flag: "/wd4351" |
| 663 | # Don't warn about no matching delete found. |
| 664 | compiler_flag: "/wd4291" |
| 665 | # Don't warn about diamond inheritance patterns. |
| 666 | compiler_flag: "/wd4250" |
| 667 | # Don't warn about insecure functions (e.g. non _s functions). |
| 668 | compiler_flag: "/wd4996" |
| 669 | |
| 670 | linker_flag: "-m64" |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 671 | # Stop passing -frandom-seed option |
| 672 | feature { |
| 673 | name: 'random_seed' |
| 674 | } |
| 675 | |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 676 | action_config { |
| 677 | config_name: 'c-compile' |
| 678 | action_name: 'c-compile' |
| 679 | tool { |
| 680 | tool_path: 'wrapper/bin/msvc_cl.bat' |
| 681 | } |
| 682 | flag_set { |
| 683 | flag_group { |
| 684 | flag: '/c' |
| 685 | flag: '%{source_file}' |
| 686 | } |
| 687 | } |
| 688 | flag_set { |
| 689 | expand_if_all_available: 'output_object_file' |
| 690 | flag_group { |
| 691 | flag: '/Fo%{output_object_file}' |
| 692 | } |
| 693 | } |
| 694 | flag_set { |
| 695 | expand_if_all_available: 'output_assembly_file' |
| 696 | flag_group { |
| 697 | flag: '/Fa%{output_assembly_file}' |
| 698 | } |
| 699 | } |
| 700 | flag_set { |
| 701 | expand_if_all_available: 'output_preprocess_file' |
| 702 | flag_group { |
| 703 | flag: '/P' |
| 704 | flag: '/Fi%{output_preprocess_file}' |
| 705 | } |
| 706 | } |
| 707 | implies: 'legacy_compile_flags' |
| 708 | implies: 'user_compile_flags' |
hlopko | b05bff6 | 2017-09-12 10:51:44 +0200 | [diff] [blame] | 709 | implies: 'sysroot' |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 710 | implies: 'unfiltered_compile_flags' |
| 711 | } |
| 712 | |
| 713 | action_config { |
| 714 | config_name: 'c++-compile' |
| 715 | action_name: 'c++-compile' |
| 716 | tool { |
| 717 | tool_path: 'wrapper/bin/msvc_cl.bat' |
| 718 | } |
| 719 | flag_set { |
| 720 | flag_group { |
| 721 | flag: '/c' |
| 722 | flag: '%{source_file}' |
| 723 | } |
| 724 | } |
| 725 | flag_set { |
| 726 | expand_if_all_available: 'output_object_file' |
| 727 | flag_group { |
| 728 | flag: '/Fo%{output_object_file}' |
| 729 | } |
| 730 | } |
| 731 | flag_set { |
| 732 | expand_if_all_available: 'output_assembly_file' |
| 733 | flag_group { |
| 734 | flag: '/Fa%{output_assembly_file}' |
| 735 | } |
| 736 | } |
| 737 | flag_set { |
| 738 | expand_if_all_available: 'output_preprocess_file' |
| 739 | flag_group { |
| 740 | flag: '/P' |
| 741 | flag: '/Fi%{output_preprocess_file}' |
| 742 | } |
| 743 | } |
| 744 | implies: 'legacy_compile_flags' |
| 745 | implies: 'user_compile_flags' |
hlopko | b05bff6 | 2017-09-12 10:51:44 +0200 | [diff] [blame] | 746 | implies: 'sysroot' |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 747 | implies: 'unfiltered_compile_flags' |
| 748 | } |
| 749 | |
| 750 | # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are |
| 751 | # not used in this crosstool |
| 752 | feature { |
| 753 | name: 'legacy_compile_flags' |
| 754 | flag_set { |
| 755 | expand_if_all_available: 'legacy_compile_flags' |
| 756 | action: 'assemble' |
| 757 | action: 'preprocess-assemble' |
| 758 | action: 'c-compile' |
| 759 | action: 'c++-compile' |
| 760 | action: 'c++-header-parsing' |
| 761 | action: 'c++-header-preprocessing' |
| 762 | action: 'c++-module-compile' |
| 763 | action: 'c++-module-codegen' |
| 764 | flag_group { |
| 765 | iterate_over: 'legacy_compile_flags' |
| 766 | flag: '%{legacy_compile_flags}' |
| 767 | } |
| 768 | } |
| 769 | } |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 770 | |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 771 | feature { |
| 772 | name: 'include_paths' |
| 773 | flag_set { |
| 774 | action: 'preprocess-assemble' |
| 775 | action: 'c-compile' |
| 776 | action: 'c++-compile' |
| 777 | action: 'c++-header-parsing' |
| 778 | action: 'c++-header-preprocessing' |
| 779 | action: 'c++-module-compile' |
| 780 | flag_group { |
hlopko | ec41b8c | 2017-07-04 04:31:11 -0400 | [diff] [blame] | 781 | iterate_over: 'quote_include_paths' |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 782 | flag: '/I%{quote_include_paths}' |
| 783 | } |
| 784 | flag_group { |
hlopko | ec41b8c | 2017-07-04 04:31:11 -0400 | [diff] [blame] | 785 | iterate_over: 'include_paths' |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 786 | flag: '/I%{include_paths}' |
| 787 | } |
| 788 | flag_group { |
hlopko | ec41b8c | 2017-07-04 04:31:11 -0400 | [diff] [blame] | 789 | iterate_over: 'system_include_paths' |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 790 | flag: '/I%{system_include_paths}' |
| 791 | } |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | feature { |
| 796 | name: 'dependency_file' |
| 797 | flag_set { |
| 798 | action: 'assemble' |
| 799 | action: 'preprocess-assemble' |
| 800 | action: 'c-compile' |
| 801 | action: 'c++-compile' |
| 802 | action: 'c++-module-compile' |
| 803 | action: 'c++-header-preprocessing' |
| 804 | action: 'c++-header-parsing' |
| 805 | expand_if_all_available: 'dependency_file' |
| 806 | flag_group { |
| 807 | flag: '/DEPENDENCY_FILE' |
| 808 | flag: '%{dependency_file}' |
| 809 | } |
| 810 | } |
| 811 | } |
| 812 | |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 813 | feature { |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 814 | name: 'user_compile_flags' |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 815 | flag_set { |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 816 | expand_if_all_available: 'user_compile_flags' |
hlopko | 8328dc9 | 2017-09-06 13:34:00 +0200 | [diff] [blame] | 817 | action: 'assemble' |
| 818 | action: 'preprocess-assemble' |
| 819 | action: 'c-compile' |
| 820 | action: 'c++-compile' |
| 821 | action: 'c++-header-parsing' |
| 822 | action: 'c++-header-preprocessing' |
| 823 | action: 'c++-module-compile' |
| 824 | action: 'c++-module-codegen' |
| 825 | flag_group { |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 826 | iterate_over: 'user_compile_flags' |
| 827 | flag: '%{user_compile_flags}' |
| 828 | } |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | feature { |
hlopko | b05bff6 | 2017-09-12 10:51:44 +0200 | [diff] [blame] | 833 | name: 'sysroot' |
| 834 | flag_set { |
| 835 | expand_if_all_available: 'sysroot' |
| 836 | action: 'assemble' |
| 837 | action: 'preprocess-assemble' |
| 838 | action: 'c-compile' |
| 839 | action: 'c++-compile' |
| 840 | action: 'c++-header-parsing' |
| 841 | action: 'c++-header-preprocessing' |
| 842 | action: 'c++-module-compile' |
| 843 | action: 'c++-module-codegen' |
| 844 | action: 'c++-link-executable' |
| 845 | action: 'c++-link-dynamic-library' |
hlopko | dad2276 | 2018-03-01 13:17:23 -0800 | [diff] [blame] | 846 | action: 'c++-link-nodeps-dynamic-library' |
hlopko | b05bff6 | 2017-09-12 10:51:44 +0200 | [diff] [blame] | 847 | flag_group { |
| 848 | iterate_over: 'sysroot' |
| 849 | flag: '--sysroot=%{sysroot}' |
| 850 | } |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | feature { |
hlopko | f322ba7 | 2017-09-08 15:17:18 +0200 | [diff] [blame] | 855 | name: 'unfiltered_compile_flags' |
| 856 | flag_set { |
| 857 | expand_if_all_available: 'unfiltered_compile_flags' |
| 858 | action: 'assemble' |
| 859 | action: 'preprocess-assemble' |
| 860 | action: 'c-compile' |
| 861 | action: 'c++-compile' |
| 862 | action: 'c++-header-parsing' |
| 863 | action: 'c++-header-preprocessing' |
| 864 | action: 'c++-module-compile' |
| 865 | action: 'c++-module-codegen' |
| 866 | flag_group { |
| 867 | iterate_over: 'unfiltered_compile_flags' |
| 868 | flag: '%{unfiltered_compile_flags}' |
hlopko | 646cfd8 | 2017-08-01 22:26:37 +0200 | [diff] [blame] | 869 | } |
| 870 | } |
Yun Peng | 6b6ff76 | 2016-06-30 14:19:41 +0000 | [diff] [blame] | 871 | } |
| 872 | |
Yun Peng | 114ead3 | 2016-04-07 16:39:19 +0000 | [diff] [blame] | 873 | compilation_mode_flags { |
| 874 | mode: DBG |
| 875 | compiler_flag: "/DDEBUG=1" |
| 876 | # This will signal the wrapper that we are doing a debug build, which sets |
| 877 | # some internal state of the toolchain wrapper. It is intentionally a "-" |
| 878 | # flag to make this very obvious. |
| 879 | compiler_flag: "-g" |
| 880 | compiler_flag: "/Od" |
| 881 | compiler_flag: "-Xcompilation-mode=dbg" |
| 882 | } |
| 883 | |
| 884 | compilation_mode_flags { |
| 885 | mode: FASTBUILD |
| 886 | compiler_flag: "/DNDEBUG" |
| 887 | compiler_flag: "/Od" |
| 888 | compiler_flag: "-Xcompilation-mode=fastbuild" |
| 889 | } |
| 890 | |
| 891 | compilation_mode_flags { |
| 892 | mode: OPT |
| 893 | compiler_flag: "/DNDEBUG" |
| 894 | compiler_flag: "/O2" |
| 895 | compiler_flag: "-Xcompilation-mode=opt" |
| 896 | } |
| 897 | } |
Cal Peyser | 1b6535c | 2016-12-22 21:27:24 +0000 | [diff] [blame] | 898 | |
| 899 | # Stub crosstool to allow construction of apple crosstool configuration in a |
| 900 | # static configuration set. |
| 901 | # TODO(b/33804121): Remove this once dynamic configurations are in place. |
| 902 | toolchain { |
| 903 | toolchain_identifier: "ios_x86_64" |
| 904 | host_system_name: "x86_64-apple-macosx" |
| 905 | target_system_name: "x86_64-apple-ios" |
| 906 | target_cpu: "ios_x86_64" |
| 907 | target_libc: "ios" |
| 908 | compiler: "compiler" |
| 909 | abi_version: "local" |
| 910 | abi_libc_version: "local" |
| 911 | supports_gold_linker: false |
| 912 | supports_incremental_linker: false |
| 913 | supports_fission: false |
| 914 | supports_interface_shared_objects: false |
| 915 | supports_normalizing_ar: false |
| 916 | supports_start_end_lib: false |
| 917 | |
| 918 | tool_path { name: "ar" path: "/bin/false" } |
| 919 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 920 | tool_path { name: "cpp" path: "/bin/false" } |
| 921 | tool_path { name: "dwp" path: "/bin/false" } |
| 922 | tool_path { name: "gcc" path: "/bin/false" } |
| 923 | tool_path { name: "gcov" path: "/bin/false" } |
| 924 | tool_path { name: "ld" path: "/bin/false" } |
| 925 | |
| 926 | tool_path { name: "nm" path: "/bin/false" } |
| 927 | tool_path { name: "objcopy" path: "/bin/false" } |
| 928 | tool_path { name: "objdump" path: "/bin/false" } |
| 929 | tool_path { name: "strip" path: "/bin/false" } |
| 930 | linking_mode_flags { mode: DYNAMIC } |
| 931 | } |