Debian Codegraph @

utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel

raw
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5 package(
6 default_visibility = ["//visibility:public"],
7 features = ["layering_check"],
8 )
9
10 licenses(["notice"])
11
12 cc_library(
13 name = "config",
14 defines = select({
15 "@platforms//os:linux": [
16 "COMPILER_RT_HAS_ATOMICS=1",
17 "COMPILER_RT_HAS_FCNTL_LCK=1",
18 "COMPILER_RT_HAS_UNAME=1",
19 ],
20 # Will raise error unless supported platforms.
21 }),
22 target_compatible_with = select({
23 "@platforms//os:linux": [],
24 "//conditions:default": ["@platforms//:incompatible"],
25 }),
26 )
27
28 WIN32_ONLY_FILES = [
29 "lib/profile/WindowsMMap.c",
30 ]
31
32 cc_library(
33 name = "profile",
34 srcs = glob(
35 [
36 "lib/profile/*.c",
37 "lib/profile/*.cpp",
38 "lib/profile/*.h",
39 ],
40 exclude = WIN32_ONLY_FILES,
41 ) + select({
42 "@platforms//os:windows": WIN32_ONLY_FILES,
43 "//conditions:default": [],
44 }),
45 hdrs = glob([
46 "include/profile/*.h",
47 "include/profile/*.inc",
48 ]),
49 includes = [
50 "include",
51 ],
52 linkstatic = True,
53 deps = [
54 ":config",
55 ],
56 )
57
58 cc_library(
59 name = "orc_rt_common_headers",
60 hdrs = [
61 "lib/orc/adt.h",
62 "lib/orc/bitmask_enum.h",
63 "lib/orc/common.h",
64 "lib/orc/compiler.h",
65 "lib/orc/debug.h",
66 "lib/orc/endianness.h",
67 "lib/orc/error.h",
68 "lib/orc/executor_address.h",
69 "lib/orc/executor_symbol_def.h",
70 "lib/orc/extensible_rtti.h",
71 "lib/orc/interval_map.h",
72 "lib/orc/interval_set.h",
73 "lib/orc/simple_packed_serialization.h",
74 "lib/orc/stl_extras.h",
75 "lib/orc/string_pool.h",
76 "lib/orc/wrapper_function_utils.h",
77 ],
78 strip_include_prefix = "lib/orc",
79 )
80
81 cc_library(
82 name = "orc_rt",
83 srcs = [
84 "lib/orc/debug.cpp",
85 "lib/orc/dlfcn_wrapper.cpp",
86 "lib/orc/extensible_rtti.cpp",
87 "lib/orc/log_error_to_stderr.cpp",
88 "lib/orc/run_program_wrapper.cpp",
89 ] + select({
90 "@platforms//os:macos": [
91 "lib/orc/macho_platform.cpp",
92 "lib/orc/macho_platform.h",
93 "lib/orc/macho_tlv.arm64.S",
94 "lib/orc/macho_tlv.x86-64.S",
95 ],
96 "@platforms//os:linux": [
97 "lib/orc/elfnix_platform.cpp",
98 "lib/orc/elfnix_platform.h",
99 "lib/orc/elfnix_tls.aarch64.S",
100 "lib/orc/elfnix_tls.ppc64.S",
101 "lib/orc/elfnix_tls.x86-64.S",
102 ],
103 }),
104 hdrs = glob(["include/orc_rt/*.h"]),
105 includes = ["include"],
106 linkstatic = True,
107 deps = [
108 ":orc_rt_common_headers",
109 ],
110 )