Skip to content

Commit 9f170e6

Browse files
authored
[libc][bazel] Convert "errno" to libc_support_library. (#130368)
This shouldn't really be a "libc_function" since it can be used as a dependency of various other support libraries and functions, and doesn't correspond to a well-defined endpoint that the users may want to explicitly depend on (if they depend on it implicitly through a libc_function whose implementation relies on errno, the dependency will be pulled in normally). Remove special handling for "errno" in the Bazel test rules. This is one more cleanup step unlocking the plan outlined in #130327
1 parent 0a1f7f0 commit 9f170e6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,9 @@ libc_support_library(
15981598
],
15991599
)
16001600

1601-
############################### errno targets ################################
1601+
############################### errno ########################################
16021602

1603-
libc_function(
1603+
libc_support_library(
16041604
name = "errno",
16051605
srcs = ["src/errno/libc_errno.cpp"],
16061606
hdrs = ["src/errno/libc_errno.h"],

utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def libc_test(name, srcs, libc_function_deps = [], copts = [], deps = [], local_
2727
local_defines: The list of target local_defines if any.
2828
**kwargs: Attributes relevant for a libc_test. For example, name, srcs.
2929
"""
30-
all_function_deps = libc_function_deps + ["//libc:errno"]
3130
native.cc_test(
3231
name = name,
3332
srcs = srcs,
3433
local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
35-
deps = [libc_internal_target(d) for d in all_function_deps] + [
34+
deps = [libc_internal_target(d) for d in libc_function_deps] + [
3635
"//libc/test/UnitTest:LibcUnitTest",
3736
"//libc:__support_macros_config",
37+
"//libc:errno",
3838
"//libc:func_aligned_alloc",
3939
"//libc:func_free",
4040
"//libc:func_malloc",

utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ libc_test_library(
186186
"//libc:__support_cpp_type_traits",
187187
"//libc:__support_ctype_utils",
188188
"//libc:__support_macros_properties_architectures",
189-
"//libc:errno.__internal__",
189+
"//libc:errno",
190190
"//libc/test/UnitTest:LibcUnitTest",
191191
],
192192
)

0 commit comments

Comments
 (0)