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