blob: 40e674fc7daa0c1362cc09c4f0c0baf50a5872fd [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': [],
13 '//conditions:default': ['//third_party/gperftools:tcmalloc'],
14 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040015)
16
17cc_library(
Brian Silverman660d6092015-11-26 18:41:59 -050018 name = 'stl',
Brian Silverman12b3fc52015-10-11 19:38:33 -040019)
20
21filegroup(
Brian Silverman660d6092015-11-26 18:41:59 -050022 name = 'empty',
23 srcs = [],
Brian Silverman12b3fc52015-10-11 19:38:33 -040024)
25
26# This is the entry point for --crosstool_top. Toolchains are found
27# by lopping off the name of --crosstool_top and searching for
Brian Silverman660d6092015-11-26 18:41:59 -050028# 'cc-compiler-${CPU}' in this BUILD file, where CPU is the target CPU
Brian Silverman12b3fc52015-10-11 19:38:33 -040029# specified in --cpu.
30#
31# This file group should include
32# * all cc_toolchain targets supported
33# * all file groups that said cc_toolchain might refer to,
34# including the default_grte_top setting in the CROSSTOOL
35# protobuf.
36filegroup(
Brian Silverman660d6092015-11-26 18:41:59 -050037 name = 'toolchain',
38 srcs = [
Brian Silverman660d6092015-11-26 18:41:59 -050039 ':cc-compiler-k8',
40 ':cc-compiler-roborio',
Brian Silverman826e1cd2016-01-31 18:26:00 -050041 '@arm_frc_linux_gnueabi_repo//:compiler_components',
Brian Silverman660d6092015-11-26 18:41:59 -050042 ':roborio-compiler-files',
Brian Silvermanb466eef2015-11-28 20:33:44 -050043 ':flags_compiler_inputs',
Austin Schuh61660832016-03-04 21:56:39 -080044 '@linaro_linux_gcc_4_9_repo//:compiler_components',
Brian Silverman0d57fc82016-01-24 21:02:53 -050045 ':linaro-gcc-files',
Brian Silvermanb466eef2015-11-28 20:33:44 -050046 ],
47)
48
49# Compiler inputs given by --copt etc in //tools:bazel.rc.
50filegroup(
51 name = 'flags_compiler_inputs',
Brian Silverman0d57fc82016-01-24 21:02:53 -050052 srcs = select({
53 '//tools:has_asan': [
54 'asan-blacklist',
55 ],
56 '//tools:has_ubsan': [
57 'ubsan-blacklist',
58 ],
59 '//conditions:default': [],
60 }),
Brian Silverman12b3fc52015-10-11 19:38:33 -040061)
62
63cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -050064 name = 'cc-compiler-k8',
Brian Silvermanb466eef2015-11-28 20:33:44 -050065 all_files = ':flags_compiler_inputs',
66 compiler_files = ':flags_compiler_inputs',
Brian Silverman660d6092015-11-26 18:41:59 -050067 cpu = 'local',
68 dwp_files = ':empty',
69 dynamic_runtime_libs = [':empty'],
70 linker_files = ':empty',
71 objcopy_files = ':empty',
72 static_runtime_libs = [':empty'],
73 strip_files = ':empty',
74 supports_param_files = 1,
Brian Silverman12b3fc52015-10-11 19:38:33 -040075)
Austin Schuh23da18b2015-10-11 20:52:49 -070076
Austin Schuh55139fe2015-10-14 23:55:24 -070077filegroup(
78 name = 'roborio-compiler-files',
79 srcs = [
80 '//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers',
Brian Silvermanb2215d02015-11-23 19:10:15 -050081 '//tools/cpp/arm-frc-linux-gnueabi:as',
Brian Silverman826e1cd2016-01-31 18:26:00 -050082 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Brian Silvermanb466eef2015-11-28 20:33:44 -050083 ':flags_compiler_inputs',
Austin Schuh55139fe2015-10-14 23:55:24 -070084 ],
85)
86
87filegroup(
88 name = 'roborio_linker_files',
89 srcs = [
90 '//tools/cpp/arm-frc-linux-gnueabi:ld',
91 '//tools/cpp/arm-frc-linux-gnueabi:ar',
Brian Silvermanb2215d02015-11-23 19:10:15 -050092 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
Brian Silverman826e1cd2016-01-31 18:26:00 -050093 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Austin Schuh55139fe2015-10-14 23:55:24 -070094 ],
95)
96filegroup(
97 name = 'roborio_compiler_files',
98 srcs = [
99 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
100 '//tools/cpp/arm-frc-linux-gnueabi:ld',
101 ],
102)
103
Austin Schuh23da18b2015-10-11 20:52:49 -0700104cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -0500105 name = 'cc-compiler-roborio',
106 all_files = ':roborio-compiler-files',
107 compiler_files = ':roborio_compiler_files',
108 cpu = 'roborio',
109 dwp_files = ':empty',
110 dynamic_runtime_libs = [':empty'],
111 linker_files = ':roborio_linker_files',
112 objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
113 static_runtime_libs = [':empty'],
114 strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
115 supports_param_files = 1,
Austin Schuh23da18b2015-10-11 20:52:49 -0700116)
Brian Silverman0d57fc82016-01-24 21:02:53 -0500117
118filegroup(
119 name = 'linaro-gcc-files',
120 srcs = [
121 '//tools/cpp/linaro_linux_gcc:clang-symlinks',
122 '//tools/cpp/linaro_linux_gcc:tool-wrappers',
Austin Schuh61660832016-03-04 21:56:39 -0800123 '@linaro_linux_gcc_4_9_repo//:compiler_pieces',
Brian Silverman0d57fc82016-01-24 21:02:53 -0500124 ],
125)
126
127filegroup(
128 name = 'linaro_linux_linker_files',
129 srcs = [
130 '//tools/cpp/linaro_linux_gcc:gcc',
131 '//tools/cpp/linaro_linux_gcc:ld',
132 '//tools/cpp/linaro_linux_gcc:ar',
133 '//tools/cpp/linaro_linux_gcc:clang-ld',
134 '//tools/cpp/linaro_linux_gcc:clang',
Austin Schuh61660832016-03-04 21:56:39 -0800135 '@linaro_linux_gcc_4_9_repo//:compiler_pieces',
Brian Silverman0d57fc82016-01-24 21:02:53 -0500136 ],
137)
138
139filegroup(
140 name = 'linaro_linux_compiler_files',
141 srcs = [
142 '//tools/cpp/linaro_linux_gcc:gcc',
143 '//tools/cpp/linaro_linux_gcc:ld',
144 '//tools/cpp/linaro_linux_gcc:clang',
145 '//tools/cpp/linaro_linux_gcc:as',
146 ],
147)
148
149cc_toolchain(
150 name = 'cc-compiler-armhf-debian',
151 all_files = ':linaro-gcc-files',
152 compiler_files = ':linaro_linux_compiler_files',
153 cpu = 'armhf',
154 dwp_files = ':empty',
155 dynamic_runtime_libs = [':empty'],
156 linker_files = ':linaro_linux_linker_files',
157 objcopy_files = '//tools/cpp/linaro_linux_gcc:objcopy',
158 static_runtime_libs = [':empty'],
159 strip_files = '//tools/cpp/linaro_linux_gcc:strip',
160 supports_param_files = 1,
161)