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 | |
| 20 | |
| 21 | toolchain { |
| 22 | abi_version: "armeabi-v7a" |
| 23 | abi_libc_version: "armeabi-v7a" |
| 24 | builtin_sysroot: "" |
| 25 | compiler: "compiler" |
| 26 | host_system_name: "armeabi-v7a" |
| 27 | needsPic: true |
| 28 | supports_gold_linker: false |
| 29 | supports_incremental_linker: false |
| 30 | supports_fission: false |
| 31 | supports_interface_shared_objects: false |
| 32 | supports_normalizing_ar: false |
| 33 | supports_start_end_lib: false |
| 34 | supports_thin_archives: false |
| 35 | target_libc: "armeabi-v7a" |
| 36 | target_cpu: "armeabi-v7a" |
| 37 | target_system_name: "armeabi-v7a" |
| 38 | toolchain_identifier: "stub_armeabi-v7a" |
| 39 | |
| 40 | tool_path { name: "ar" path: "/bin/false" } |
| 41 | tool_path { name: "compat-ld" path: "/bin/false" } |
| 42 | tool_path { name: "cpp" path: "/bin/false" } |
| 43 | tool_path { name: "dwp" path: "/bin/false" } |
| 44 | tool_path { name: "gcc" path: "/bin/false" } |
| 45 | tool_path { name: "gcov" path: "/bin/false" } |
| 46 | tool_path { name: "ld" path: "/bin/false" } |
| 47 | |
| 48 | tool_path { name: "nm" path: "/bin/false" } |
| 49 | tool_path { name: "objcopy" path: "/bin/false" } |
| 50 | tool_path { name: "objdump" path: "/bin/false" } |
| 51 | tool_path { name: "strip" path: "/bin/false" } |
| 52 | } |
| 53 | |
| 54 | toolchain { |
| 55 | abi_version: "local" |
| 56 | abi_libc_version: "local" |
| 57 | builtin_sysroot: "" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 58 | compiler: "clang" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 59 | host_system_name: "local" |
| 60 | needsPic: true |
| 61 | supports_gold_linker: false |
| 62 | supports_incremental_linker: false |
| 63 | supports_fission: false |
| 64 | supports_interface_shared_objects: false |
| 65 | supports_normalizing_ar: false |
| 66 | supports_start_end_lib: false |
| 67 | supports_thin_archives: false |
| 68 | target_libc: "local" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 69 | target_cpu: "k8" |
| 70 | target_system_name: "k8" |
| 71 | toolchain_identifier: "k8_linux" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 72 | |
| 73 | tool_path { name: "ar" path: "/usr/bin/ar" } |
| 74 | tool_path { name: "compat-ld" path: "/usr/bin/ld" } |
| 75 | tool_path { name: "cpp" path: "/usr/bin/cpp" } |
| 76 | tool_path { name: "dwp" path: "/usr/bin/dwp" } |
| 77 | tool_path { name: "gcc" path: "/usr/bin/clang-3.6" } |
| 78 | tool_path { name: "gcov" path: "/usr/bin/gcov" } |
| 79 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 80 | # to find libraries), but we provide LD so other rules can invoke the linker. |
| 81 | tool_path { name: "ld" path: "/usr/bin/ld" } |
| 82 | tool_path { name: "nm" path: "/usr/bin/nm" } |
| 83 | tool_path { name: "objcopy" path: "/usr/bin/objcopy" } |
| 84 | objcopy_embed_flag: "-I" |
| 85 | objcopy_embed_flag: "binary" |
| 86 | tool_path { name: "objdump" path: "/usr/bin/objdump" } |
| 87 | tool_path { name: "strip" path: "/usr/bin/strip" } |
| 88 | |
| 89 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 90 | # used by gcc. That works because bazel currently doesn't track files at |
| 91 | # absolute locations and has no remote execution, yet. However, this will need |
| 92 | # to be fixed, maybe with auto-detection? |
Austin Schuh | 7b684d3 | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 93 | cxx_builtin_include_directory: '/usr/include/c++/4.9' |
| 94 | cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu/c++/4.9' |
| 95 | cxx_builtin_include_directory: '/usr/include/c++/4.9/backward' |
| 96 | cxx_builtin_include_directory: '/usr/local/include' |
| 97 | cxx_builtin_include_directory: '/usr/lib/llvm-3.6/lib/clang/3.6.2/include' |
| 98 | cxx_builtin_include_directory: '/usr/include/x86_64-linux-gnu' |
| 99 | cxx_builtin_include_directory: '/usr/include' |
| 100 | cxx_builtin_include_directory: '/usr/lib/clang/3.6.2/include/' |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 101 | |
| 102 | linker_flag: "-lstdc++" |
| 103 | linker_flag: "-B/usr/bin/" |
| 104 | |
| 105 | feature { |
| 106 | name: "opt" |
| 107 | implies: "all_modes" |
| 108 | flag_set { |
| 109 | action: "preprocess-assemble" |
| 110 | action: "c-compile" |
| 111 | action: "c++-compile" |
| 112 | action: "c++-header-parsing" |
| 113 | action: "c++-header-preprocessing" |
| 114 | action: "c++-module-compile" |
| 115 | flag_group { |
| 116 | flag: "-DAOS_DEBUG=0" |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | feature { |
| 122 | name: "dbg" |
| 123 | implies: "all_modes" |
| 124 | flag_set { |
| 125 | action: "preprocess-assemble" |
| 126 | action: "c-compile" |
| 127 | action: "c++-compile" |
| 128 | action: "c++-header-parsing" |
| 129 | action: "c++-header-preprocessing" |
| 130 | action: "c++-module-compile" |
| 131 | flag_group { |
| 132 | flag: "-DAOS_DEBUG=1" |
| 133 | } |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 134 | flag_group { |
| 135 | flag: "-fno-omit-frame-pointer" |
| 136 | } |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 137 | } |
| 138 | } |
| 139 | |
| 140 | feature { |
| 141 | name: "fastbuild" |
| 142 | implies: "all_modes" |
| 143 | flag_set { |
| 144 | action: "preprocess-assemble" |
| 145 | action: "c-compile" |
| 146 | action: "c++-compile" |
| 147 | action: "c++-header-parsing" |
| 148 | action: "c++-header-preprocessing" |
| 149 | action: "c++-module-compile" |
| 150 | flag_group { |
| 151 | flag: "-DAOS_DEBUG=0" |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | feature { |
| 157 | name: "all_modes" |
| 158 | flag_set { |
Austin Schuh | a20ae72 | 2015-11-01 12:29:38 -0800 | [diff] [blame] | 159 | action: "preprocess-assemble" |
| 160 | action: "assemble" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 161 | action: "c-compile" |
| 162 | flag_group { |
| 163 | flag: "-std=gnu99" |
| 164 | } |
| 165 | } |
| 166 | flag_set { |
| 167 | action: "c++-compile" |
| 168 | action: "c++-header-parsing" |
| 169 | action: "c++-header-preprocessing" |
| 170 | action: "c++-module-compile" |
| 171 | flag_group { |
Austin Schuh | a20ae72 | 2015-11-01 12:29:38 -0800 | [diff] [blame] | 172 | flag: "-std=gnu++1y" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 173 | } |
Brian Silverman | 23a1b34 | 2015-10-11 23:44:09 -0400 | [diff] [blame] | 174 | } |
| 175 | flag_set { |
| 176 | action: "preprocess-assemble" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 177 | action: "assemble" |
| 178 | action: "c++-link" |
Brian Silverman | 23a1b34 | 2015-10-11 23:44:09 -0400 | [diff] [blame] | 179 | action: "c++-compile" |
| 180 | action: "c++-header-parsing" |
| 181 | action: "c++-header-preprocessing" |
| 182 | action: "c++-module-compile" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 183 | action: "c-compile" |
Brian Silverman | 5dc0007 | 2015-10-12 00:38:14 -0400 | [diff] [blame] | 184 | flag_group { |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 185 | # We always want to compile with -pthread semantics. |
Brian Silverman | 5dc0007 | 2015-10-12 00:38:14 -0400 | [diff] [blame] | 186 | flag: "-pthread" |
| 187 | } |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 188 | } |
| 189 | } |
| 190 | |
| 191 | # Anticipated future default. |
| 192 | # This makes GCC and Clang do what we want when called through symlinks. |
| 193 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 194 | linker_flag: "-no-canonical-prefixes" |
| 195 | |
| 196 | # Things that the code wants defined. |
| 197 | compiler_flag: "-D__STDC_FORMAT_MACROS" |
| 198 | compiler_flag: "-D__STDC_CONSTANT_MACROS" |
| 199 | compiler_flag: "-D__STDC_LIMIT_MACROS" |
| 200 | compiler_flag: "-D_FILE_OFFSET_BITS=64" |
| 201 | # TODO(Brian): Rename this or something. |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 202 | compiler_flag: "-DAOS_ARCHITECTURE_arm_frc" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 203 | |
| 204 | linker_flag: "-fuse-ld=gold" |
| 205 | |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 206 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 207 | # compiler symbols. |
| 208 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 209 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 210 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 211 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 212 | |
| 213 | # Security hardening on by default. |
| 214 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 215 | # We need to undef it before redefining it as some distributions now have |
| 216 | # it enabled by default. |
| 217 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 218 | compiler_flag: "-D_FORTIFY_SOURCE=1" |
| 219 | compiler_flag: "-fstack-protector" |
| 220 | compiler_flag: "-fPIE" |
| 221 | linker_flag: "-pie" |
| 222 | linker_flag: "-Wl,-z,relro,-z,now" |
| 223 | |
| 224 | # Pretty much everything needs this, including parts of the glibc STL... |
| 225 | linker_flag: "-lm" |
| 226 | |
| 227 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 228 | # escape sequences if --nocolor is specified. |
| 229 | compiler_flag: "-fcolor-diagnostics" |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 230 | compiler_flag: "-fmessage-length=80" |
| 231 | compiler_flag: "-fmacro-backtrace-limit=0" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 232 | |
| 233 | compiler_flag: "-Wall" |
| 234 | compiler_flag: "-Wextra" |
| 235 | compiler_flag: "-Wswitch-enum" |
| 236 | compiler_flag: "-Wpointer-arith" |
Brian Silverman | 594be0d | 2015-10-31 17:56:23 -0400 | [diff] [blame] | 237 | compiler_flag: "-Wstrict-aliasing" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 238 | compiler_flag: "-Wcast-qual" |
| 239 | compiler_flag: "-Wcast-align" |
| 240 | compiler_flag: "-Wwrite-strings" |
| 241 | compiler_flag: "-Wtype-limits" |
| 242 | compiler_flag: "-Wsign-compare" |
| 243 | compiler_flag: "-Wformat=2" |
| 244 | compiler_flag: "-Werror" |
| 245 | |
| 246 | # Keep stack frames for debugging, even in opt mode. |
| 247 | compiler_flag: "-fno-omit-frame-pointer" |
| 248 | |
| 249 | # Don't use temp files while compiling. |
| 250 | compiler_flag: "-pipe" |
| 251 | |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 252 | # Stamp the binary with a unique identifier. |
| 253 | linker_flag: "-Wl,--build-id=md5" |
| 254 | linker_flag: "-Wl,--hash-style=gnu" |
| 255 | linker_flag: "-Wl,--warn-execstack" |
| 256 | linker_flag: "-Wl,--detect-odr-violations" |
| 257 | |
| 258 | compilation_mode_flags { |
| 259 | mode: DBG |
| 260 | # Enable debug symbols. |
| 261 | compiler_flag: "-ggdb3" |
| 262 | } |
| 263 | compilation_mode_flags { |
| 264 | mode: OPT |
| 265 | |
Austin Schuh | a20ae72 | 2015-11-01 12:29:38 -0800 | [diff] [blame] | 266 | compiler_flag: "-O2" |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 267 | |
| 268 | # Disable assertions |
| 269 | compiler_flag: "-DNDEBUG" |
| 270 | |
| 271 | # Removal of unused code and data at link time (can this increase binary size in some cases?). |
| 272 | compiler_flag: "-ffunction-sections" |
| 273 | compiler_flag: "-fdata-sections" |
| 274 | linker_flag: "-Wl,--gc-sections" |
| 275 | } |
| 276 | } |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 277 | |
| 278 | toolchain { |
| 279 | abi_version: "roborio" |
| 280 | abi_libc_version: "roborio" |
| 281 | builtin_sysroot: "" |
| 282 | compiler: "gcc" |
| 283 | host_system_name: "roborio" |
| 284 | needsPic: true |
| 285 | supports_gold_linker: false |
| 286 | supports_incremental_linker: false |
| 287 | supports_fission: false |
| 288 | supports_interface_shared_objects: false |
| 289 | supports_normalizing_ar: false |
| 290 | supports_start_end_lib: false |
| 291 | supports_thin_archives: false |
| 292 | target_libc: "roborio" |
| 293 | target_cpu: "roborio" |
| 294 | target_system_name: "roborio" |
| 295 | toolchain_identifier: "roborio_linux" |
| 296 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 297 | tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" } |
| 298 | tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" } |
| 299 | tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" } |
| 300 | tool_path { name: "dwp" path: "/bin/false" } |
| 301 | tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" } |
| 302 | 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] | 303 | # C(++) compiles invoke the compiler (as that is the one knowing where |
| 304 | # 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] | 305 | tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" } |
| 306 | tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" } |
| 307 | 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] | 308 | objcopy_embed_flag: "-I" |
| 309 | objcopy_embed_flag: "binary" |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 310 | tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" } |
| 311 | 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] | 312 | |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 313 | compiler_flag: "--sysroot=external/arm-frc-linux-gnueabi-repo/usr/arm-frc-linux-gnueabi" |
| 314 | compiler_flag: "-nostdinc" |
| 315 | compiler_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 316 | 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] | 317 | compiler_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -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-fixed" |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 319 | compiler_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 320 | 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] | 321 | |
| 322 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 323 | 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] | 324 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 325 | 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] | 326 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 327 | 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] | 328 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 329 | 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] | 330 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -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-fixed" |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 332 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 333 | 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] | 334 | cxx_flag: "-isystem" |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 335 | 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] | 336 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 337 | # TODO(bazel-team): In theory, the path here ought to exactly match the path |
| 338 | # used by gcc. That works because bazel currently doesn't track files at |
| 339 | # absolute locations and has no remote execution, yet. However, this will need |
| 340 | # to be fixed, maybe with auto-detection? |
Brian Silverman | b2215d0 | 2015-11-23 19:10:15 -0500 | [diff] [blame] | 341 | cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3" |
| 342 | cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/arm-frc-linux-gnueabi" |
| 343 | cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%/c++/4.9.3/backward" |
| 344 | 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)%" |
| 345 | 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)%" |
| 346 | cxx_builtin_include_directory: "%package(@arm-frc-linux-gnueabi-repo//usr/arm-frc-linux-gnueabi/include)%" |
| 347 | 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] | 348 | |
| 349 | linker_flag: "-lstdc++" |
| 350 | #linker_flag: "-B/usr/bin/" |
| 351 | |
| 352 | feature { |
| 353 | name: "opt" |
| 354 | implies: "all_modes" |
| 355 | flag_set { |
| 356 | action: "preprocess-assemble" |
| 357 | action: "c-compile" |
| 358 | action: "c++-compile" |
| 359 | action: "c++-header-parsing" |
| 360 | action: "c++-header-preprocessing" |
| 361 | action: "c++-module-compile" |
| 362 | flag_group { |
| 363 | flag: "-DAOS_DEBUG=0" |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | feature { |
| 369 | name: "dbg" |
| 370 | implies: "all_modes" |
| 371 | flag_set { |
| 372 | action: "preprocess-assemble" |
| 373 | action: "c-compile" |
| 374 | action: "c++-compile" |
| 375 | action: "c++-header-parsing" |
| 376 | action: "c++-header-preprocessing" |
| 377 | action: "c++-module-compile" |
| 378 | flag_group { |
| 379 | flag: "-DAOS_DEBUG=1" |
| 380 | } |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 381 | flag_group { |
| 382 | flag: "-fno-omit-frame-pointer" |
| 383 | } |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 384 | } |
| 385 | } |
| 386 | |
| 387 | feature { |
| 388 | name: "fastbuild" |
| 389 | implies: "all_modes" |
| 390 | flag_set { |
| 391 | action: "preprocess-assemble" |
| 392 | action: "c-compile" |
| 393 | action: "c++-compile" |
| 394 | action: "c++-header-parsing" |
| 395 | action: "c++-header-preprocessing" |
| 396 | action: "c++-module-compile" |
| 397 | flag_group { |
| 398 | flag: "-DAOS_DEBUG=0" |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | feature { |
| 404 | name: "all_modes" |
| 405 | flag_set { |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 406 | action: "preprocess-assemble" |
| 407 | action: "assemble" |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 408 | action: "c-compile" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 409 | flag_group { |
| 410 | flag: "-std=gnu99" |
| 411 | } |
| 412 | } |
| 413 | flag_set { |
| 414 | action: "c++-compile" |
| 415 | action: "c++-header-parsing" |
| 416 | action: "c++-header-preprocessing" |
| 417 | action: "c++-module-compile" |
| 418 | flag_group { |
| 419 | flag: "-std=gnu++1y" |
| 420 | } |
| 421 | } |
| 422 | flag_set { |
| 423 | action: "preprocess-assemble" |
| 424 | action: "assemble" |
| 425 | action: "c++-link" |
| 426 | action: "c++-compile" |
| 427 | action: "c++-header-parsing" |
| 428 | action: "c++-header-preprocessing" |
| 429 | action: "c++-module-compile" |
| 430 | action: "c-compile" |
| 431 | flag_group { |
| 432 | # We always want to compile with -pthread semantics. |
| 433 | flag: "-pthread" |
| 434 | } |
| 435 | } |
| 436 | } |
| 437 | |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 438 | compiler_flag: "-mfpu=neon" |
| 439 | # TODO(brians): See if it will run with this enabled. |
| 440 | #compiler_flag: "-mhwdiv=arm,thumb" |
| 441 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 442 | # Anticipated future default. |
| 443 | # This makes GCC and Clang do what we want when called through symlinks. |
| 444 | unfiltered_cxx_flag: "-no-canonical-prefixes" |
| 445 | linker_flag: "-no-canonical-prefixes" |
| 446 | |
| 447 | # Things that the code wants defined. |
| 448 | compiler_flag: "-D__STDC_FORMAT_MACROS" |
| 449 | compiler_flag: "-D__STDC_CONSTANT_MACROS" |
| 450 | compiler_flag: "-D__STDC_LIMIT_MACROS" |
| 451 | compiler_flag: "-D_FILE_OFFSET_BITS=64" |
| 452 | # TODO(Brian): Rename this or something. |
Austin Schuh | a20ae72 | 2015-11-01 12:29:38 -0800 | [diff] [blame] | 453 | compiler_flag: "-DAOS_ARCHITECTURE_arm_frc" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 454 | |
| 455 | #linker_flag: "-fuse-ld=gold" |
| 456 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 457 | # Make C++ compilation deterministic. Use linkstamping instead of these |
| 458 | # compiler symbols. |
| 459 | unfiltered_cxx_flag: "-Wno-builtin-macro-redefined" |
| 460 | unfiltered_cxx_flag: "-D__DATE__=\"redacted\"" |
| 461 | unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\"" |
| 462 | unfiltered_cxx_flag: "-D__TIME__=\"redacted\"" |
| 463 | |
| 464 | # Security hardening on by default. |
| 465 | # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases. |
| 466 | # We need to undef it before redefining it as some distributions now have |
| 467 | # it enabled by default. |
| 468 | compiler_flag: "-U_FORTIFY_SOURCE" |
| 469 | compiler_flag: "-fstack-protector" |
| 470 | compiler_flag: "-fPIE" |
| 471 | linker_flag: "-pie" |
| 472 | linker_flag: "-Wl,-z,relro,-z,now" |
| 473 | |
| 474 | # Pretty much everything needs this, including parts of the glibc STL... |
| 475 | linker_flag: "-lm" |
| 476 | |
| 477 | # Enable coloring even if there's no attached terminal. Bazel removes the |
| 478 | # escape sequences if --nocolor is specified. |
| 479 | compiler_flag: "-fdiagnostics-color=always" |
| 480 | |
| 481 | compiler_flag: "-Wall" |
| 482 | compiler_flag: "-Wextra" |
| 483 | compiler_flag: "-Wswitch-enum" |
| 484 | compiler_flag: "-Wpointer-arith" |
Brian Silverman | 594be0d | 2015-10-31 17:56:23 -0400 | [diff] [blame] | 485 | compiler_flag: "-Wstrict-aliasing" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 486 | compiler_flag: "-Wcast-qual" |
| 487 | compiler_flag: "-Wcast-align" |
| 488 | compiler_flag: "-Wwrite-strings" |
| 489 | compiler_flag: "-Wtype-limits" |
| 490 | compiler_flag: "-Wsign-compare" |
| 491 | compiler_flag: "-Wformat=2" |
| 492 | compiler_flag: "-Werror" |
Brian Silverman | a4a4ea6 | 2015-11-27 10:27:53 -0500 | [diff] [blame] | 493 | compiler_flag: "-Wunused-local-typedefs" |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 494 | |
| 495 | # Keep stack frames for debugging, even in opt mode. |
| 496 | compiler_flag: "-fno-omit-frame-pointer" |
| 497 | compiler_flag: "-D__has_feature(x)=0" |
| 498 | |
| 499 | # Don't use temp files while compiling. |
| 500 | compiler_flag: "-pipe" |
| 501 | |
| 502 | # Have GCC return the exit code from ld. |
| 503 | linker_flag: "-pass-exit-codes" |
| 504 | |
| 505 | # Stamp the binary with a unique identifier. |
| 506 | linker_flag: "-Wl,--build-id=md5" |
| 507 | linker_flag: "-Wl,--hash-style=gnu" |
| 508 | #linker_flag: "-Wl,--warn-execstack" |
| 509 | #linker_flag: "-Wl,--detect-odr-violations" |
| 510 | |
| 511 | compilation_mode_flags { |
| 512 | mode: DBG |
| 513 | # Enable debug symbols. |
| 514 | compiler_flag: "-ggdb3" |
| 515 | } |
| 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 | } |