Skip to content

[bazel] Use rules_cc everywhere and reformat #149584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rupprecht
Copy link
Collaborator

We already use cc rules from @rules_cc//cc:defs.bzl in a few files, but this uses it everywhere. Done automatically by running buildifier --lint=fix --warnings=native-cc-binary,native-cc-library,native-cc-test,load over all the files. I also ran buildifier once more to ensure there wasn't any missing formatting, so that caused a few unrelated diffs.

We already use cc rules from `@rules_cc//cc:defs.bzl` in a few files, but this uses it everywhere. Done automatically by running `buildifier --lint=fix --warnings=native-cc-binary,native-cc-library,native-cc-test,load` over all the files. I also ran `buildifier` once more to ensure there wasn't any missing formatting, so that caused a few unrelated diffs.
@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Jul 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 18, 2025

@llvm/pr-subscribers-libc

Author: Jordan Rupprecht (rupprecht)

Changes

We already use cc rules from @<!-- -->rules_cc//cc:defs.bzl in a few files, but this uses it everywhere. Done automatically by running buildifier --lint=fix --warnings=native-cc-binary,native-cc-library,native-cc-test,load over all the files. I also ran buildifier once more to ensure there wasn't any missing formatting, so that caused a few unrelated diffs.


Patch is 31.06 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/149584.diff

