[llvm] [bazel] Fix building lldb with zlib disabled (PR #184525)

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 16:59:41 PST 2026


https://github.com/keith created https://github.com/llvm/llvm-project/pull/184525

In cmake this value is set in llvm-config.h, we're not really handling
that the same way in bazel so we can just allow all targets to inherit
this disabled, otherwise it fails since lldb assumes it is always
something


>From d0802eaccf9435f5c8505651fce89ffa683b2c53 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Tue, 3 Mar 2026 16:57:24 -0800
Subject: [PATCH] [bazel] Fix building lldb with zlib disabled

In cmake this value is set in llvm-config.h, we're not really handling
that the same way in bazel so we can just allow all targets to inherit
this disabled, otherwise it fails since lldb assumes it is always
something
---
 utils/bazel/llvm-project-overlay/third-party/BUILD.bazel | 4 +++-
 utils/bazel/third_party_build/zlib-ng.BUILD              | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/third-party/BUILD.bazel b/utils/bazel/llvm-project-overlay/third-party/BUILD.bazel
index b781d41baf86b..9b7b22a7c4204 100644
--- a/utils/bazel/llvm-project-overlay/third-party/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/third-party/BUILD.bazel
@@ -49,7 +49,9 @@ cc_library_wrapper(
         ":llvm_zlib_enabled": [
             "LLVM_ENABLE_ZLIB=1",
         ],
-        "//conditions:default": [],
+        "//conditions:default": [
+            "LLVM_ENABLE_ZLIB=0",
+        ],
     }),
     deps = select({
         ":llvm_zlib_enabled": [
diff --git a/utils/bazel/third_party_build/zlib-ng.BUILD b/utils/bazel/third_party_build/zlib-ng.BUILD
index 916afe0b34d54..d23fd94f9bd29 100644
--- a/utils/bazel/third_party_build/zlib-ng.BUILD
+++ b/utils/bazel/third_party_build/zlib-ng.BUILD
@@ -89,7 +89,9 @@ cc_library(
         "@llvm-project//third-party:llvm_zlib_enabled": [
             "LLVM_ENABLE_ZLIB=1",
         ],
-        "//conditions:default": [],
+        "//conditions:default": [
+            "LLVM_ENABLE_ZLIB=0",
+        ],
     }),
     # Clang includes zlib with angled instead of quoted includes, so we need
     # strip_include_prefix here.



More information about the llvm-commits mailing list