blob: c0d0b38734d6be40489a30b66086583273452384 [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": [],
James Kuszmaul27da8142019-07-21 16:13:55 -070015 "//tools:cpu_web": [],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080016 "//conditions:default": ["//third_party/gperftools:tcmalloc"],
17 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040018)
19
20cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080021 name = "stl",
Brian Silverman12b3fc52015-10-11 19:38:33 -040022)
23
24filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080025 name = "empty",
26 srcs = [],
Brian Silverman12b3fc52015-10-11 19:38:33 -040027)
28
Brian Silvermanb200c172017-01-02 17:35:35 -080029# This is the entry point for --crosstool_top.
30cc_toolchain_suite(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080031 name = "toolchain",
32 toolchains = {
33 "k8|clang": ":cc-compiler-k8",
34 "roborio|gcc": ":cc-compiler-roborio",
35 "armhf-debian|clang": "cc-compiler-armhf-debian",
36 "cortex-m4f|gcc": "cc-compiler-cortex-m4f",
Brian Silverman6c8b88b2018-09-03 18:17:02 -070037 "cortex-m4f-k22|gcc": "cc-compiler-cortex-m4f-k22",
James Kuszmaul27da8142019-07-21 16:13:55 -070038 "web|emscripten": "//tools/cpp/emscripten:cc_emscripten",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080039 },
Brian Silvermanb466eef2015-11-28 20:33:44 -050040)
41
42# Compiler inputs given by --copt etc in //tools:bazel.rc.
43filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080044 name = "flags_compiler_inputs",
45 srcs = select({
46 "//tools:has_asan": [
47 "asan-blacklist",
48 ],
49 "//tools:has_ubsan": [
50 "ubsan-blacklist",
51 ],
52 "//conditions:default": [],
53 }),
54)
55
56filegroup(
James Kuszmaul3ae42262019-11-08 12:33:41 -080057 name = "clang_6p0_all_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080058 srcs = [
59 ":flags_compiler_inputs",
James Kuszmaul3ae42262019-11-08 12:33:41 -080060 "//tools/cpp/clang_6p0:as",
61 "//tools/cpp/clang_6p0:tool-wrappers",
62 "@clang_6p0_repo//:compiler_pieces",
Brian Silverman0d57fc82016-01-24 21:02:53 -050063 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080064)
65
66filegroup(
James Kuszmaul3ae42262019-11-08 12:33:41 -080067 name = "clang_6p0_linker_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080068 srcs = [
James Kuszmaul3ae42262019-11-08 12:33:41 -080069 "//tools/cpp/clang_6p0:ar",
70 "//tools/cpp/clang_6p0:clang",
71 "//tools/cpp/clang_6p0:clang-symlinks",
72 "//tools/cpp/clang_6p0:ld",
73 "@clang_6p0_repo//:compiler_pieces",
Brian Silverman0d57fc82016-01-24 21:02:53 -050074 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080075)
76
77filegroup(
James Kuszmaul3ae42262019-11-08 12:33:41 -080078 name = "clang_6p0_strip_files",
Brian Silverman5c00e232018-08-12 02:08:32 -070079 srcs = [
James Kuszmaul3ae42262019-11-08 12:33:41 -080080 "//tools/cpp/clang_6p0:strip",
81 "@clang_6p0_repo//:compiler_pieces",
Brian Silverman5c00e232018-08-12 02:08:32 -070082 ],
83)
84
85filegroup(
James Kuszmaul3ae42262019-11-08 12:33:41 -080086 name = "clang_6p0_compiler_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080087 srcs = [
Brian Silverman7b8899e2018-06-30 19:19:24 -070088 "flags_compiler_inputs",
James Kuszmaul3ae42262019-11-08 12:33:41 -080089 "//tools/cpp/clang_6p0:clang",
90 "//tools/cpp/clang_6p0:ld",
91 "@clang_6p0_repo//:compiler_components",
92 "@clang_6p0_repo//:compiler_pieces",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080093 ],
Brian Silverman12b3fc52015-10-11 19:38:33 -040094)
95
96cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080097 name = "cc-compiler-k8",
James Kuszmaul3ae42262019-11-08 12:33:41 -080098 all_files = ":clang_6p0_all_files",
99 compiler_files = ":clang_6p0_compiler_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800100 cpu = "k8",
101 dwp_files = ":empty",
102 dynamic_runtime_libs = [":empty"],
James Kuszmaul3ae42262019-11-08 12:33:41 -0800103 linker_files = ":clang_6p0_linker_files",
104 objcopy_files = "//tools/cpp/clang_6p0:objcopy",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800105 static_runtime_libs = [":empty"],
James Kuszmaul3ae42262019-11-08 12:33:41 -0800106 strip_files = ":clang_6p0_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800107 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700108 toolchain_identifier = "k8_linux",
Brian Silverman12b3fc52015-10-11 19:38:33 -0400109)
Austin Schuh23da18b2015-10-11 20:52:49 -0700110
Austin Schuh55139fe2015-10-14 23:55:24 -0700111filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800112 name = "roborio-compiler-files",
113 srcs = [
114 ":flags_compiler_inputs",
115 "//tools/cpp/arm-frc-linux-gnueabi:as",
116 "//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers",
117 "@arm_frc_linux_gnueabi_repo//:compiler_pieces",
118 ],
Austin Schuh55139fe2015-10-14 23:55:24 -0700119)
120
121filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800122 name = "roborio_linker_files",
123 srcs = [
124 "//tools/cpp/arm-frc-linux-gnueabi:ar",
125 "//tools/cpp/arm-frc-linux-gnueabi:gcc",
126 "//tools/cpp/arm-frc-linux-gnueabi:ld",
127 "//tools/cpp/arm-frc-linux-gnueabi:libs",
128 "@arm_frc_linux_gnueabi_repo//:compiler_pieces",
129 ],
Austin Schuh55139fe2015-10-14 23:55:24 -0700130)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800131
Austin Schuh55139fe2015-10-14 23:55:24 -0700132filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800133 name = "roborio_compiler_files",
134 srcs = [
135 "//tools/cpp/arm-frc-linux-gnueabi:gcc",
136 "//tools/cpp/arm-frc-linux-gnueabi:ld",
137 "@arm_frc_linux_gnueabi_repo//:compiler_components",
138 "@arm_frc_linux_gnueabi_repo//:compiler_pieces",
139 ],
Austin Schuh55139fe2015-10-14 23:55:24 -0700140)
141
Brian Silverman50b9ac02018-08-12 13:24:10 -0700142filegroup(
143 name = "roborio_strip_files",
144 srcs = [
145 "//tools/cpp/arm-frc-linux-gnueabi:strip",
146 "@arm_frc_linux_gnueabi_repo//:compiler_pieces",
147 ],
148)
149
Austin Schuh23da18b2015-10-11 20:52:49 -0700150cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800151 name = "cc-compiler-roborio",
152 all_files = ":roborio-compiler-files",
153 compiler_files = ":roborio_compiler_files",
154 cpu = "roborio",
155 dwp_files = ":empty",
156 dynamic_runtime_libs = [":empty"],
157 linker_files = ":roborio_linker_files",
158 objcopy_files = "//tools/cpp/arm-frc-linux-gnueabi:objcopy",
159 static_runtime_libs = [":empty"],
Brian Silverman50b9ac02018-08-12 13:24:10 -0700160 strip_files = ":roborio_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800161 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700162 toolchain_identifier = "roborio_linux",
Austin Schuh23da18b2015-10-11 20:52:49 -0700163)
Brian Silverman0d57fc82016-01-24 21:02:53 -0500164
165filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800166 name = "linaro-gcc-files",
167 srcs = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800168 ":clang_6p0_all_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800169 "//tools/cpp/linaro_linux_gcc:clang-symlinks",
170 "//tools/cpp/linaro_linux_gcc:tool-wrappers",
James Kuszmaul3ae42262019-11-08 12:33:41 -0800171 "@linaro_linux_gcc_repo//:compiler_pieces",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800172 ],
Brian Silverman0d57fc82016-01-24 21:02:53 -0500173)
174
175filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800176 name = "linaro_linux_linker_files",
177 srcs = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800178 ":clang_6p0_linker_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800179 "//tools/cpp/linaro_linux_gcc:ar",
180 "//tools/cpp/linaro_linux_gcc:clang",
181 "//tools/cpp/linaro_linux_gcc:clang-ld",
182 "//tools/cpp/linaro_linux_gcc:clang-symlinks",
183 "//tools/cpp/linaro_linux_gcc:gcc",
184 "//tools/cpp/linaro_linux_gcc:ld",
James Kuszmaul3ae42262019-11-08 12:33:41 -0800185 "@linaro_linux_gcc_repo//:compiler_pieces",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800186 ],
Brian Silverman0d57fc82016-01-24 21:02:53 -0500187)
188
189filegroup(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800190 name = "linaro_linux_compiler_files",
191 srcs = [
James Kuszmaul3ae42262019-11-08 12:33:41 -0800192 ":clang_6p0_compiler_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800193 "//tools/cpp/linaro_linux_gcc:as",
194 "//tools/cpp/linaro_linux_gcc:clang",
195 "//tools/cpp/linaro_linux_gcc:gcc",
196 "//tools/cpp/linaro_linux_gcc:ld",
James Kuszmaul3ae42262019-11-08 12:33:41 -0800197 "@linaro_linux_gcc_repo//:compiler_pieces",
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700198 ],
199)
200
201filegroup(
202 name = "linaro_linux_strip_files",
203 srcs = [
204 "//tools/cpp/linaro_linux_gcc:strip",
James Kuszmaul3ae42262019-11-08 12:33:41 -0800205 "@linaro_linux_gcc_repo//:compiler_pieces",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800206 ],
Brian Silverman0d57fc82016-01-24 21:02:53 -0500207)
208
209cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800210 name = "cc-compiler-armhf-debian",
211 all_files = ":linaro-gcc-files",
212 compiler_files = ":linaro_linux_compiler_files",
213 cpu = "armhf",
214 dwp_files = ":empty",
215 dynamic_runtime_libs = [":empty"],
216 linker_files = ":linaro_linux_linker_files",
217 objcopy_files = "//tools/cpp/linaro_linux_gcc:objcopy",
218 static_runtime_libs = [":empty"],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700219 strip_files = ":linaro_linux_strip_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800220 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700221 toolchain_identifier = "clang_linux_armhf",
Brian Silverman0d57fc82016-01-24 21:02:53 -0500222)
Brian Silverman8b638692017-06-26 23:10:26 -0700223
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700224filegroup(
225 name = "gcc_arm_none_eabi_none_files",
226 srcs = [
227 "//tools/cpp/gcc_arm_none_eabi:tool-wrappers",
228 "@gcc_arm_none_eabi//:compiler_pieces",
229 ],
230)
231
232filegroup(
233 name = "gcc_arm_none_eabi_compiler_files",
234 srcs = [
235 "//tools/cpp/gcc_arm_none_eabi:as",
236 "//tools/cpp/gcc_arm_none_eabi:gcc",
237 "//tools/cpp/gcc_arm_none_eabi:ld",
238 ],
239)
240
241filegroup(
242 name = "gcc_arm_none_eabi_linker_files",
243 srcs = [
244 "//motors/core:linkerscripts",
245 "//tools/cpp/gcc_arm_none_eabi:ar",
246 "//tools/cpp/gcc_arm_none_eabi:gcc",
247 "//tools/cpp/gcc_arm_none_eabi:ld",
248 "@gcc_arm_none_eabi//:compiler_pieces",
249 ],
250)
251
Brian Silverman8b638692017-06-26 23:10:26 -0700252cc_toolchain(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800253 name = "cc-compiler-cortex-m4f",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700254 all_files = ":gcc_arm_none_eabi_none_files",
255 compiler_files = ":gcc_arm_none_eabi_compiler_files",
Brian Silverman7b8899e2018-06-30 19:19:24 -0700256 cpu = "cortex-m4f",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800257 dwp_files = ":empty",
258 dynamic_runtime_libs = [":empty"],
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700259 linker_files = ":gcc_arm_none_eabi_linker_files",
260 objcopy_files = "//tools/cpp/gcc_arm_none_eabi:objcopy",
261 static_runtime_libs = [":empty"],
262 strip_files = "//tools/cpp/gcc_arm_none_eabi:strip",
263 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700264 toolchain_identifier = "cortex-m4f",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700265)
266
267cc_toolchain(
268 name = "cc-compiler-cortex-m4f-k22",
269 all_files = ":gcc_arm_none_eabi_none_files",
270 compiler_files = ":gcc_arm_none_eabi_compiler_files",
271 cpu = "cortex-m4f-k22",
272 dwp_files = ":empty",
273 dynamic_runtime_libs = [":empty"],
274 linker_files = ":gcc_arm_none_eabi_linker_files",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800275 objcopy_files = ":empty",
276 static_runtime_libs = [":empty"],
277 strip_files = ":empty",
Brian Silverman6c8b88b2018-09-03 18:17:02 -0700278 supports_param_files = 1,
Austin Schuhe18baff2018-10-20 17:40:42 -0700279 toolchain_identifier = "cortex-m4f-k22",
Brian Silverman8b638692017-06-26 23:10:26 -0700280)
Brian Silverman7b8899e2018-06-30 19:19:24 -0700281
282py_binary(
283 name = "gen_crosstool",
284 srcs = ["gen_crosstool.py"],
285 main = "gen_crosstool.py",
286 deps = [
287 "//third_party/bazel:crosstool_config_proto_py",
288 ],
289)