xref: /aosp_15_r20/external/bazelbuild-rules_cc/cc/private/toolchain/BUILD.static.freebsd (revision eed53cd41c5909d05eedc7ad9720bb158fd93452)
1# 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
15# This becomes the BUILD file for @local_config_cc// under FreeBSD.
16
17package(default_visibility = ["//visibility:public"])
18
19load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
20load(":cc_toolchain_config.bzl", "cc_toolchain_config")
21
22cc_library(
23    name = "malloc",
24)
25
26filegroup(
27    name = "empty",
28    srcs = [],
29)
30
31# Hardcoded toolchain, legacy behaviour.
32cc_toolchain_suite(
33    name = "toolchain",
34    toolchains = {
35        "armeabi-v7a": ":cc-compiler-armeabi-v7a",
36        "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
37        "freebsd": ":cc-compiler-freebsd",
38        "freebsd|compiler": ":cc-compiler-freebsd",
39    },
40)
41
42cc_toolchain(
43    name = "cc-compiler-freebsd",
44    all_files = ":empty",
45    ar_files = ":empty",
46    as_files = ":empty",
47    compiler_files = ":empty",
48    dwp_files = ":empty",
49    linker_files = ":empty",
50    objcopy_files = ":empty",
51    strip_files = ":empty",
52    supports_param_files = 0,
53    toolchain_config = ":local_freebsd",
54    toolchain_identifier = "local_freebsd",
55)
56
57cc_toolchain_config(
58    name = "local_freebsd",
59    cpu = "freebsd",
60)
61
62toolchain(
63    name = "cc-toolchain-freebsd",
64    exec_compatible_with = [
65        "@platforms//cpu:x86_64",
66        "@platforms//os:freebsd",
67    ],
68    target_compatible_with = [
69        "@platforms//cpu:x86_64",
70        "@platforms//os:freebsd",
71    ],
72    toolchain = ":cc-compiler-freebsd",
73    toolchain_type = "@rules_cc//cc:toolchain_type",
74)
75
76cc_toolchain(
77    name = "cc-compiler-armeabi-v7a",
78    all_files = ":empty",
79    ar_files = ":empty",
80    as_files = ":empty",
81    compiler_files = ":empty",
82    dwp_files = ":empty",
83    linker_files = ":empty",
84    objcopy_files = ":empty",
85    strip_files = ":empty",
86    supports_param_files = 0,
87    toolchain_config = ":stub_armeabi-v7a",
88    toolchain_identifier = "stub_armeabi-v7a",
89)
90
91cc_toolchain_config(
92    name = "stub_armeabi-v7a",
93    cpu = "armeabi-v7a",
94)
95
96toolchain(
97    name = "cc-toolchain-armeabi-v7a",
98    exec_compatible_with = [
99        "@platforms//cpu:arm",
100    ],
101    target_compatible_with = [
102        "@platforms//cpu:arm",
103        "@platforms//os:android",
104    ],
105    toolchain = ":cc-compiler-armeabi-v7a",
106    toolchain_type = "@rules_cc//cc:toolchain_type",
107)
108
109filegroup(
110    name = "link_dynamic_library",
111    srcs = ["link_dynamic_library.sh"],
112)
113