blob: f5dfe10a03b05cdf8f1b530b0ac9562272c7de87 [file] [log] [blame]
Brian Silverman660d6092015-11-26 18:41:59 -05001package(default_visibility = ['//visibility:public'])
Brian Silverman12b3fc52015-10-11 19:38:33 -04002
3cc_library(
Brian Silverman63889f92015-11-27 01:33:56 -05004 name = 'empty_main',
5 srcs = [ 'empty_main.c' ],
6)
7
8cc_library(
Brian Silverman660d6092015-11-26 18:41:59 -05009 name = 'malloc',
Brian Silverman63889f92015-11-27 01:33:56 -050010 deps = select({
11 '//tools:has_asan': [],
12 '//tools:has_tsan': [],
Brian Silverman8b638692017-06-26 23:10:26 -070013 '//tools:cpu_cortex_m4f': [],
Brian Silverman63889f92015-11-27 01:33:56 -050014 '//conditions:default': ['//third_party/gperftools:tcmalloc'],
15 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040016)
17
18cc_library(
Brian Silverman660d6092015-11-26 18:41:59 -050019 name = 'stl',
Brian Silverman12b3fc52015-10-11 19:38:33 -040020)
21
22filegroup(
Brian Silverman660d6092015-11-26 18:41:59 -050023 name = 'empty',
24 srcs = [],
Brian Silverman12b3fc52015-10-11 19:38:33 -040025)
26
Brian Silvermanb200c172017-01-02 17:35:35 -080027# This is the entry point for --crosstool_top.
28cc_toolchain_suite(
Brian Silverman660d6092015-11-26 18:41:59 -050029 name = 'toolchain',
Brian Silvermanb200c172017-01-02 17:35:35 -080030 toolchains = {
31 'k8|clang': ':cc-compiler-k8',
32 'roborio|gcc': ':cc-compiler-roborio',
Brian Silvermane5e2a252017-02-19 17:48:55 -080033 'armhf-debian|clang': 'cc-compiler-armhf-debian',
Brian Silverman8b638692017-06-26 23:10:26 -070034 'cortex-m4f|gcc': 'cc-compiler-cortex-m4f',
Brian Silvermanb200c172017-01-02 17:35:35 -080035 },
Brian Silvermanb466eef2015-11-28 20:33:44 -050036)
37
38# Compiler inputs given by --copt etc in //tools:bazel.rc.
39filegroup(
40 name = 'flags_compiler_inputs',
Brian Silverman0d57fc82016-01-24 21:02:53 -050041 srcs = select({
42 '//tools:has_asan': [
43 'asan-blacklist',
44 ],
45 '//tools:has_ubsan': [
46 'ubsan-blacklist',
47 ],
48 '//conditions:default': [],
49 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040050)
51
52cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -050053 name = 'cc-compiler-k8',
Brian Silvermanb466eef2015-11-28 20:33:44 -050054 all_files = ':flags_compiler_inputs',
55 compiler_files = ':flags_compiler_inputs',
Brian Silverman660d6092015-11-26 18:41:59 -050056 cpu = 'local',
57 dwp_files = ':empty',
58 dynamic_runtime_libs = [':empty'],
59 linker_files = ':empty',
60 objcopy_files = ':empty',
61 static_runtime_libs = [':empty'],
62 strip_files = ':empty',
63 supports_param_files = 1,
Brian Silverman12b3fc52015-10-11 19:38:33 -040064)
Austin Schuh23da18b2015-10-11 20:52:49 -070065
Austin Schuh55139fe2015-10-14 23:55:24 -070066filegroup(
67 name = 'roborio-compiler-files',
68 srcs = [
69 '//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers',
Brian Silvermanb2215d02015-11-23 19:10:15 -050070 '//tools/cpp/arm-frc-linux-gnueabi:as',
Brian Silverman826e1cd2016-01-31 18:26:00 -050071 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Brian Silvermanb466eef2015-11-28 20:33:44 -050072 ':flags_compiler_inputs',
Austin Schuh55139fe2015-10-14 23:55:24 -070073 ],
74)
75
76filegroup(
77 name = 'roborio_linker_files',
78 srcs = [
79 '//tools/cpp/arm-frc-linux-gnueabi:ld',
80 '//tools/cpp/arm-frc-linux-gnueabi:ar',
Brian Silvermanb2215d02015-11-23 19:10:15 -050081 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
Brian Silvermanb200c172017-01-02 17:35:35 -080082 '//tools/cpp/arm-frc-linux-gnueabi:libs',
Brian Silverman826e1cd2016-01-31 18:26:00 -050083 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Austin Schuh55139fe2015-10-14 23:55:24 -070084 ],
85)
86filegroup(
87 name = 'roborio_compiler_files',
88 srcs = [
89 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
90 '//tools/cpp/arm-frc-linux-gnueabi:ld',
Brian Silvermanb200c172017-01-02 17:35:35 -080091 '@arm_frc_linux_gnueabi_repo//:compiler_components',
92 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Austin Schuh55139fe2015-10-14 23:55:24 -070093 ],
94)
95
Austin Schuh23da18b2015-10-11 20:52:49 -070096cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -050097 name = 'cc-compiler-roborio',
98 all_files = ':roborio-compiler-files',
99 compiler_files = ':roborio_compiler_files',
100 cpu = 'roborio',
101 dwp_files = ':empty',
102 dynamic_runtime_libs = [':empty'],
103 linker_files = ':roborio_linker_files',
104 objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
105 static_runtime_libs = [':empty'],
106 strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
107 supports_param_files = 1,
Austin Schuh23da18b2015-10-11 20:52:49 -0700108)
Brian Silverman0d57fc82016-01-24 21:02:53 -0500109
110filegroup(
111 name = 'linaro-gcc-files',
112 srcs = [
113 '//tools/cpp/linaro_linux_gcc:clang-symlinks',
114 '//tools/cpp/linaro_linux_gcc:tool-wrappers',
Austin Schuh61660832016-03-04 21:56:39 -0800115 '@linaro_linux_gcc_4_9_repo//:compiler_pieces',
Brian Silverman0d57fc82016-01-24 21:02:53 -0500116 ],
117)
118
119filegroup(
120 name = 'linaro_linux_linker_files',
121 srcs = [
122 '//tools/cpp/linaro_linux_gcc:gcc',
123 '//tools/cpp/linaro_linux_gcc:ld',
124 '//tools/cpp/linaro_linux_gcc:ar',
125 '//tools/cpp/linaro_linux_gcc:clang-ld',
126 '//tools/cpp/linaro_linux_gcc:clang',
Austin Schuh61660832016-03-04 21:56:39 -0800127 '@linaro_linux_gcc_4_9_repo//:compiler_pieces',
Brian Silvermane5e2a252017-02-19 17:48:55 -0800128 '//tools/cpp/linaro_linux_gcc:clang-symlinks',
Brian Silverman0d57fc82016-01-24 21:02:53 -0500129 ],
130)
131
132filegroup(
133 name = 'linaro_linux_compiler_files',
134 srcs = [
135 '//tools/cpp/linaro_linux_gcc:gcc',
136 '//tools/cpp/linaro_linux_gcc:ld',
137 '//tools/cpp/linaro_linux_gcc:clang',
138 '//tools/cpp/linaro_linux_gcc:as',
139 ],
140)
141
142cc_toolchain(
143 name = 'cc-compiler-armhf-debian',
144 all_files = ':linaro-gcc-files',
145 compiler_files = ':linaro_linux_compiler_files',
146 cpu = 'armhf',
147 dwp_files = ':empty',
148 dynamic_runtime_libs = [':empty'],
149 linker_files = ':linaro_linux_linker_files',
150 objcopy_files = '//tools/cpp/linaro_linux_gcc:objcopy',
151 static_runtime_libs = [':empty'],
152 strip_files = '//tools/cpp/linaro_linux_gcc:strip',
153 supports_param_files = 1,
154)
Brian Silverman8b638692017-06-26 23:10:26 -0700155
156cc_toolchain(
157 name = 'cc-compiler-cortex-m4f',
158 all_files = ':empty',
159 compiler_files = ':empty',
160 cpu = 'cortex-m4',
161 dwp_files = ':empty',
162 dynamic_runtime_libs = [':empty'],
163 linker_files = '//motors/core:linkerscript',
164 objcopy_files = ':empty',
165 static_runtime_libs = [':empty'],
166 strip_files = ':empty',
167 supports_param_files = 0,
168)