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": [], |
| 14 | "//conditions:default": ["//third_party/gperftools:tcmalloc"], |
| 15 | }), |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 16 | ) |
| 17 | |
| 18 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 19 | name = "stl", |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 23 | name = "empty", |
| 24 | srcs = [], |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 25 | ) |
| 26 | |
Brian Silverman | b200c17 | 2017-01-02 17:35:35 -0800 | [diff] [blame] | 27 | # This is the entry point for --crosstool_top. |
| 28 | cc_toolchain_suite( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 29 | name = "toolchain", |
| 30 | toolchains = { |
| 31 | "k8|clang": ":cc-compiler-k8", |
| 32 | "roborio|gcc": ":cc-compiler-roborio", |
| 33 | "armhf-debian|clang": "cc-compiler-armhf-debian", |
| 34 | "cortex-m4f|gcc": "cc-compiler-cortex-m4f", |
| 35 | }, |
Brian Silverman | b466eef | 2015-11-28 20:33:44 -0500 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | # Compiler inputs given by --copt etc in //tools:bazel.rc. |
| 39 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 40 | name = "flags_compiler_inputs", |
| 41 | srcs = select({ |
| 42 | "//tools:has_asan": [ |
| 43 | "asan-blacklist", |
| 44 | ], |
| 45 | "//tools:has_ubsan": [ |
| 46 | "ubsan-blacklist", |
| 47 | ], |
| 48 | "//conditions:default": [], |
| 49 | }), |
| 50 | ) |
| 51 | |
| 52 | filegroup( |
| 53 | name = "clang_3p6_all_files", |
| 54 | srcs = [ |
| 55 | ":flags_compiler_inputs", |
| 56 | "//tools/cpp/clang_3p6:as", |
| 57 | "//tools/cpp/clang_3p6:tool-wrappers", |
| 58 | "@clang_3p6_repo//:compiler_pieces", |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 59 | ], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 60 | ) |
| 61 | |
| 62 | filegroup( |
| 63 | name = "clang_3p6_linker_files", |
| 64 | srcs = [ |
| 65 | "//tools/cpp/clang_3p6:ar", |
| 66 | "//tools/cpp/clang_3p6:clang", |
| 67 | "//tools/cpp/clang_3p6:clang-symlinks", |
| 68 | "//tools/cpp/clang_3p6:ld", |
| 69 | "@clang_3p6_repo//:compiler_pieces", |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 70 | ], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 71 | ) |
| 72 | |
| 73 | filegroup( |
Brian Silverman | 5c00e23 | 2018-08-12 02:08:32 -0700 | [diff] [blame] | 74 | name = "clang_3p6_strip_files", |
| 75 | srcs = [ |
| 76 | "//tools/cpp/clang_3p6:strip", |
| 77 | "@clang_3p6_repo//:compiler_pieces", |
| 78 | ], |
| 79 | ) |
| 80 | |
| 81 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 82 | name = "clang_3p6_compiler_files", |
| 83 | srcs = [ |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame^] | 84 | "flags_compiler_inputs", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 85 | "//tools/cpp/clang_3p6:clang", |
| 86 | "//tools/cpp/clang_3p6:ld", |
| 87 | "@clang_3p6_repo//:compiler_components", |
| 88 | "@clang_3p6_repo//:compiler_pieces", |
| 89 | ], |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 90 | ) |
| 91 | |
| 92 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 93 | name = "cc-compiler-k8", |
| 94 | all_files = ":clang_3p6_all_files", |
| 95 | compiler_files = ":clang_3p6_compiler_files", |
| 96 | cpu = "k8", |
| 97 | dwp_files = ":empty", |
| 98 | dynamic_runtime_libs = [":empty"], |
| 99 | linker_files = ":clang_3p6_linker_files", |
| 100 | objcopy_files = "//tools/cpp/clang_3p6:objcopy", |
| 101 | static_runtime_libs = [":empty"], |
Brian Silverman | 5c00e23 | 2018-08-12 02:08:32 -0700 | [diff] [blame] | 102 | strip_files = ":clang_3p6_strip_files", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 103 | supports_param_files = 1, |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 104 | ) |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 105 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 106 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 107 | name = "roborio-compiler-files", |
| 108 | srcs = [ |
| 109 | ":flags_compiler_inputs", |
| 110 | "//tools/cpp/arm-frc-linux-gnueabi:as", |
| 111 | "//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers", |
| 112 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 113 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 114 | ) |
| 115 | |
| 116 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 117 | name = "roborio_linker_files", |
| 118 | srcs = [ |
| 119 | "//tools/cpp/arm-frc-linux-gnueabi:ar", |
| 120 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 121 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 122 | "//tools/cpp/arm-frc-linux-gnueabi:libs", |
| 123 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 124 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 125 | ) |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 126 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 127 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 128 | name = "roborio_compiler_files", |
| 129 | srcs = [ |
| 130 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 131 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 132 | "@arm_frc_linux_gnueabi_repo//:compiler_components", |
| 133 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 134 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 135 | ) |
| 136 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 137 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 138 | name = "cc-compiler-roborio", |
| 139 | all_files = ":roborio-compiler-files", |
| 140 | compiler_files = ":roborio_compiler_files", |
| 141 | cpu = "roborio", |
| 142 | dwp_files = ":empty", |
| 143 | dynamic_runtime_libs = [":empty"], |
| 144 | linker_files = ":roborio_linker_files", |
| 145 | objcopy_files = "//tools/cpp/arm-frc-linux-gnueabi:objcopy", |
| 146 | static_runtime_libs = [":empty"], |
| 147 | strip_files = "//tools/cpp/arm-frc-linux-gnueabi:strip", |
| 148 | supports_param_files = 1, |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 149 | ) |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 150 | |
| 151 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 152 | name = "linaro-gcc-files", |
| 153 | srcs = [ |
| 154 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 155 | "//tools/cpp/linaro_linux_gcc:tool-wrappers", |
| 156 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 157 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 158 | ) |
| 159 | |
| 160 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 161 | name = "linaro_linux_linker_files", |
| 162 | srcs = [ |
| 163 | "//tools/cpp/linaro_linux_gcc:ar", |
| 164 | "//tools/cpp/linaro_linux_gcc:clang", |
| 165 | "//tools/cpp/linaro_linux_gcc:clang-ld", |
| 166 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 167 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 168 | "//tools/cpp/linaro_linux_gcc:ld", |
| 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_compiler_files", |
| 175 | srcs = [ |
| 176 | "//tools/cpp/linaro_linux_gcc:as", |
| 177 | "//tools/cpp/linaro_linux_gcc:clang", |
| 178 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 179 | "//tools/cpp/linaro_linux_gcc:ld", |
| 180 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 181 | ) |
| 182 | |
| 183 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 184 | name = "cc-compiler-armhf-debian", |
| 185 | all_files = ":linaro-gcc-files", |
| 186 | compiler_files = ":linaro_linux_compiler_files", |
| 187 | cpu = "armhf", |
| 188 | dwp_files = ":empty", |
| 189 | dynamic_runtime_libs = [":empty"], |
| 190 | linker_files = ":linaro_linux_linker_files", |
| 191 | objcopy_files = "//tools/cpp/linaro_linux_gcc:objcopy", |
| 192 | static_runtime_libs = [":empty"], |
| 193 | strip_files = "//tools/cpp/linaro_linux_gcc:strip", |
| 194 | supports_param_files = 1, |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 195 | ) |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 196 | |
| 197 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 198 | name = "cc-compiler-cortex-m4f", |
| 199 | all_files = ":empty", |
| 200 | compiler_files = ":empty", |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame^] | 201 | cpu = "cortex-m4f", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 202 | dwp_files = ":empty", |
| 203 | dynamic_runtime_libs = [":empty"], |
| 204 | linker_files = "//motors/core:linkerscript", |
| 205 | objcopy_files = ":empty", |
| 206 | static_runtime_libs = [":empty"], |
| 207 | strip_files = ":empty", |
| 208 | supports_param_files = 0, |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 209 | ) |
Brian Silverman | 7b8899e | 2018-06-30 19:19:24 -0700 | [diff] [blame^] | 210 | |
| 211 | py_binary( |
| 212 | name = "gen_crosstool", |
| 213 | srcs = ["gen_crosstool.py"], |
| 214 | main = "gen_crosstool.py", |
| 215 | deps = [ |
| 216 | "//third_party/bazel:crosstool_config_proto_py", |
| 217 | ], |
| 218 | ) |