Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 2 | |
| 3 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 4 | name = "empty_main", |
| 5 | srcs = ["empty_main.c"], |
Brian Silverman | 63889f9 | 2015-11-27 01:33:56 -0500 | [diff] [blame] | 6 | ) |
| 7 | |
| 8 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 9 | name = "malloc", |
| 10 | deps = select({ |
| 11 | "//tools:has_asan": [], |
| 12 | "//tools:has_tsan": [], |
| 13 | "//tools:cpu_cortex_m4f": [], |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 14 | "//tools:cpu_cortex_m4f_k22": [], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 15 | "//conditions:default": ["//third_party/gperftools:tcmalloc"], |
| 16 | }), |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 17 | ) |
| 18 | |
| 19 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 20 | name = "stl", |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 21 | ) |
| 22 | |
| 23 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 24 | name = "empty", |
| 25 | srcs = [], |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 26 | ) |
| 27 | |
Brian Silverman | b200c17 | 2017-01-02 17:35:35 -0800 | [diff] [blame] | 28 | # This is the entry point for --crosstool_top. |
| 29 | cc_toolchain_suite( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 30 | name = "toolchain", |
| 31 | toolchains = { |
| 32 | "k8|clang": ":cc-compiler-k8", |
| 33 | "roborio|gcc": ":cc-compiler-roborio", |
| 34 | "armhf-debian|clang": "cc-compiler-armhf-debian", |
| 35 | "cortex-m4f|gcc": "cc-compiler-cortex-m4f", |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 36 | "cortex-m4f-k22|gcc": "cc-compiler-cortex-m4f-k22", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 37 | }, |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame] | 38 | ) |
| 39 | |
| 40 | # Compiler inputs given by --copt etc in //tools:bazel.rc. |
| 41 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 42 | name = "flags_compiler_inputs", |
| 43 | srcs = select({ |
| 44 | "//tools:has_asan": [ |
| 45 | "asan-blacklist", |
| 46 | ], |
| 47 | "//tools:has_ubsan": [ |
| 48 | "ubsan-blacklist", |
| 49 | ], |
| 50 | "//conditions:default": [], |
| 51 | }), |
| 52 | ) |
| 53 | |
| 54 | filegroup( |
| 55 | name = "clang_3p6_all_files", |
| 56 | srcs = [ |
| 57 | ":flags_compiler_inputs", |
| 58 | "//tools/cpp/clang_3p6:as", |
| 59 | "//tools/cpp/clang_3p6:tool-wrappers", |
| 60 | "@clang_3p6_repo//:compiler_pieces", |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 61 | ], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 62 | ) |
| 63 | |
| 64 | filegroup( |
| 65 | name = "clang_3p6_linker_files", |
| 66 | srcs = [ |
| 67 | "//tools/cpp/clang_3p6:ar", |
| 68 | "//tools/cpp/clang_3p6:clang", |
| 69 | "//tools/cpp/clang_3p6:clang-symlinks", |
| 70 | "//tools/cpp/clang_3p6:ld", |
| 71 | "@clang_3p6_repo//:compiler_pieces", |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 72 | ], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 73 | ) |
| 74 | |
| 75 | filegroup( |
Brian Silverman | 5c00e23 | 2018-08-12 02:08:32 -0700 | [diff] [blame] | 76 | name = "clang_3p6_strip_files", |
| 77 | srcs = [ |
| 78 | "//tools/cpp/clang_3p6:strip", |
| 79 | "@clang_3p6_repo//:compiler_pieces", |
| 80 | ], |
| 81 | ) |
| 82 | |
| 83 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 84 | name = "clang_3p6_compiler_files", |
| 85 | srcs = [ |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame] | 86 | "flags_compiler_inputs", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 87 | "//tools/cpp/clang_3p6:clang", |
| 88 | "//tools/cpp/clang_3p6:ld", |
| 89 | "@clang_3p6_repo//:compiler_components", |
| 90 | "@clang_3p6_repo//:compiler_pieces", |
| 91 | ], |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 92 | ) |
| 93 | |
| 94 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 95 | name = "cc-compiler-k8", |
| 96 | all_files = ":clang_3p6_all_files", |
| 97 | compiler_files = ":clang_3p6_compiler_files", |
| 98 | cpu = "k8", |
| 99 | dwp_files = ":empty", |
| 100 | dynamic_runtime_libs = [":empty"], |
| 101 | linker_files = ":clang_3p6_linker_files", |
| 102 | objcopy_files = "//tools/cpp/clang_3p6:objcopy", |
| 103 | static_runtime_libs = [":empty"], |
Brian Silverman | 5c00e23 | 2018-08-12 02:08:32 -0700 | [diff] [blame] | 104 | strip_files = ":clang_3p6_strip_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 105 | supports_param_files = 1, |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 106 | toolchain_identifier = "k8_linux", |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 107 | ) |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 108 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 109 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 110 | name = "roborio-compiler-files", |
| 111 | srcs = [ |
| 112 | ":flags_compiler_inputs", |
| 113 | "//tools/cpp/arm-frc-linux-gnueabi:as", |
| 114 | "//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers", |
| 115 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 116 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 117 | ) |
| 118 | |
| 119 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 120 | name = "roborio_linker_files", |
| 121 | srcs = [ |
| 122 | "//tools/cpp/arm-frc-linux-gnueabi:ar", |
| 123 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 124 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 125 | "//tools/cpp/arm-frc-linux-gnueabi:libs", |
| 126 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 127 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 128 | ) |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 129 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 130 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 131 | name = "roborio_compiler_files", |
| 132 | srcs = [ |
| 133 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 134 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 135 | "@arm_frc_linux_gnueabi_repo//:compiler_components", |
| 136 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 137 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 138 | ) |
| 139 | |
Brian Silverman | 50b9ac0 | 2018-08-12 13:24:10 -0700 | [diff] [blame] | 140 | filegroup( |
| 141 | name = "roborio_strip_files", |
| 142 | srcs = [ |
| 143 | "//tools/cpp/arm-frc-linux-gnueabi:strip", |
| 144 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 145 | ], |
| 146 | ) |
| 147 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 148 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 149 | name = "cc-compiler-roborio", |
| 150 | all_files = ":roborio-compiler-files", |
| 151 | compiler_files = ":roborio_compiler_files", |
| 152 | cpu = "roborio", |
| 153 | dwp_files = ":empty", |
| 154 | dynamic_runtime_libs = [":empty"], |
| 155 | linker_files = ":roborio_linker_files", |
| 156 | objcopy_files = "//tools/cpp/arm-frc-linux-gnueabi:objcopy", |
| 157 | static_runtime_libs = [":empty"], |
Brian Silverman | 50b9ac0 | 2018-08-12 13:24:10 -0700 | [diff] [blame] | 158 | strip_files = ":roborio_strip_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 159 | supports_param_files = 1, |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 160 | toolchain_identifier = "roborio_linux", |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 161 | ) |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 162 | |
| 163 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 164 | name = "linaro-gcc-files", |
| 165 | srcs = [ |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 166 | ":clang_3p6_all_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 167 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 168 | "//tools/cpp/linaro_linux_gcc:tool-wrappers", |
| 169 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 170 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 171 | ) |
| 172 | |
| 173 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 174 | name = "linaro_linux_linker_files", |
| 175 | srcs = [ |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 176 | ":clang_3p6_linker_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 177 | "//tools/cpp/linaro_linux_gcc:ar", |
| 178 | "//tools/cpp/linaro_linux_gcc:clang", |
| 179 | "//tools/cpp/linaro_linux_gcc:clang-ld", |
| 180 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 181 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 182 | "//tools/cpp/linaro_linux_gcc:ld", |
| 183 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 184 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 185 | ) |
| 186 | |
| 187 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 188 | name = "linaro_linux_compiler_files", |
| 189 | srcs = [ |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 190 | ":clang_3p6_compiler_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 191 | "//tools/cpp/linaro_linux_gcc:as", |
| 192 | "//tools/cpp/linaro_linux_gcc:clang", |
| 193 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 194 | "//tools/cpp/linaro_linux_gcc:ld", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 195 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 196 | ], |
| 197 | ) |
| 198 | |
| 199 | filegroup( |
| 200 | name = "linaro_linux_strip_files", |
| 201 | srcs = [ |
| 202 | "//tools/cpp/linaro_linux_gcc:strip", |
| 203 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 204 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 205 | ) |
| 206 | |
| 207 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 208 | name = "cc-compiler-armhf-debian", |
| 209 | all_files = ":linaro-gcc-files", |
| 210 | compiler_files = ":linaro_linux_compiler_files", |
| 211 | cpu = "armhf", |
| 212 | dwp_files = ":empty", |
| 213 | dynamic_runtime_libs = [":empty"], |
| 214 | linker_files = ":linaro_linux_linker_files", |
| 215 | objcopy_files = "//tools/cpp/linaro_linux_gcc:objcopy", |
| 216 | static_runtime_libs = [":empty"], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 217 | strip_files = ":linaro_linux_strip_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 218 | supports_param_files = 1, |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 219 | toolchain_identifier = "clang_linux_armhf", |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 220 | ) |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 221 | |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 222 | filegroup( |
| 223 | name = "gcc_arm_none_eabi_none_files", |
| 224 | srcs = [ |
| 225 | "//tools/cpp/gcc_arm_none_eabi:tool-wrappers", |
| 226 | "@gcc_arm_none_eabi//:compiler_pieces", |
| 227 | ], |
| 228 | ) |
| 229 | |
| 230 | filegroup( |
| 231 | name = "gcc_arm_none_eabi_compiler_files", |
| 232 | srcs = [ |
| 233 | "//tools/cpp/gcc_arm_none_eabi:as", |
| 234 | "//tools/cpp/gcc_arm_none_eabi:gcc", |
| 235 | "//tools/cpp/gcc_arm_none_eabi:ld", |
| 236 | ], |
| 237 | ) |
| 238 | |
| 239 | filegroup( |
| 240 | name = "gcc_arm_none_eabi_linker_files", |
| 241 | srcs = [ |
| 242 | "//motors/core:linkerscripts", |
| 243 | "//tools/cpp/gcc_arm_none_eabi:ar", |
| 244 | "//tools/cpp/gcc_arm_none_eabi:gcc", |
| 245 | "//tools/cpp/gcc_arm_none_eabi:ld", |
| 246 | "@gcc_arm_none_eabi//:compiler_pieces", |
| 247 | ], |
| 248 | ) |
| 249 | |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 250 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 251 | name = "cc-compiler-cortex-m4f", |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 252 | all_files = ":gcc_arm_none_eabi_none_files", |
| 253 | compiler_files = ":gcc_arm_none_eabi_compiler_files", |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame] | 254 | cpu = "cortex-m4f", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 255 | dwp_files = ":empty", |
| 256 | dynamic_runtime_libs = [":empty"], |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 257 | linker_files = ":gcc_arm_none_eabi_linker_files", |
| 258 | objcopy_files = "//tools/cpp/gcc_arm_none_eabi:objcopy", |
| 259 | static_runtime_libs = [":empty"], |
| 260 | strip_files = "//tools/cpp/gcc_arm_none_eabi:strip", |
| 261 | supports_param_files = 1, |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 262 | toolchain_identifier = "cortex-m4f", |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 263 | ) |
| 264 | |
| 265 | cc_toolchain( |
| 266 | name = "cc-compiler-cortex-m4f-k22", |
| 267 | all_files = ":gcc_arm_none_eabi_none_files", |
| 268 | compiler_files = ":gcc_arm_none_eabi_compiler_files", |
| 269 | cpu = "cortex-m4f-k22", |
| 270 | dwp_files = ":empty", |
| 271 | dynamic_runtime_libs = [":empty"], |
| 272 | linker_files = ":gcc_arm_none_eabi_linker_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 273 | objcopy_files = ":empty", |
| 274 | static_runtime_libs = [":empty"], |
| 275 | strip_files = ":empty", |
Brian Silverman | 6c8b88b | 2018-09-03 18:17:02 -0700 | [diff] [blame] | 276 | supports_param_files = 1, |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame^] | 277 | toolchain_identifier = "cortex-m4f-k22", |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 278 | ) |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame] | 279 | |
| 280 | py_binary( |
| 281 | name = "gen_crosstool", |
| 282 | srcs = ["gen_crosstool.py"], |
| 283 | main = "gen_crosstool.py", |
| 284 | deps = [ |
| 285 | "//third_party/bazel:crosstool_config_proto_py", |
| 286 | ], |
| 287 | ) |