blob: ef4c2b360beef4f700a5b1f0a19eccf45cdd9962 [file] [log] [blame]
jcaterf5c8c0b2018-03-27 07:22:35 -07001# Copyright 2018 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
aldersondrive644b7d412020-01-10 07:48:15 -080015# This becomes the BUILD file for @local_config_cc// under FreeBSD and OpenBSD.
jcaterf5c8c0b2018-03-27 07:22:35 -070016
rosica5ee6d352019-08-09 07:24:36 -070017load(":cc_toolchain_config.bzl", "cc_toolchain_config")
rupertsc0f0f8d2021-06-14 15:52:09 -070018load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
rosica71bc38f2019-02-04 02:39:30 -080019
Xavier Bonaventura36116ce2021-04-06 02:23:40 -070020package(default_visibility = ["//visibility:public"])
21
jcaterf5c8c0b2018-03-27 07:22:35 -070022cc_library(
23 name = "malloc",
24)
25
jcaterf5c8c0b2018-03-27 07:22:35 -070026filegroup(
27 name = "empty",
28 srcs = [],
29)
30
31# Hardcoded toolchain, legacy behaviour.
32cc_toolchain_suite(
33 name = "toolchain",
34 toolchains = {
35 "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
36 "freebsd|compiler": ":cc-compiler-freebsd",
aldersondrive644b7d412020-01-10 07:48:15 -080037 "openbsd|compiler": ":cc-compiler-openbsd",
rosica547bf422018-09-06 02:10:02 -070038 "armeabi-v7a": ":cc-compiler-armeabi-v7a",
39 "freebsd": ":cc-compiler-freebsd",
aldersondrive644b7d412020-01-10 07:48:15 -080040 "openbsd": ":cc-compiler-openbsd",
jcaterf5c8c0b2018-03-27 07:22:35 -070041 },
42)
43
44cc_toolchain(
45 name = "cc-compiler-freebsd",
46 all_files = ":empty",
Googler28953cb2018-12-05 10:46:00 -080047 ar_files = ":empty",
48 as_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -070049 compiler_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -070050 dwp_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -070051 linker_files = ":empty",
52 objcopy_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -070053 strip_files = ":empty",
54 supports_param_files = 0,
hlopko1a256682019-10-24 07:01:01 -070055 toolchain_config = ":local_freebsd",
56 toolchain_identifier = "local_freebsd",
jcaterf5c8c0b2018-03-27 07:22:35 -070057)
58
rosica71bc38f2019-02-04 02:39:30 -080059cc_toolchain_config(
60 name = "local_freebsd",
61 cpu = "freebsd",
rosica71bc38f2019-02-04 02:39:30 -080062)
63
jcaterf5c8c0b2018-03-27 07:22:35 -070064toolchain(
65 name = "cc-toolchain-freebsd",
66 exec_compatible_with = [
hlopko71a213c2019-06-21 02:01:33 -070067 "@platforms//cpu:x86_64",
68 "@platforms//os:freebsd",
jcaterf5c8c0b2018-03-27 07:22:35 -070069 ],
70 target_compatible_with = [
hlopko71a213c2019-06-21 02:01:33 -070071 "@platforms//cpu:x86_64",
72 "@platforms//os:freebsd",
jcaterf5c8c0b2018-03-27 07:22:35 -070073 ],
74 toolchain = ":cc-compiler-freebsd",
75 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
76)
77
78cc_toolchain(
aldersondrive644b7d412020-01-10 07:48:15 -080079 name = "cc-compiler-openbsd",
80 all_files = ":empty",
81 ar_files = ":empty",
82 as_files = ":empty",
83 compiler_files = ":empty",
84 dwp_files = ":empty",
85 linker_files = ":empty",
86 objcopy_files = ":empty",
87 strip_files = ":empty",
88 supports_param_files = 0,
89 toolchain_config = ":local_openbsd",
90 toolchain_identifier = "local_openbsd",
91)
92
93cc_toolchain_config(
94 name = "local_openbsd",
95 cpu = "openbsd",
96)
97
98toolchain(
99 name = "cc-toolchain-openbsd",
100 exec_compatible_with = [
101 "@platforms//cpu:x86_64",
102 "@platforms//os:openbsd",
103 ],
104 target_compatible_with = [
105 "@platforms//cpu:x86_64",
106 "@platforms//os:openbsd",
107 ],
108 toolchain = ":cc-compiler-openbsd",
109 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
110)
111
112cc_toolchain(
jcaterf5c8c0b2018-03-27 07:22:35 -0700113 name = "cc-compiler-armeabi-v7a",
114 all_files = ":empty",
Googler28953cb2018-12-05 10:46:00 -0800115 ar_files = ":empty",
116 as_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -0700117 compiler_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -0700118 dwp_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -0700119 linker_files = ":empty",
120 objcopy_files = ":empty",
jcaterf5c8c0b2018-03-27 07:22:35 -0700121 strip_files = ":empty",
122 supports_param_files = 0,
hlopko1a256682019-10-24 07:01:01 -0700123 toolchain_config = ":stub_armeabi-v7a",
124 toolchain_identifier = "stub_armeabi-v7a",
jcaterf5c8c0b2018-03-27 07:22:35 -0700125)
126
rosica71bc38f2019-02-04 02:39:30 -0800127cc_toolchain_config(
128 name = "stub_armeabi-v7a",
129 cpu = "armeabi-v7a",
rosica71bc38f2019-02-04 02:39:30 -0800130)
131
jcaterf5c8c0b2018-03-27 07:22:35 -0700132toolchain(
133 name = "cc-toolchain-armeabi-v7a",
134 exec_compatible_with = [
hlopko71a213c2019-06-21 02:01:33 -0700135 "@platforms//cpu:arm",
jcaterf5c8c0b2018-03-27 07:22:35 -0700136 ],
137 target_compatible_with = [
hlopko71a213c2019-06-21 02:01:33 -0700138 "@platforms//cpu:arm",
139 "@platforms//os:android",
jcaterf5c8c0b2018-03-27 07:22:35 -0700140 ],
141 toolchain = ":cc-compiler-armeabi-v7a",
142 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
143)
144
jcaterf5c8c0b2018-03-27 07:22:35 -0700145filegroup(
146 name = "link_dynamic_library",
147 srcs = ["link_dynamic_library.sh"],
148)