blob: d2e2fda3c8430027bbc5e32538405593a6aa0f48 [file] [log] [blame]
Philipp Schrader9b1790e2018-03-10 20:21:30 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman12b3fc52015-10-11 19:38:33 -04002
3cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -08004 name = "empty_main",
5 srcs = ["empty_main.c"],
Brian Silverman63889f92015-11-27 01:33:56 -05006)
7
8cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -08009 name = "malloc",
10 deps = select({
11 "//tools:has_asan": [],
12 "//tools:has_tsan": [],
13 "//tools:cpu_cortex_m4f": [],
Brian Silverman6c8b88b2018-09-03 18:17:02 -070014 "//tools:cpu_cortex_m4f_k22": [],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080015 "//conditions:default": ["//third_party/gperftools:tcmalloc"],
16 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040017)
18
19cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080020 name = "stl",
Brian Silverman12b3fc52015-10-11 19:38:33 -040021)
22
23filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080024 name = "empty",
25 srcs = [],
Brian Silverman12b3fc52015-10-11 19:38:33 -040026)
27
Brian Silvermanb200c172017-01-02 17:35:35 -080028# This is the entry point for --crosstool_top.
29cc_toolchain_suite(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080030 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 Silverman6c8b88b2018-09-03 18:17:02 -070036 "cortex-m4f-k22|gcc": "cc-compiler-cortex-m4f-k22",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080037 },
Brian Silvermanb466eef2015-11-28 20:33:44 -050038)
39
40# Compiler inputs given by --copt etc in //tools:bazel.rc.
41filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080042 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
54filegroup(
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 Silverman0d57fc82016-01-24 21:02:53 -050061 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080062)
63
64filegroup(
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 Silverman0d57fc82016-01-24 21:02:53 -050072 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080073)
74
75filegroup(
Brian Silverman5c00e232018-08-12 02:08:32 -070076 name = "clang_3p6_strip_files",
77 srcs = [
78 "//tools/cpp/clang_3p6:strip",
79 "@clang_3p6_repo//:compiler_pieces",
80 ],
81)
82
83filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080084 name = "clang_3p6_compiler_files",
85 srcs = [
Brian Silverman7b8899e2018-06-30 19:19:24 -070086 "flags_compiler_inputs",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080087 "//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 Silverman12b3fc52015-10-11 19:38:33 -040092)
93
94cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080095 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 Silverman5c00e232018-08-12 02:08:32 -0700104 strip_files = ":clang_3p6_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800105 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700106 toolchain_identifier = "k8_linux",
Brian Silverman12b3fc52015-10-11 19:38:33 -0400107)
Austin Schuh23da18b2015-10-11 20:52:49 -0700108
Austin Schuh55139fe2015-10-14 23:55:24 -0700109filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800110 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 Schuh55139fe2015-10-14 23:55:24 -0700117)
118
119filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800120 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 Schuh55139fe2015-10-14 23:55:24 -0700128)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800129
Austin Schuh55139fe2015-10-14 23:55:24 -0700130filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800131 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 Schuh55139fe2015-10-14 23:55:24 -0700138)
139
Brian Silverman50b9ac02018-08-12 13:24:10 -0700140filegroup(
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 Schuh23da18b2015-10-11 20:52:49 -0700148cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800149 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 Silverman50b9ac02018-08-12 13:24:10 -0700158 strip_files = ":roborio_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800159 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700160 toolchain_identifier = "roborio_linux",
Austin Schuh23da18b2015-10-11 20:52:49 -0700161)
Brian Silverman0d57fc82016-01-24 21:02:53 -0500162
163filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800164 name = "linaro-gcc-files",
165 srcs = [
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700166 ":clang_3p6_all_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800167 "//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 Silverman0d57fc82016-01-24 21:02:53 -0500171)
172
173filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800174 name = "linaro_linux_linker_files",
175 srcs = [
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700176 ":clang_3p6_linker_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800177 "//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 Silverman0d57fc82016-01-24 21:02:53 -0500185)
186
187filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800188 name = "linaro_linux_compiler_files",
189 srcs = [
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700190 ":clang_3p6_compiler_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800191 "//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 Silverman7a7c24d2018-09-01 17:49:09 -0700195 "@linaro_linux_gcc_4_9_repo//:compiler_pieces",
196 ],
197)
198
199filegroup(
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 Schrader9b1790e2018-03-10 20:21:30 -0800204 ],
Brian Silverman0d57fc82016-01-24 21:02:53 -0500205)
206
207cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800208 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 Silverman7a7c24d2018-09-01 17:49:09 -0700217 strip_files = ":linaro_linux_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800218 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700219 toolchain_identifier = "clang_linux_armhf",
Brian Silverman0d57fc82016-01-24 21:02:53 -0500220)
Brian Silverman8b638692017-06-26 23:10:26 -0700221
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700222filegroup(
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
230filegroup(
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
239filegroup(
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 Silverman8b638692017-06-26 23:10:26 -0700250cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800251 name = "cc-compiler-cortex-m4f",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700252 all_files = ":gcc_arm_none_eabi_none_files",
253 compiler_files = ":gcc_arm_none_eabi_compiler_files",
Brian Silverman7b8899e2018-06-30 19:19:24 -0700254 cpu = "cortex-m4f",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800255 dwp_files = ":empty",
256 dynamic_runtime_libs = [":empty"],
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700257 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 Schuhe18baff2018-10-20 17:40:42 -0700262 toolchain_identifier = "cortex-m4f",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700263)
264
265cc_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 Schrader9b1790e2018-03-10 20:21:30 -0800273 objcopy_files = ":empty",
274 static_runtime_libs = [":empty"],
275 strip_files = ":empty",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700276 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700277 toolchain_identifier = "cortex-m4f-k22",
Brian Silverman8b638692017-06-26 23:10:26 -0700278)
Brian Silverman7b8899e2018-06-30 19:19:24 -0700279
280py_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)