Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame] | 1 | major_version: "local" |
| 2 | minor_version: "" |
| 3 | default_target_cpu: "same_as_host" |
| 4 | |
| 5 | default_toolchain { |
| 6 | cpu: "roborio" |
| 7 | toolchain_identifier: "roborio_linux" |
| 8 | } |
| 9 | |
| 10 | default_toolchain { |
| 11 | cpu: "k8" |
| 12 | toolchain_identifier: "k8_linux" |
| 13 | } |
| 14 | |
| 15 | default_toolchain { |
| 16 | cpu: "armeabi-v7a" |
| 17 | toolchain_identifier: "stub_armeabi-v7a" |
| 18 | } |
| 19 | |
| 20 | default_toolchain { |
| 21 | cpu: "armhf-debian" |
| 22 | toolchain_identifier: "clang_linux_armhf" |
| 23 | } |
| 24 | |
| 25 | default_toolchain { |
| 26 | cpu: "cortex-m4f" |
| 27 | toolchain_identifier: "cortex-m4f" |
| 28 | } |
| 29 | |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 30 | default_toolchain { |
| 31 | cpu: "cortex-m4f-k22" |
| 32 | toolchain_identifier: "cortex-m4f-k22" |
| 33 | } |
| 34 | |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame] | 35 | toolchain { |
| 36 | abi_version: "armeabi-v7a" |
| 37 | abi_libc_version: "armeabi-v7a" |
| 38 | builtin_sysroot: "" |
| 39 | compiler: "compiler" |
| 40 | host_system_name: "armeabi-v7a" |
| 41 | needsPic: true |
| 42 | supports_gold_linker: false |
| 43 | 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 |
| 48 | supports_thin_archives: false |
| 49 | target_libc: "armeabi-v7a" |
| 50 | target_cpu: "armeabi-v7a" |
| 51 | target_system_name: "armeabi-v7a" |
| 52 | toolchain_identifier: "stub_armeabi-v7a" |
| 53 | |
| 54 | tool_path { name: "ar" path: "/bin/false" } |
| 55 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 56 | tool_path { name: "cpp" path: "/bin/false" } |
| 57 | tool_path { name: "dwp" path: "/bin/false" } |
| 58 | tool_path { name: "gcc" path: "/bin/false" } |
| 59 | tool_path { name: "gcov" path: "/bin/false" } |
| 60 | tool_path { name: "ld" path: "/bin/false" } |
| 61 | |
| 62 | tool_path { name: "nm" path: "/bin/false" } |
| 63 | tool_path { name: "objcopy" path: "/bin/false" } |
| 64 | tool_path { name: "objdump" path: "/bin/false" } |
| 65 | tool_path { name: "strip" path: "/bin/false" } |
| 66 | } |
| 67 | |
| 68 | toolchain { |
| 69 | abi_version: "local" |
| 70 | abi_libc_version: "local" |
| 71 | builtin_sysroot: "" |
| 72 | compiler: "clang" |
| 73 | host_system_name: "local" |
| 74 | needsPic: true |
| 75 | supports_gold_linker: false |
| 76 | supports_incremental_linker: false |
| 77 | supports_fission: false |
| 78 | supports_interface_shared_objects: false |
| 79 | supports_normalizing_ar: false |
| 80 | supports_start_end_lib: false |
| 81 | supports_thin_archives: false |
| 82 | target_libc: "local" |
| 83 | target_cpu: "k8" |
| 84 | target_system_name: "k8" |
| 85 | toolchain_identifier: "k8_linux" |
| 86 | |
| 87 | # These paths are relative to //tools/cpp. |
| 88 | tool_path { name: "ar" path: "clang_3p6/x86_64-linux-gnu-ar" } |
| 89 | tool_path { name: "compat-ld" path: "clang_3p6/x86_64-linux-gnu-ld" } |
| 90 | tool_path { name: "cpp" path: "clang_3p6/x86_64-linux-gnu-cpp" } |
| 91 | tool_path { name: "dwp" path: "clang_3p6/x86_64-linux-gnu-dwp" } |
| 92 | tool_path { name: "gcc" path: "clang_3p6/x86_64-linux-gnu-clang-3.6" } |
| 93 | tool_path { name: "gcov" path: "clang_3p6/x86_64-linux-gnu-gcov" } |
| 94 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 95 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 96 | tool_path { name: "ld" path: "clang_3p6/x86_64-linux-gnu-ld" } |
| 97 | tool_path { name: "nm" path: "clang_3p6/x86_64-linux-gnu-nm" } |
| 98 | tool_path { name: "objcopy" path: "clang_3p6/x86_64-linux-gnu-objcopy" } |
| 99 | objcopy_embed_flag: "-I" |
| 100 | objcopy_embed_flag: "binary" |
| 101 | tool_path { name: "objdump" path: "clang_3p6/x86_64-linux-gnu-objdump" } |
| 102 | tool_path { name: "strip" path: "clang_3p6/x86_64-linux-gnu-strip" } |
| 103 | linking_mode_flags { mode: DYNAMIC } |
| 104 | |
| 105 | compiler_flag: "--sysroot=external/clang_3p6_repo/" |
| 106 | compiler_flag: "-nostdinc" |
| 107 | compiler_flag: "-isystem" |
| 108 | compiler_flag: "external/clang_3p6_repo/usr/include", |
| 109 | compiler_flag: "-isystem" |
| 110 | compiler_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu", |
| 111 | compiler_flag: "-isystem" |
| 112 | compiler_flag: "external/clang_3p6_repo/usr/lib/llvm-3.6/lib/clang/3.6.2/include", |
| 113 | |
| 114 | cxx_flag: "-isystem" |
| 115 | cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9" |
| 116 | cxx_flag: "-isystem" |
| 117 | cxx_flag: "external/clang_3p6_repo/usr/include/x86_64-linux-gnu/c++/4.9" |
| 118 | cxx_flag: "-isystem" |
| 119 | cxx_flag: "external/clang_3p6_repo/usr/include/c++/4.9/backward" |
| 120 | |
| 121 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 122 | # used by gcc. That works because bazel currently doesn't track files at |
| 123 | # absolute locations and has no remote execution, yet. However, this will need |
| 124 | # to be fixed, maybe with auto-detection? |
| 125 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9' |
| 126 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu/c++/4.9' |
| 127 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/c++/4.9/backward' |
| 128 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/local/include' |
| 129 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/llvm-3.6/lib/clang/3.6.2/include' |
| 130 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include/x86_64-linux-gnu' |
| 131 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/include' |
| 132 | cxx_builtin_include_directory: '%package(@clang_3p6_repo//usr)%/lib/clang/3.6.2/include' |
| 133 | |
| 134 | linker_flag: "-nodefaultlibs" |
| 135 | linker_flag: "--sysroot=external/clang_3p6_repo/" |
| 136 | linker_flag: "-lstdc++" |
| 137 | linker_flag: "-lc" |
| 138 | linker_flag: "-lgcc" |
| 139 | linker_flag: "-lgcc_s" |
| 140 | linker_flag: "-Bexternal/clang_3p6_repo/usr/bin/" |
| 141 | linker_flag: "-Ltools/cpp/clang_3p6/clang_more_libs" |
| 142 | linker_flag: "-Lexternal/clang_3p6/lib/x86_64-linux-gnu" |
| 143 | linker_flag: "-Lexternal/clang_3p6/usr/lib/x86_64-linux-gnu" |
| 144 | linker_flag: "-Lexternal/clang_3p6/usr/lib/gcc/x86_64-linux-gnu" |
| 145 | |
| 146 | feature { |
| 147 | name: "opt" |
| 148 | implies: "all_modes" |
| 149 | flag_set { |
| 150 | action: "preprocess-assemble" |
| 151 | action: "c-compile" |
| 152 | action: "c++-compile" |
| 153 | action: "c++-header-parsing" |
| 154 | action: "c++-header-preprocessing" |
| 155 | action: "c++-module-compile" |
| 156 | flag_group { |
| 157 | flag: "-DAOS_DEBUG=0" |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | feature { |
| 163 | name: "dbg" |
| 164 | implies: "all_modes" |
| 165 | flag_set { |
| 166 | action: "preprocess-assemble" |
| 167 | action: "c-compile" |
| 168 | action: "c++-compile" |
| 169 | action: "c++-header-parsing" |
| 170 | action: "c++-header-preprocessing" |
| 171 | action: "c++-module-compile" |
| 172 | flag_group { |
| 173 | flag: "-DAOS_DEBUG=1" |
| 174 | } |
| 175 | flag_group { |
| 176 | flag: "-fno-omit-frame-pointer" |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | feature { |
| 182 | name: "fastbuild" |
| 183 | implies: "all_modes" |
| 184 | flag_set { |
| 185 | action: "preprocess-assemble" |
| 186 | action: "c-compile" |
| 187 | action: "c++-compile" |
| 188 | action: "c++-header-parsing" |
| 189 | action: "c++-header-preprocessing" |
| 190 | action: "c++-module-compile" |
| 191 | flag_group { |
| 192 | flag: "-DAOS_DEBUG=0" |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | feature { |
| 198 | name: "all_modes" |
| 199 | flag_set { |
| 200 | action: "preprocess-assemble" |
| 201 | action: "assemble" |
| 202 | action: "c-compile" |
| 203 | flag_group { |
| 204 | flag: "-std=gnu99" |
| 205 | } |
| 206 | } |
| 207 | flag_set { |
| 208 | action: "c++-compile" |
| 209 | action: "c++-header-parsing" |
| 210 | action: "c++-header-preprocessing" |
| 211 | action: "c++-module-compile" |
| 212 | flag_group { |
| 213 | flag: "-std=gnu++1y" |
| 214 | } |
| 215 | } |
| 216 | flag_set { |
| 217 | action: "preprocess-assemble" |
| 218 | action: "assemble" |
| 219 | action: "c++-link" |
| 220 | action: "c++-compile" |
| 221 | action: "c++-header-parsing" |
| 222 | action: "c++-header-preprocessing" |
| 223 | action: "c++-module-compile" |
| 224 | action: "c-compile" |
| 225 | flag_group { |
| 226 | # We always want to compile with -pthread semantics. |
| 227 | flag: "-pthread" |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | # Anticipated future default. |
| 233 | # This makes GCC and Clang do what we want when called through symlinks. |
| 234 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 235 | linker_flag: "-no-canonical-prefixes" |
| 236 | |
| 237 | # Things that the code wants defined. |
| 238 | compiler_flag: "-D__STDC_FORMAT_MACROS" |
| 239 | compiler_flag: "-D__STDC_CONSTANT_MACROS" |
| 240 | compiler_flag: "-D__STDC_LIMIT_MACROS" |
| 241 | compiler_flag: "-D_FILE_OFFSET_BITS=64" |
| 242 | # TODO(Brian): Rename this or something. |
| 243 | compiler_flag: "-DAOS_ARCHITECTURE_arm_frc" |
| 244 | |
| 245 | linker_flag: "-fuse-ld=gold" |
| 246 | |
| 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 | # We need to undef it before redefining it as some distributions now have |
| 257 | # it enabled by default. |
| 258 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 259 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 260 | compiler_flag: "-fstack-protector" |
| 261 | compiler_flag: "-fPIE" |
| 262 | linker_flag: "-Wl,-z,relro,-z,now" |
| 263 | |
| 264 | # Pretty much everything needs this, including parts of the glibc STL... |
| 265 | linker_flag: "-lm" |
| 266 | |
| 267 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 268 | # escape sequences if --nocolor is specified. |
| 269 | compiler_flag: "-fcolor-diagnostics" |
| 270 | compiler_flag: "-fmessage-length=80" |
| 271 | compiler_flag: "-fmacro-backtrace-limit=0" |
| 272 | |
| 273 | compiler_flag: "-Wall" |
| 274 | compiler_flag: "-Wextra" |
| 275 | compiler_flag: "-Wpointer-arith" |
| 276 | compiler_flag: "-Wstrict-aliasing" |
| 277 | compiler_flag: "-Wcast-qual" |
| 278 | compiler_flag: "-Wcast-align" |
| 279 | compiler_flag: "-Wwrite-strings" |
| 280 | compiler_flag: "-Wtype-limits" |
| 281 | compiler_flag: "-Wsign-compare" |
| 282 | compiler_flag: "-Wformat=2" |
| 283 | compiler_flag: "-Werror" |
| 284 | |
| 285 | # Keep stack frames for debugging, even in opt mode. |
| 286 | compiler_flag: "-fno-omit-frame-pointer" |
| 287 | |
| 288 | # Don't use temp files while compiling. |
| 289 | compiler_flag: "-pipe" |
| 290 | |
| 291 | # Stamp the binary with a unique identifier. |
| 292 | linker_flag: "-Wl,--build-id=md5" |
| 293 | linker_flag: "-Wl,--hash-style=gnu" |
| 294 | linker_flag: "-Wl,--warn-execstack" |
| 295 | linker_flag: "-Wl,--detect-odr-violations" |
| 296 | |
| 297 | # Enable debug symbols. |
| 298 | compiler_flag: "-ggdb3" |
| 299 | |
| 300 | compilation_mode_flags { |
| 301 | mode: OPT |
| 302 | |
| 303 | compiler_flag: "-O2" |
| 304 | |
| 305 | # Disable assertions |
| 306 | compiler_flag: "-DNDEBUG" |
| 307 | |
| 308 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 309 | compiler_flag: "-ffunction-sections" |
| 310 | compiler_flag: "-fdata-sections" |
| 311 | linker_flag: "-Wl,--gc-sections" |
| 312 | } |
| 313 | feature { |
| 314 | name: "pie_for_linking" |
| 315 | enabled: true |
| 316 | flag_set { |
| 317 | action: "c++-link-executable" |
| 318 | flag_group { |
| 319 | flag: "-pie" |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | toolchain { |
| 326 | abi_version: "roborio" |
| 327 | abi_libc_version: "roborio" |
| 328 | builtin_sysroot: "" |
| 329 | compiler: "gcc" |
| 330 | host_system_name: "roborio" |
| 331 | needsPic: true |
| 332 | supports_gold_linker: false |
| 333 | supports_incremental_linker: false |
| 334 | supports_fission: false |
| 335 | supports_interface_shared_objects: false |
| 336 | supports_normalizing_ar: false |
| 337 | supports_start_end_lib: false |
| 338 | supports_thin_archives: false |
| 339 | target_libc: "roborio" |
| 340 | target_cpu: "roborio" |
| 341 | target_system_name: "roborio" |
| 342 | toolchain_identifier: "roborio_linux" |
| 343 | |
| 344 | tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" } |
| 345 | tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" } |
| 346 | tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" } |
| 347 | tool_path { name: "dwp" path: "/bin/false" } |
| 348 | tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" } |
| 349 | tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" } |
| 350 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 351 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 352 | tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" } |
| 353 | tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" } |
| 354 | tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" } |
| 355 | objcopy_embed_flag: "-I" |
| 356 | objcopy_embed_flag: "binary" |
| 357 | tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" } |
| 358 | tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" } |
| 359 | linking_mode_flags { mode: DYNAMIC } |
| 360 | |
| 361 | compiler_flag: "--sysroot=external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi" |
| 362 | compiler_flag: "-nostdinc" |
| 363 | compiler_flag: "-isystem" |
| 364 | compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include", |
| 365 | compiler_flag: "-isystem" |
| 366 | compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed" |
| 367 | compiler_flag: "-isystem" |
| 368 | compiler_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include" |
| 369 | |
| 370 | cxx_flag: "-isystem" |
| 371 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0" |
| 372 | cxx_flag: "-isystem" |
| 373 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0/arm-frc-linux-gnueabi" |
| 374 | cxx_flag: "-isystem" |
| 375 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include/c++/5.4.0/backward" |
| 376 | cxx_flag: "-isystem" |
| 377 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include" |
| 378 | cxx_flag: "-isystem" |
| 379 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed" |
| 380 | cxx_flag: "-isystem" |
| 381 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/include" |
| 382 | cxx_flag: "-isystem" |
| 383 | cxx_flag: "external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/usr/include" |
| 384 | |
| 385 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 386 | # used by gcc. That works because bazel currently doesn't track files at |
| 387 | # absolute locations and has no remote execution, yet. However, this will need |
| 388 | # to be fixed, maybe with auto-detection? |
| 389 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0" |
| 390 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0/arm-frc-linux-gnueabi" |
| 391 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%/c++/5.4.0/backward" |
| 392 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include)%" |
| 393 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/5.4.0/include-fixed)%" |
| 394 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/include)%" |
| 395 | cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/usr/include)%" |
| 396 | |
| 397 | linker_flag: "-lstdc++" |
| 398 | linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs" |
| 399 | |
| 400 | feature { |
| 401 | name: "opt" |
| 402 | implies: "all_modes" |
| 403 | flag_set { |
| 404 | action: "preprocess-assemble" |
| 405 | action: "c-compile" |
| 406 | action: "c++-compile" |
| 407 | action: "c++-header-parsing" |
| 408 | action: "c++-header-preprocessing" |
| 409 | action: "c++-module-compile" |
| 410 | flag_group { |
| 411 | flag: "-DAOS_DEBUG=0" |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | feature { |
| 417 | name: "dbg" |
| 418 | implies: "all_modes" |
| 419 | flag_set { |
| 420 | action: "preprocess-assemble" |
| 421 | action: "c-compile" |
| 422 | action: "c++-compile" |
| 423 | action: "c++-header-parsing" |
| 424 | action: "c++-header-preprocessing" |
| 425 | action: "c++-module-compile" |
| 426 | flag_group { |
| 427 | flag: "-DAOS_DEBUG=1" |
| 428 | } |
| 429 | flag_group { |
| 430 | flag: "-fno-omit-frame-pointer" |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | feature { |
| 436 | name: "fastbuild" |
| 437 | implies: "all_modes" |
| 438 | flag_set { |
| 439 | action: "preprocess-assemble" |
| 440 | action: "c-compile" |
| 441 | action: "c++-compile" |
| 442 | action: "c++-header-parsing" |
| 443 | action: "c++-header-preprocessing" |
| 444 | action: "c++-module-compile" |
| 445 | flag_group { |
| 446 | flag: "-DAOS_DEBUG=0" |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | feature { |
| 452 | name: "all_modes" |
| 453 | flag_set { |
| 454 | action: "preprocess-assemble" |
| 455 | action: "assemble" |
| 456 | action: "c-compile" |
| 457 | flag_group { |
| 458 | flag: "-std=gnu99" |
| 459 | } |
| 460 | } |
| 461 | flag_set { |
| 462 | action: "c++-compile" |
| 463 | action: "c++-header-parsing" |
| 464 | action: "c++-header-preprocessing" |
| 465 | action: "c++-module-compile" |
| 466 | flag_group { |
| 467 | flag: "-std=gnu++1y" |
| 468 | } |
| 469 | } |
| 470 | flag_set { |
| 471 | action: "preprocess-assemble" |
| 472 | action: "assemble" |
| 473 | action: "c++-link" |
| 474 | action: "c++-compile" |
| 475 | action: "c++-header-parsing" |
| 476 | action: "c++-header-preprocessing" |
| 477 | action: "c++-module-compile" |
| 478 | action: "c-compile" |
| 479 | flag_group { |
| 480 | # We always want to compile with -pthread semantics. |
| 481 | flag: "-pthread" |
| 482 | } |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | compiler_flag: "-mfpu=neon" |
| 487 | # TODO(brians): See if it will run with this enabled. |
| 488 | #compiler_flag: "-mhwdiv=arm,thumb" |
| 489 | |
| 490 | # Anticipated future default. |
| 491 | # This makes GCC and Clang do what we want when called through symlinks. |
| 492 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 493 | linker_flag: "-no-canonical-prefixes" |
| 494 | |
| 495 | # Things that the code wants defined. |
| 496 | compiler_flag: "-D__STDC_FORMAT_MACROS" |
| 497 | compiler_flag: "-D__STDC_CONSTANT_MACROS" |
| 498 | compiler_flag: "-D__STDC_LIMIT_MACROS" |
| 499 | compiler_flag: "-D_FILE_OFFSET_BITS=64" |
| 500 | # TODO(Brian): Rename this or something. |
| 501 | compiler_flag: "-DAOS_ARCHITECTURE_arm_frc" |
| 502 | |
| 503 | #linker_flag: "-fuse-ld=gold" |
| 504 | |
| 505 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 506 | # compiler symbols. |
| 507 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 508 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 509 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 510 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 511 | |
| 512 | # Security hardening on by default. |
| 513 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 514 | # We need to undef it before redefining it as some distributions now have |
| 515 | # it enabled by default. |
| 516 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 517 | compiler_flag: "-fstack-protector" |
| 518 | compiler_flag: "-fPIE" |
| 519 | linker_flag: "-Wl,-z,relro,-z,now" |
| 520 | |
| 521 | # Pretty much everything needs this, including parts of the glibc STL... |
| 522 | linker_flag: "-lm" |
| 523 | |
| 524 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 525 | # escape sequences if --nocolor is specified. |
| 526 | compiler_flag: "-fdiagnostics-color=always" |
| 527 | |
| 528 | compiler_flag: "-Wall" |
| 529 | compiler_flag: "-Wextra" |
| 530 | compiler_flag: "-Wpointer-arith" |
| 531 | compiler_flag: "-Wstrict-aliasing" |
| 532 | compiler_flag: "-Wcast-qual" |
| 533 | compiler_flag: "-Wcast-align" |
| 534 | compiler_flag: "-Wwrite-strings" |
| 535 | compiler_flag: "-Wtype-limits" |
| 536 | compiler_flag: "-Wsign-compare" |
| 537 | compiler_flag: "-Wformat=2" |
| 538 | compiler_flag: "-Werror" |
| 539 | compiler_flag: "-Wunused-local-typedefs" |
| 540 | |
| 541 | # Keep stack frames for debugging, even in opt mode. |
| 542 | compiler_flag: "-fno-omit-frame-pointer" |
| 543 | compiler_flag: "-D__has_feature(x)=0" |
| 544 | |
| 545 | # Don't use temp files while compiling. |
| 546 | compiler_flag: "-pipe" |
| 547 | |
| 548 | # Have GCC return the exit code from ld. |
| 549 | linker_flag: "-pass-exit-codes" |
| 550 | |
| 551 | # Stamp the binary with a unique identifier. |
| 552 | linker_flag: "-Wl,--build-id=md5" |
| 553 | linker_flag: "-Wl,--hash-style=gnu" |
| 554 | #linker_flag: "-Wl,--warn-execstack" |
| 555 | #linker_flag: "-Wl,--detect-odr-violations" |
| 556 | |
| 557 | # Enable debug symbols. |
| 558 | compiler_flag: "-ggdb3" |
| 559 | |
| 560 | compilation_mode_flags { |
| 561 | mode: OPT |
| 562 | |
| 563 | compiler_flag: "-O2" |
| 564 | |
| 565 | # Disable assertions |
| 566 | compiler_flag: "-DNDEBUG" |
| 567 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 568 | |
| 569 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 570 | compiler_flag: "-ffunction-sections" |
| 571 | compiler_flag: "-fdata-sections" |
| 572 | linker_flag: "-Wl,--gc-sections" |
| 573 | } |
| 574 | feature { |
| 575 | name: "pie_for_linking" |
| 576 | enabled: true |
| 577 | flag_set { |
| 578 | action: "c++-link-executable" |
| 579 | flag_group { |
| 580 | flag: "-pie" |
| 581 | } |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | toolchain { |
| 587 | abi_version: "clang_3.6" |
| 588 | abi_libc_version: "glibc_2.19" |
| 589 | builtin_sysroot: "" |
| 590 | compiler: "clang" |
| 591 | host_system_name: "linux" |
| 592 | needsPic: true |
| 593 | supports_gold_linker: false |
| 594 | supports_incremental_linker: false |
| 595 | supports_fission: false |
| 596 | supports_interface_shared_objects: false |
| 597 | supports_normalizing_ar: true |
| 598 | supports_start_end_lib: false |
| 599 | supports_thin_archives: true |
| 600 | target_libc: "glibc_2.19" |
| 601 | target_cpu: "armhf-debian" |
| 602 | target_system_name: "arm_a15" |
| 603 | toolchain_identifier: "clang_linux_armhf" |
| 604 | |
| 605 | tool_path { name: "ar" path: "linaro_linux_gcc/arm-linux-gnueabihf-ar" } |
| 606 | tool_path { name: "compat-ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" } |
| 607 | tool_path { name: "cpp" path: "linaro_linux_gcc/clang_bin/clang" } |
| 608 | tool_path { name: "dwp" path: "linaro_linux_gcc/arm-linux-gnueabihf-dwp" } |
| 609 | tool_path { name: "gcc" path: "linaro_linux_gcc/clang_bin/clang" } |
| 610 | tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" } |
| 611 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 612 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 613 | tool_path { name: "ld" path: "linaro_linux_gcc/arm-linux-gnueabihf-ld" } |
| 614 | tool_path { name: "nm" path: "linaro_linux_gcc/arm-linux-gnueabihf-nm" } |
| 615 | tool_path { name: "objcopy" path: "linaro_linux_gcc/arm-linux-gnueabihf-objcopy" } |
| 616 | objcopy_embed_flag: "-I" |
| 617 | objcopy_embed_flag: "binary" |
| 618 | tool_path { name: "objdump" path: "linaro_linux_gcc/arm-linux-gnueabihf-objdump" } |
| 619 | tool_path { name: "strip" path: "linaro_linux_gcc/arm-linux-gnueabihf-strip" } |
| 620 | linking_mode_flags { mode: DYNAMIC } |
| 621 | |
| 622 | compiler_flag: "-target" |
| 623 | compiler_flag: "armv7a-arm-linux-gnueabif" |
| 624 | compiler_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc" |
| 625 | compiler_flag: "-mfloat-abi=hard" |
| 626 | compiler_flag: "-mfpu=vfpv3-d16" |
| 627 | |
| 628 | compiler_flag: "-nostdinc" |
| 629 | compiler_flag: "-isystem" |
| 630 | compiler_flag: "/usr/lib/clang/3.6/include" |
| 631 | compiler_flag: "-isystem" |
| 632 | compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include" |
| 633 | compiler_flag: "-isystem" |
| 634 | compiler_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/include" |
| 635 | compiler_flag: "-isystem" |
| 636 | compiler_flag: "external/linaro_linux_gcc_4_9_repo/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed" |
| 637 | cxx_flag: "-isystem" |
| 638 | cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3/arm-linux-gnueabihf" |
| 639 | cxx_flag: "-isystem" |
| 640 | cxx_flag: "external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/include/c++/4.9.3" |
| 641 | cxx_flag: "-isystem" |
| 642 | cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3/arm-linux-gnueabihf" |
| 643 | cxx_flag: "-isystem" |
| 644 | cxx_flag: "external/linaro_linux_gcc_4_9_repo/include/c++/4.9.3" |
| 645 | |
| 646 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%" |
| 647 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/include)%" |
| 648 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/usr/lib/include)%" |
| 649 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%" |
| 650 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//include)%/c++/4.9.3" |
| 651 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include)%" |
| 652 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/libc/lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%" |
| 653 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include)%" |
| 654 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//lib/gcc/arm-linux-gnueabihf/4.9.3/include-fixed)%" |
| 655 | cxx_builtin_include_directory: "%package(@linaro_linux_gcc_4_9_repo//arm-linux-gnueabihf/include)%/c++/4.9.3" |
| 656 | cxx_builtin_include_directory: '/usr/lib/clang/3.6/include' |
| 657 | |
| 658 | linker_flag: "-target" |
| 659 | linker_flag: "armv7a-arm-linux-gnueabif" |
| 660 | linker_flag: "--sysroot=external/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc" |
| 661 | linker_flag: "-lstdc++" |
| 662 | linker_flag: "-Ltools/cpp/linaro_linux_gcc/clang_more_libs" |
| 663 | linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/lib" |
| 664 | linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/lib" |
| 665 | linker_flag: "-Lexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/libc/usr/lib" |
| 666 | linker_flag: "-Bexternal/linaro_linux_gcc_4_9_repo/arm-linux-gnueabihf/bin" |
| 667 | linker_flag: "-Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3" |
| 668 | |
| 669 | feature { |
| 670 | name: "opt" |
| 671 | implies: "all_modes" |
| 672 | flag_set { |
| 673 | action: "preprocess-assemble" |
| 674 | action: "c-compile" |
| 675 | action: "c++-compile" |
| 676 | action: "c++-header-parsing" |
| 677 | action: "c++-header-preprocessing" |
| 678 | action: "c++-module-compile" |
| 679 | flag_group { |
| 680 | flag: "-DAOS_DEBUG=0" |
| 681 | } |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | feature { |
| 686 | name: "dbg" |
| 687 | implies: "all_modes" |
| 688 | flag_set { |
| 689 | action: "preprocess-assemble" |
| 690 | action: "c-compile" |
| 691 | action: "c++-compile" |
| 692 | action: "c++-header-parsing" |
| 693 | action: "c++-header-preprocessing" |
| 694 | action: "c++-module-compile" |
| 695 | flag_group { |
| 696 | flag: "-DAOS_DEBUG=1" |
| 697 | } |
| 698 | flag_group { |
| 699 | flag: "-fno-omit-frame-pointer" |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | feature { |
| 705 | name: "fastbuild" |
| 706 | implies: "all_modes" |
| 707 | flag_set { |
| 708 | action: "preprocess-assemble" |
| 709 | action: "c-compile" |
| 710 | action: "c++-compile" |
| 711 | action: "c++-header-parsing" |
| 712 | action: "c++-header-preprocessing" |
| 713 | action: "c++-module-compile" |
| 714 | flag_group { |
| 715 | flag: "-DAOS_DEBUG=0" |
| 716 | } |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | feature { |
| 721 | name: "all_modes" |
| 722 | flag_set { |
| 723 | action: "preprocess-assemble" |
| 724 | action: "assemble" |
| 725 | action: "c-compile" |
| 726 | flag_group { |
| 727 | flag: "-std=gnu99" |
| 728 | } |
| 729 | } |
| 730 | flag_set { |
| 731 | action: "c++-compile" |
| 732 | action: "c++-header-parsing" |
| 733 | action: "c++-header-preprocessing" |
| 734 | action: "c++-module-compile" |
| 735 | flag_group { |
| 736 | flag: "-std=gnu++1y" |
| 737 | } |
| 738 | } |
| 739 | flag_set { |
| 740 | action: "preprocess-assemble" |
| 741 | action: "assemble" |
| 742 | action: "c++-link" |
| 743 | action: "c++-compile" |
| 744 | action: "c++-header-parsing" |
| 745 | action: "c++-header-preprocessing" |
| 746 | action: "c++-module-compile" |
| 747 | action: "c-compile" |
| 748 | flag_group { |
| 749 | # We always want to compile with -pthread semantics. |
| 750 | flag: "-pthread" |
| 751 | } |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | # Anticipated future default. |
| 756 | # This makes GCC and Clang do what we want when called through symlinks. |
| 757 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 758 | linker_flag: "-no-canonical-prefixes" |
| 759 | |
| 760 | # Things that the code wants defined. |
| 761 | compiler_flag: "-D__STDC_FORMAT_MACROS" |
| 762 | compiler_flag: "-D__STDC_CONSTANT_MACROS" |
| 763 | compiler_flag: "-D__STDC_LIMIT_MACROS" |
| 764 | compiler_flag: "-D_FILE_OFFSET_BITS=64" |
| 765 | # TODO(Brian): Rename this or something. |
| 766 | compiler_flag: "-DAOS_ARCHITECTURE_armhf" |
| 767 | |
| 768 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 769 | # compiler symbols. |
| 770 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 771 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 772 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 773 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 774 | |
| 775 | # Security hardening on by default. |
| 776 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 777 | # We need to undef it before redefining it as some distributions now have |
| 778 | # it enabled by default. |
| 779 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 780 | compiler_flag: "-fstack-protector" |
| 781 | compiler_flag: "-fPIE" |
| 782 | linker_flag: "-Wl,-z,relro,-z,now" |
| 783 | |
| 784 | # Pretty much everything needs this, including parts of the glibc STL... |
| 785 | linker_flag: "-lm" |
| 786 | |
| 787 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 788 | # escape sequences if --nocolor is specified. |
| 789 | compiler_flag: "-fdiagnostics-color=always" |
| 790 | |
| 791 | compiler_flag: "-Wall" |
| 792 | compiler_flag: "-Wextra" |
| 793 | compiler_flag: "-Wpointer-arith" |
| 794 | compiler_flag: "-Wstrict-aliasing" |
| 795 | compiler_flag: "-Wcast-qual" |
| 796 | compiler_flag: "-Wcast-align" |
| 797 | compiler_flag: "-Wwrite-strings" |
| 798 | compiler_flag: "-Wtype-limits" |
| 799 | compiler_flag: "-Wsign-compare" |
| 800 | compiler_flag: "-Wformat=2" |
| 801 | compiler_flag: "-Werror" |
| 802 | compiler_flag: "-Wunused-local-typedefs" |
| 803 | |
| 804 | # Keep stack frames for debugging, even in opt mode. |
| 805 | compiler_flag: "-fno-omit-frame-pointer" |
| 806 | |
| 807 | # Don't use temp files while compiling. |
| 808 | compiler_flag: "-pipe" |
| 809 | |
| 810 | # Stamp the binary with a unique identifier. |
| 811 | linker_flag: "-Wl,--build-id=md5" |
| 812 | linker_flag: "-Wl,--hash-style=gnu" |
| 813 | #linker_flag: "-Wl,--warn-execstack" |
| 814 | #linker_flag: "-Wl,--detect-odr-violations" |
| 815 | |
| 816 | # Enable debug symbols. |
| 817 | compiler_flag: "-ggdb3" |
| 818 | |
| 819 | compilation_mode_flags { |
| 820 | mode: OPT |
| 821 | |
| 822 | compiler_flag: "-O2" |
| 823 | |
| 824 | # Disable assertions |
| 825 | compiler_flag: "-DNDEBUG" |
| 826 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 827 | |
| 828 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 829 | compiler_flag: "-ffunction-sections" |
| 830 | compiler_flag: "-fdata-sections" |
| 831 | linker_flag: "-Wl,--gc-sections" |
| 832 | } |
| 833 | feature { |
| 834 | name: "pie_for_linking" |
| 835 | enabled: true |
| 836 | flag_set { |
| 837 | action: "c++-link-executable" |
| 838 | flag_group { |
| 839 | flag: "-pie" |
| 840 | } |
| 841 | } |
| 842 | } |
| 843 | } |