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( |
| 74 | name = "clang_3p6_compiler_files", |
| 75 | srcs = [ |
| 76 | "//tools/cpp/clang_3p6:clang", |
| 77 | "//tools/cpp/clang_3p6:ld", |
| 78 | "@clang_3p6_repo//:compiler_components", |
| 79 | "@clang_3p6_repo//:compiler_pieces", |
| 80 | ], |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 81 | ) |
| 82 | |
| 83 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 84 | name = "cc-compiler-k8", |
| 85 | all_files = ":clang_3p6_all_files", |
| 86 | compiler_files = ":clang_3p6_compiler_files", |
| 87 | cpu = "k8", |
| 88 | dwp_files = ":empty", |
| 89 | dynamic_runtime_libs = [":empty"], |
| 90 | linker_files = ":clang_3p6_linker_files", |
| 91 | objcopy_files = "//tools/cpp/clang_3p6:objcopy", |
| 92 | static_runtime_libs = [":empty"], |
| 93 | strip_files = "//tools/cpp/clang_3p6:strip", |
| 94 | supports_param_files = 1, |
Brian Silverman | 12b3fc5 | 2015-10-11 19:38:33 -0400 | [diff] [blame] | 95 | ) |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 96 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 97 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 98 | name = "roborio-compiler-files", |
| 99 | srcs = [ |
| 100 | ":flags_compiler_inputs", |
| 101 | "//tools/cpp/arm-frc-linux-gnueabi:as", |
| 102 | "//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers", |
| 103 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 104 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 105 | ) |
| 106 | |
| 107 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 108 | name = "roborio_linker_files", |
| 109 | srcs = [ |
| 110 | "//tools/cpp/arm-frc-linux-gnueabi:ar", |
| 111 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 112 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 113 | "//tools/cpp/arm-frc-linux-gnueabi:libs", |
| 114 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 115 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 116 | ) |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 117 | |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 118 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 119 | name = "roborio_compiler_files", |
| 120 | srcs = [ |
| 121 | "//tools/cpp/arm-frc-linux-gnueabi:gcc", |
| 122 | "//tools/cpp/arm-frc-linux-gnueabi:ld", |
| 123 | "@arm_frc_linux_gnueabi_repo//:compiler_components", |
| 124 | "@arm_frc_linux_gnueabi_repo//:compiler_pieces", |
| 125 | ], |
Austin Schuh | 55139fe | 2015-10-14 23:55:24 -0700 | [diff] [blame] | 126 | ) |
| 127 | |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 128 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 129 | name = "cc-compiler-roborio", |
| 130 | all_files = ":roborio-compiler-files", |
| 131 | compiler_files = ":roborio_compiler_files", |
| 132 | cpu = "roborio", |
| 133 | dwp_files = ":empty", |
| 134 | dynamic_runtime_libs = [":empty"], |
| 135 | linker_files = ":roborio_linker_files", |
| 136 | objcopy_files = "//tools/cpp/arm-frc-linux-gnueabi:objcopy", |
| 137 | static_runtime_libs = [":empty"], |
| 138 | strip_files = "//tools/cpp/arm-frc-linux-gnueabi:strip", |
| 139 | supports_param_files = 1, |
Austin Schuh | 23da18b | 2015-10-11 20:52:49 -0700 | [diff] [blame] | 140 | ) |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 141 | |
| 142 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 143 | name = "linaro-gcc-files", |
| 144 | srcs = [ |
| 145 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 146 | "//tools/cpp/linaro_linux_gcc:tool-wrappers", |
| 147 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 148 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 149 | ) |
| 150 | |
| 151 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 152 | name = "linaro_linux_linker_files", |
| 153 | srcs = [ |
| 154 | "//tools/cpp/linaro_linux_gcc:ar", |
| 155 | "//tools/cpp/linaro_linux_gcc:clang", |
| 156 | "//tools/cpp/linaro_linux_gcc:clang-ld", |
| 157 | "//tools/cpp/linaro_linux_gcc:clang-symlinks", |
| 158 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 159 | "//tools/cpp/linaro_linux_gcc:ld", |
| 160 | "@linaro_linux_gcc_4_9_repo//:compiler_pieces", |
| 161 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 162 | ) |
| 163 | |
| 164 | filegroup( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 165 | name = "linaro_linux_compiler_files", |
| 166 | srcs = [ |
| 167 | "//tools/cpp/linaro_linux_gcc:as", |
| 168 | "//tools/cpp/linaro_linux_gcc:clang", |
| 169 | "//tools/cpp/linaro_linux_gcc:gcc", |
| 170 | "//tools/cpp/linaro_linux_gcc:ld", |
| 171 | ], |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 172 | ) |
| 173 | |
| 174 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 175 | name = "cc-compiler-armhf-debian", |
| 176 | all_files = ":linaro-gcc-files", |
| 177 | compiler_files = ":linaro_linux_compiler_files", |
| 178 | cpu = "armhf", |
| 179 | dwp_files = ":empty", |
| 180 | dynamic_runtime_libs = [":empty"], |
| 181 | linker_files = ":linaro_linux_linker_files", |
| 182 | objcopy_files = "//tools/cpp/linaro_linux_gcc:objcopy", |
| 183 | static_runtime_libs = [":empty"], |
| 184 | strip_files = "//tools/cpp/linaro_linux_gcc:strip", |
| 185 | supports_param_files = 1, |
Brian Silverman | 0d57fc8 | 2016-01-24 21:02:53 -0500 | [diff] [blame] | 186 | ) |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 187 | |
| 188 | cc_toolchain( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 189 | name = "cc-compiler-cortex-m4f", |
| 190 | all_files = ":empty", |
| 191 | compiler_files = ":empty", |
| 192 | cpu = "cortex-m4", |
| 193 | dwp_files = ":empty", |
| 194 | dynamic_runtime_libs = [":empty"], |
| 195 | linker_files = "//motors/core:linkerscript", |
| 196 | objcopy_files = ":empty", |
| 197 | static_runtime_libs = [":empty"], |
| 198 | strip_files = ":empty", |
| 199 | supports_param_files = 0, |
Brian Silverman | 8b63869 | 2017-06-26 23:10:26 -0700 | [diff] [blame] | 200 | ) |