[llvm] bazel build: pass __support_macros_config dep explicitly (NFCI) (PR #98999)
Krasimir Georgiev via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 01:08:00 PDT 2024
https://github.com/krasimirgg created https://github.com/llvm/llvm-project/pull/98999
Passing it explicitly makes it that it's not made available to targets that don't need it (also we've got some internal integration that trips on it being passed implicitly in the rule definition).
>From d53c1378da2043ec2bf3b18ad7f292fcf7f550d6 Mon Sep 17 00:00:00 2001
From: Krasimir Georgiev <krasimir at google.com>
Date: Tue, 16 Jul 2024 08:04:18 +0000
Subject: [PATCH] bazel build: pass __support_macros_config dep explicitly
(NFCI)
---
.../llvm-project-overlay/libc/BUILD.bazel | 23 ++++++++++++++++---
.../libc/libc_build_rules.bzl | 2 +-
.../libc/test/UnitTest/BUILD.bazel | 10 ++++++--
.../libc/test/src/math/BUILD.bazel | 7 ++++--
.../libc/test/src/string/BUILD.bazel | 1 +
.../libc/utils/MPFRWrapper/BUILD.bazel | 1 +
6 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 919eea6175707..5d47f4a9cd640 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -254,6 +254,7 @@ libc_support_library(
hdrs = ["src/__support/macros/optimization.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
":__support_macros_properties_compiler",
],
)
@@ -261,6 +262,9 @@ libc_support_library(
libc_support_library(
name = "__support_macros_sanitizer",
hdrs = ["src/__support/macros/sanitizer.h"],
+ deps = [
+ ":__support_macros_config",
+ ],
)
libc_support_library(
@@ -271,6 +275,7 @@ libc_support_library(
],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
":__support_macros_properties_architectures",
],
)
@@ -280,6 +285,7 @@ libc_support_library(
hdrs = ["src/__support/CPP/algorithm.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
],
)
@@ -317,6 +323,7 @@ libc_support_library(
hdrs = ["src/__support/CPP/bitset.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
],
)
@@ -334,6 +341,7 @@ libc_support_library(
hdrs = ["src/__support/CPP/expected.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
],
)
@@ -424,6 +432,7 @@ libc_support_library(
],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
":__support_macros_properties_types",
":llvm_libc_macros_stdfix_macros",
],
@@ -573,7 +582,10 @@ libc_support_library(
libc_support_library(
name = "__support_str_to_num_result",
hdrs = ["src/__support/str_to_num_result.h"],
- deps = [":__support_macros_attributes"],
+ deps = [
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ],
)
libc_support_library(
@@ -612,7 +624,10 @@ libc_support_library(
libc_support_library(
name = "__support_ctype_utils",
hdrs = ["src/__support/ctype_utils.h"],
- deps = [":__support_macros_attributes"],
+ deps = [
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ],
)
libc_support_library(
@@ -785,6 +800,7 @@ libc_support_library(
hdrs = ["src/__support/FPUtil/rounding_mode.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
":hdr_fenv_macros",
],
)
@@ -1126,6 +1142,7 @@ libc_support_library(
hdrs = ["src/__support/threads/sleep.h"],
deps = [
":__support_macros_attributes",
+ ":__support_macros_config",
],
)
@@ -3408,9 +3425,9 @@ libc_support_library(
":__support_arg_list",
":__support_file_file",
":__support_macros_attributes",
- ":types_FILE",
":printf_main",
":printf_writer",
+ ":types_FILE",
],
)
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 cc732effb243e..ec3714407cb91 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -43,7 +43,7 @@ def _libc_library(name, hidden, copts = [], deps = [], local_defines = [], **kwa
name = name,
copts = copts + libc_common_copts(),
local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
- deps = deps + ["//libc:__support_macros_config"],
+ deps = deps,
linkstatic = 1,
**kwargs
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
index 6126a4a8fca83..3e130cd9dc6f0 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
@@ -18,6 +18,7 @@ libc_support_library(
"//libc:__support_big_int",
"//libc:__support_cpp_string",
"//libc:__support_cpp_string_view",
+ "//libc:__support_macros_config",
"//libc:__support_macros_properties_types",
"//libc:__support_osutil_io",
"//libc:__support_uint128",
@@ -52,6 +53,7 @@ libc_support_library(
"//libc:__support_fputil_fp_bits",
"//libc:__support_fputil_fpbits_str",
"//libc:__support_fputil_rounding_mode",
+ "//libc:__support_macros_config",
"//libc:__support_macros_properties_architectures",
"//libc:__support_macros_properties_types",
"//libc:__support_stringutil",
@@ -89,10 +91,11 @@ libc_support_library(
"//libc:__support_fputil_fp_bits",
"//libc:__support_fputil_fpbits_str",
"//libc:__support_fputil_rounding_mode",
+ "//libc:__support_macros_config",
"//libc:__support_macros_properties_architectures",
+ "//libc:hdr_fenv_macros",
"//libc:hdr_math_macros",
- "//libc:hdr_fenv_macros",
- "//libc:types_fenv_t",
+ "//libc:types_fenv_t",
],
)
@@ -110,6 +113,7 @@ libc_support_library(
"//libc:__support_cpp_bitset",
"//libc:__support_cpp_span",
"//libc:__support_cpp_type_traits",
+ "//libc:__support_macros_config",
],
)
@@ -125,6 +129,7 @@ libc_support_library(
":LibcUnitTest",
":string_utils",
"//libc:__support_fputil_fp_bits",
+ "//libc:__support_macros_config",
"//libc:printf_core_structs",
],
)
@@ -138,5 +143,6 @@ libc_support_library(
"//libc:__support_big_int",
"//libc:__support_cpp_string",
"//libc:__support_cpp_type_traits",
+ "//libc:__support_macros_config",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index 2940326d5bfc3..57e3f9f6e9458 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -298,8 +298,8 @@ libc_support_library(
"//libc:__support_fputil_fp_bits",
"//libc:__support_fputil_manipulation_functions",
"//libc:hdr_math_macros",
- "//libc/test/UnitTest:fp_test_helpers",
"//libc/test/UnitTest:LibcUnitTest",
+ "//libc/test/UnitTest:fp_test_helpers",
],
)
@@ -559,7 +559,10 @@ math_test(
libc_support_library(
name = "sdcomp26094",
hdrs = ["sdcomp26094.h"],
- deps = ["//libc:__support_cpp_array"],
+ deps = [
+ "//libc:__support_cpp_array",
+ "//libc:__support_macros_config",
+ ],
)
math_test(
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
index fb0046e9f89d1..b11bf163473be 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
@@ -121,6 +121,7 @@ libc_support_library(
deps = [
"//libc:__support_cpp_span",
"//libc:__support_libc_assert",
+ "//libc:__support_macros_config",
"//libc:__support_macros_sanitizer",
"//libc:string_memory_utils",
],
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 c708f008dec2c..adf4b235b1b5e 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
@@ -48,6 +48,7 @@ libc_support_library(
"//libc:__support_cpp_type_traits",
"//libc:__support_fputil_fp_bits",
"//libc:__support_fputil_fpbits_str",
+ "//libc:__support_macros_config",
"//libc:__support_macros_properties_types",
"//libc:hdr_math_macros",
"//libc/test/UnitTest:LibcUnitTest",
More information about the llvm-commits
mailing list