[llvm] [bazel] Improve liblldb building (PR #89095)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 09:08:52 PDT 2024
https://github.com/keith created https://github.com/llvm/llvm-project/pull/89095
On Linux using --version-script doesn't force loading of the underlying archives that contain the symbols. By setting alwayslink=True on the API cc_library we virtually get this behavior. This also allows downstream users to use the exports files used by cmake. We could build more configurability into this but there are also a lot of possible variations users might want.
>From 72326c24da3545380679a5faf6cf4e7f1cce71d3 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Wed, 17 Apr 2024 16:07:15 +0000
Subject: [PATCH] [bazel] Improve liblldb building
On Linux using --version-script doesn't force loading of the underlying
archives that contain the symbols. By setting alwayslink=True on the API
cc_library we virtually get this behavior. This also allows downstream
users to use the exports files used by cmake. We could build more
configurability into this but there are also a lot of possible
variations users might want.
---
utils/bazel/llvm-project-overlay/lldb/BUILD.bazel | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index 1f2b5b476bcc11..91daa1a583b301 100644
--- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
@@ -16,7 +16,11 @@ package(
licenses(["notice"])
-exports_files(["LICENSE.TXT"])
+exports_files([
+ "LICENSE.TXT",
+ "source/API/liblldb-private.exports",
+ "source/API/liblldb.exports",
+])
bool_flag(
name = "enable_curses",
@@ -210,6 +214,7 @@ cc_library(
"//llvm:Support",
"//llvm:config",
],
+ alwayslink = True,
)
cc_library(
More information about the llvm-commits
mailing list