blob: 1708a9fd1093d34deb5ae453342058c50843a1d4 [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',
44 ],
45)
46
47# Compiler inputs given by --copt etc in //tools:bazel.rc.
48filegroup(
49 name = 'flags_compiler_inputs',
50 # TODO(Brian): Change this to a select which only has the right files under
51 # the right configurations once that works.
52 srcs = [
53 'asan-blacklist',
54 'ubsan-blacklist',
Brian Silverman660d6092015-11-26 18:41:59 -050055 ],
Brian Silverman12b3fc52015-10-11 19:38:33 -040056)
57
58cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -050059 name = 'cc-compiler-k8',
Brian Silvermanb466eef2015-11-28 20:33:44 -050060 all_files = ':flags_compiler_inputs',
61 compiler_files = ':flags_compiler_inputs',
Brian Silverman660d6092015-11-26 18:41:59 -050062 cpu = 'local',
63 dwp_files = ':empty',
64 dynamic_runtime_libs = [':empty'],
65 linker_files = ':empty',
66 objcopy_files = ':empty',
67 static_runtime_libs = [':empty'],
68 strip_files = ':empty',
69 supports_param_files = 1,
Brian Silverman12b3fc52015-10-11 19:38:33 -040070)
Austin Schuh23da18b2015-10-11 20:52:49 -070071
Austin Schuh55139fe2015-10-14 23:55:24 -070072filegroup(
73 name = 'roborio-compiler-files',
74 srcs = [
75 '//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers',
Brian Silvermanb2215d02015-11-23 19:10:15 -050076 '//tools/cpp/arm-frc-linux-gnueabi:as',
Brian Silverman826e1cd2016-01-31 18:26:00 -050077 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Brian Silvermanb466eef2015-11-28 20:33:44 -050078 ':flags_compiler_inputs',
Austin Schuh55139fe2015-10-14 23:55:24 -070079 ],
80)
81
82filegroup(
83 name = 'roborio_linker_files',
84 srcs = [
85 '//tools/cpp/arm-frc-linux-gnueabi:ld',
86 '//tools/cpp/arm-frc-linux-gnueabi:ar',
Brian Silvermanb2215d02015-11-23 19:10:15 -050087 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
Brian Silverman826e1cd2016-01-31 18:26:00 -050088 '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
Austin Schuh55139fe2015-10-14 23:55:24 -070089 ],
90)
91filegroup(
92 name = 'roborio_compiler_files',
93 srcs = [
94 '//tools/cpp/arm-frc-linux-gnueabi:gcc',
95 '//tools/cpp/arm-frc-linux-gnueabi:ld',
96 ],
97)
98
Austin Schuh23da18b2015-10-11 20:52:49 -070099cc_toolchain(
Brian Silverman660d6092015-11-26 18:41:59 -0500100 name = 'cc-compiler-roborio',
101 all_files = ':roborio-compiler-files',
102 compiler_files = ':roborio_compiler_files',
103 cpu = 'roborio',
104 dwp_files = ':empty',
105 dynamic_runtime_libs = [':empty'],
106 linker_files = ':roborio_linker_files',
107 objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
108 static_runtime_libs = [':empty'],
109 strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
110 supports_param_files = 1,
Austin Schuh23da18b2015-10-11 20:52:49 -0700111)