36 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/bolt/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel (+1-1)
  • (modified) utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel (+1-1)
  • (modified) utils/bazel/llvm-project-overlay/clang/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+27-27)
  • (modified) utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl (+6-7)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl (+3-3)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel (-1)
  • (modified) utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/lld/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/lldb/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/llvm/BUILD.bazel (+5-2)
  • (modified) utils/bazel/llvm-project-overlay/llvm/driver.bzl (+2-1)
  • (modified) utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/build_defs.bzl (+5-3)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel (+2)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/linalggen.bzl (+3-1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/tblgen.bzl (+2-1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/third-party/siphash/BUILD.bazel (+6-4)
  • (modified) utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel (+2)
diff --git a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
index 97c25bcdece7b..167447db86f0f 100644
--- a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
@@ -3,6 +3,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
 load(":targets.bzl", "bolt_targets")
 
 package(
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
index 2ec99aaa2f374..4151e55a938d9 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -2,6 +2,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
index e34fbe55cb781..6f1f5b8d21556 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
 load("//llvm:lit_test.bzl", "lit_test", "package_path")
 
 package(
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
index c169529b91533..62bac7471c7b0 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
-load("@rules_cc//cc:defs.bzl", "cc_test")
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 
 package(
     default_visibility = ["//visibility:public"],
diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
index 3598944381900..e175b987daef1 100644
--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
@@ -2,6 +2,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
 load("@rules_python//python:defs.bzl", "py_binary")
 load(
     "//:vars.bzl",
diff --git a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
index 58bcf3abfbe5d..fc4df435d1047 100644
--- a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
@@ -2,6 +2,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
+
 package(
     default_visibility = ["//visibility:public"],
 )
diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
index bcf947a230144..f34d56dd39447 100644
--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
@@ -2,6 +2,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel
index 520bf2ab397a0..e3233a19da896 100644
--- a/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel
@@ -2,6 +2,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_test")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index f0b45a99aae40..5e0ecfc802935 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2002,9 +2002,9 @@ libc_support_library(
         ":__support_fputil_fma",
         ":__support_fputil_multiply_add",
         ":__support_fputil_nearest_integer",
-        ":__support_math_exp_utils",
-        ":__support_math_exp10f_utils",
         ":__support_macros_properties_cpu_features",
+        ":__support_math_exp10f_utils",
+        ":__support_math_exp_utils",
         ":common_constants",
     ],
 )
@@ -2072,8 +2072,8 @@ libc_support_library(
         ":__support_fputil_cast",
         ":__support_fputil_fp_bits",
         ":__support_fputil_nearest_integer",
-        ":__support_math_expf16_utils",
         ":__support_math_exp10_float16_constants",
+        ":__support_math_expf16_utils",
     ],
 )
 
@@ -2111,7 +2111,7 @@ libc_support_library(
         ":__support_fputil_nearest_integer",
         ":__support_fputil_polyeval",
         ":__support_macros_attributes",
-        ":llvm_libc_macros_float16_macros"
+        ":llvm_libc_macros_float16_macros",
     ],
 )
 
@@ -2120,7 +2120,6 @@ libc_support_library(
     hdrs = ["src/__support/math/expf16.h"],
     deps = [
         ":__support_common",
-        ":__support_libc_errno",
         ":__support_cpp_array",
         ":__support_fputil_cast",
         ":__support_fputil_except_value_utils",
@@ -2130,9 +2129,10 @@ libc_support_library(
         ":__support_fputil_nearest_integer",
         ":__support_fputil_polyeval",
         ":__support_fputil_rounding_mode",
+        ":__support_libc_errno",
         ":__support_macros_optimization",
         ":__support_math_expf16_utils",
-        ":llvm_libc_macros_float16_macros"
+        ":llvm_libc_macros_float16_macros",
     ],
 )
 
@@ -2140,8 +2140,8 @@ libc_support_library(
     name = "__support_math_frexpf128",
     hdrs = ["src/__support/math/frexpf128.h"],
     deps = [
-        ":__support_macros_properties_types",
         ":__support_fputil_manipulation_functions",
+        ":__support_macros_properties_types",
     ],
 )
 
@@ -2149,10 +2149,10 @@ libc_support_library(
     name = "__support_math_frexpf16",
     hdrs = ["src/__support/math/frexpf16.h"],
     deps = [
+        ":__support_fputil_manipulation_functions",
         ":__support_macros_config",
         ":__support_macros_properties_types",
-        ":__support_fputil_manipulation_functions",
-        ":llvm_libc_macros_float16_macros"
+        ":llvm_libc_macros_float16_macros",
     ],
 )
 
@@ -2170,7 +2170,7 @@ libc_support_library(
     deps = [
         ":__support_fputil_manipulation_functions",
         ":__support_macros_properties_types",
-        ":llvm_libc_types_float128"
+        ":llvm_libc_types_float128",
     ],
 )
 
@@ -2178,9 +2178,9 @@ libc_support_library(
     name = "__support_math_ldexpf16",
     hdrs = ["src/__support/math/ldexpf16.h"],
     deps = [
-        ":__support_macros_properties_types",
         ":__support_fputil_manipulation_functions",
-        ":llvm_libc_macros_float16_macros"
+        ":__support_macros_properties_types",
+        ":llvm_libc_macros_float16_macros",
     ],
 )
 
@@ -2204,8 +2204,8 @@ libc_support_library(
     name = "__support_math_exp_utils",
     hdrs = ["src/__support/math/exp_utils.h"],
     deps = [
-        ":__support_cpp_optional",
         ":__support_cpp_bit",
+        ":__support_cpp_optional",
         ":__support_fputil_fp_bits",
     ],
 )
@@ -2214,10 +2214,9 @@ libc_support_library(
     name = "__support_math_exp",
     hdrs = ["src/__support/math/exp.h"],
     deps = [
-        ":__support_math_exp_constants",
-        ":__support_math_exp_utils",
         ":__support_cpp_bit",
         ":__support_cpp_optional",
+        ":__support_fputil_double_double",
         ":__support_fputil_dyadic_float",
         ":__support_fputil_fenv_impl",
         ":__support_fputil_fp_bits",
@@ -2226,9 +2225,10 @@ libc_support_library(
         ":__support_fputil_polyeval",
         ":__support_fputil_rounding_mode",
         ":__support_fputil_triple_double",
-        ":__support_fputil_double_double",
         ":__support_integer_literals",
         ":__support_macros_optimization",
+        ":__support_math_exp_constants",
+        ":__support_math_exp_utils",
     ],
 )
 
@@ -2236,8 +2236,6 @@ libc_support_library(
     name = "__support_math_exp10",
     hdrs = ["src/__support/math/exp10.h"],
     deps = [
-        ":__support_math_exp_constants",
-        ":__support_math_exp_utils",
         ":__support_fputil_double_double",
         ":__support_fputil_dyadic_float",
         ":__support_fputil_multiply_add",
@@ -2247,6 +2245,8 @@ libc_support_library(
         ":__support_fputil_triple_double",
         ":__support_integer_literals",
         ":__support_macros_optimization",
+        ":__support_math_exp_constants",
+        ":__support_math_exp_utils",
     ],
 )
 
@@ -2254,12 +2254,12 @@ libc_support_library(
     name = "__support_math_exp10f_utils",
     hdrs = ["src/__support/math/exp10f_utils.h"],
     deps = [
+        ":__support_common",
         ":__support_fputil_basic_operations",
         ":__support_fputil_fenv_impl",
         ":__support_fputil_multiply_add",
         ":__support_fputil_nearest_integer",
         ":__support_fputil_polyeval",
-        ":__support_common",
         ":__support_math_exp_utils",
     ],
 )
@@ -2268,12 +2268,12 @@ libc_support_library(
     name = "__support_math_exp10f",
     hdrs = ["src/__support/math/exp10f.h"],
     deps = [
-        ":__support_math_exp10f_utils",
         ":__support_fputil_fenv_impl",
         ":__support_fputil_fp_bits",
         ":__support_fputil_multiply_add",
         ":__support_fputil_rounding_mode",
         ":__support_macros_optimization",
+        ":__support_math_exp10f_utils",
     ],
 )
 
@@ -2289,9 +2289,9 @@ libc_support_library(
     name = "__support_math_exp10f16_utils",
     hdrs = ["src/__support/math/exp10f16_utils.h"],
     deps = [
+        ":__support_fputil_fp_bits",
         ":__support_math_exp10_float16_constants",
         ":__support_math_expf16_utils",
-        ":__support_fputil_fp_bits",
     ],
 )
 
@@ -2299,13 +2299,13 @@ libc_support_library(
     name = "__support_math_exp10f16",
     hdrs = ["src/__support/math/exp10f16.h"],
     deps = [
-        ":__support_math_exp10f16_utils",
-        ":__support_fputil_fp_bits",
         ":__support_fputil_cast",
-        ":__support_fputil_rounding_mode",
         ":__support_fputil_except_value_utils",
+        ":__support_fputil_fp_bits",
+        ":__support_fputil_rounding_mode",
         ":__support_macros_optimization",
         ":__support_macros_properties_cpu_features",
+        ":__support_math_exp10f16_utils",
     ],
 )
 
@@ -3353,13 +3353,13 @@ libc_math_function(
     name = "frexpf128",
     additional_deps = [
         ":__support_math_frexpf128",
-    ]
+    ],
 )
 
 libc_math_function(
     name = "frexpf16",
     additional_deps = [
-        ":__support_math_frexpf16"
+        ":__support_math_frexpf16",
     ],
 )
 
@@ -3446,7 +3446,7 @@ libc_math_function(
     name = "ldexpf",
     additional_deps = [
         ":__support_math_ldexpf",
-    ]
+    ],
 )
 
 libc_math_function(name = "ldexpl")
diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
index e123e4d32b785..0f2965369c296 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -6,6 +6,7 @@
 
 load("@bazel_skylib//lib:paths.bzl", "paths")
 load("@bazel_skylib//lib:selects.bzl", "selects")
+load("@rules_cc//cc:defs.bzl", "cc_library")
 load(":libc_configure_options.bzl", "LIBC_CONFIGURE_OPTIONS")
 load(":libc_namespace.bzl", "LIBC_NAMESPACE")
 load(":platforms.bzl", "PLATFORM_CPU_X86_64")
@@ -52,7 +53,7 @@ def _libc_library(name, **kwargs):
     for attr in ["copts", "local_defines"]:
         if attr in kwargs:
             fail("disallowed attribute: '{}' in rule: '{}'".format(attr, name))
-    native.cc_library(
+    cc_library(
         name = name,
         copts = libc_common_copts(),
         local_defines = LIBC_CONFIGURE_OPTIONS,
@@ -188,7 +189,7 @@ def libc_release_library(
         name = name + "_textual_hdrs",
         libs = libc_functions,
     )
-    native.cc_library(
+    cc_library(
         name = name + "_textual_hdr_library",
         textual_hdrs = [":" + name + "_textual_hdrs"],
     )
@@ -197,8 +198,7 @@ def libc_release_library(
         "LLVM_LIBC_FUNCTION_ATTR_" + name + "='LLVM_LIBC_EMPTY, [[gnu::weak]]'"
         for name in weak_symbols
     ]
-
-    native.cc_library(
+    cc_library(
         name = name,
         srcs = [":" + name + "_srcs"],
         copts = libc_common_copts() + libc_release_copts(),
@@ -229,12 +229,11 @@ def libc_header_library(name, hdrs, deps = [], **kwargs):
         name = name + "_textual_hdrs",
         libs = deps,
     )
-    native.cc_library(
+    cc_library(
         name = name + "_textual_hdr_library",
         textual_hdrs = [":" + name + "_textual_hdrs"],
     )
-
-    native.cc_library(
+    cc_library(
         name = name,
         hdrs = hdrs,
         # We put _hdr_deps in srcs, as they are not a part of this cc_library
diff --git a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
index 41a706d2d92fb..25a12a6c31979 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
@@ -12,6 +12,7 @@ They come in two flavors:
 When performing tests we make sure to always use the internal version.
 """
 
+load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
 load("//libc:libc_build_rules.bzl", "libc_common_copts")
 load("//libc:libc_configure_options.bzl", "LIBC_CONFIGURE_OPTIONS")
 
@@ -57,8 +58,7 @@ def libc_test(
 
     if full_build:
         copts = copts + _FULL_BUILD_COPTS
-
-    native.cc_test(
+    cc_test(
         name = name,
         local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
         deps = deps,
@@ -76,7 +76,7 @@ def libc_test_library(name, copts = [], local_defines = [], **kwargs):
       local_defines: See cc_library.local_defines.
       **kwargs: Other attributes relevant to cc_library (e.g. "deps").
     """
-    native.cc_library(
+    cc_library(
         name = name,
         testonly = True,
         copts = copts + libc_common_copts(),
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel
index b6d6b8f778a4a..dbe069f6e60f3 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel
@@ -83,7 +83,6 @@ libc_test(
     ],
 )
 
-
 libc_test(
     name = "wcslcat_test",
     srcs = ["wcslcat_test.cpp"],
diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
index 0fc6aa4e10616..cb42f9b1ac684 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
@@ -4,6 +4,7 @@
 
 # A wrapper library over MPC for use with LLVM libc math unittests.
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
 load("//libc/test:libc_test_rules.bzl", "libc_test_library")
 
 package(default_visibility = ["//visibility:public"])
diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
index 6fd88211a4ba3..7a547308cda01 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
@@ -4,6 +4,7 @@
 
 # A wrapper library over MPFR for use with LLVM libc math unittests.
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
 load("//libc/test:libc_test_rules.bzl", "libc_test_library")
 
 package(default_visibility = ["//visibility:public"])
diff --git a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel
index f8448fb0e7268..c9fdc819c04e5 100644
--- a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel
@@ -2,6 +2,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
 )
diff --git a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
index 76957a95a544a..162c4f955d150 100644
--- a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
@@ -2,6 +2,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("@rules_cc//cc:defs.bzl", "cc_library")
 load(
     "//:vars.bzl",
     "LLVM_VERSION",
diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index 202f224b07982..7aa7be6dbc5c6 100644
--- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
@@ -6,6 +6,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects")
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
 load("@build_bazel_apple_support//rules:apple_genrule.bzl", "apple_genrule")
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
 load("@rules_python//python:defs.bzl", "py_binary")
 load("//:vars.bzl", "LLVM_VERSION_MAJOR", "LLVM_VERSION_MINOR", "LLVM_VERSION_PATCH", "LLVM_VERSION_SUFFIX", "PACKAGE_VERSION")
 load("//lldb/source/Plugins:plugin_config.bzl", "DEFAULT_PLUGINS", "DEFAULT_SCRIPT_PLUGINS", "OBJCPP_COPTS")
diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
index caf609fd172ea..1db8244036888 100644
--- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
@@ -2,6 +2,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("@rules_cc//cc:defs.bzl", "cc_library")
 load("//mlir:tblgen.bzl", "gentbl_cc_library")
 load(":plugin_config.bzl", "DEFAULT_PLUGINS", "DEFAULT_SCRIPT_PLUGINS", "OBJCPP_COPTS")
 
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index 37e79db376b40..d4ae58e8732ac 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -4,6 +4,7 @@
 
 load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
 load("@rules_python//python:defs.bzl", "py_binary")
 load("//mlir:tblgen.bzl", "gentbl_cc_lib...
[truncated]

Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants