[llvm] [bazel] Improve liblldb building (PR #89095)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 10:12:29 PDT 2024
https://github.com/keith updated https://github.com/llvm/llvm-project/pull/89095
>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 1/2] [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(
>From 65daa6db5b8d11beee10c70739c4ba462ffa9ffd Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Wed, 17 Apr 2024 17:12:02 +0000
Subject: [PATCH 2/2] move around deps
---
.../llvm-project-overlay/lldb/BUILD.bazel | 35 ++++++++++---------
.../lldb/source/Plugins/BUILD.bazel | 20 ++---------
2 files changed, 20 insertions(+), 35 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index 91daa1a583b301..7958c6024875a5 100644
--- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
@@ -207,13 +207,28 @@ cc_library(
":TargetHeaders",
":Utility",
":Version",
+ "//lldb/source/Plugins:PluginExpressionParserClang",
"//lldb/source/Plugins:PluginExpressionParserClangHeaders",
"//lldb/source/Plugins:PluginsConfig",
+ "//llvm:AllTargetsDisassemblers",
"//llvm:ExecutionEngine",
"//llvm:MCJIT",
"//llvm:Support",
"//llvm:config",
- ],
+ ] + [
+ "//lldb/source/Plugins:Plugin{}".format(x)
+ for x in DEFAULT_PLUGINS + DEFAULT_SCRIPT_PLUGINS
+ ] + select({
+ "@platforms//os:macos": [
+ "//lldb/source/Plugins:PluginProcessMacOSXKernel",
+ "//lldb/source/Plugins:PluginSymbolLocatorDebugSymbols",
+ "//lldb/source/Plugins:PluginSymbolVendorMacOSX",
+ ],
+ "@platforms//os:linux": [
+ "//lldb/source/Plugins:PluginProcessLinux",
+ ],
+ "//conditions:default": [],
+ }),
alwayslink = True,
)
@@ -695,23 +710,8 @@ cc_library(
name = "liblldb.static",
deps = [
":API",
- ":Host",
":Interpreter",
- "//llvm:AllTargetsDisassemblers",
- ] + [
- "//lldb/source/Plugins:Plugin{}".format(x)
- for x in DEFAULT_PLUGINS + DEFAULT_SCRIPT_PLUGINS
- ] + select({
- "@platforms//os:macos": [
- "//lldb/source/Plugins:PluginProcessMacOSXKernel",
- "//lldb/source/Plugins:PluginSymbolLocatorDebugSymbols",
- "//lldb/source/Plugins:PluginSymbolVendorMacOSX",
- ],
- "@platforms//os:linux": [
- "//lldb/source/Plugins:PluginProcessLinux",
- ],
- "//conditions:default": [],
- }),
+ ],
)
cc_shared_library(
@@ -894,6 +894,7 @@ cc_binary(
deps = [
":Host",
":Initialization",
+ ":Interpreter",
":Utility",
":Version",
":lldb_server_opts_gen",
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 b5f5bed1698a6b..e0907a838148f5 100644
--- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
@@ -557,7 +557,6 @@ cc_library(
"//lldb:Breakpoint",
"//lldb:Core",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Target",
"//lldb:TargetHeaders",
@@ -591,7 +590,6 @@ cc_library(
"//lldb:Core",
"//lldb:Expression",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Target",
"//lldb:TargetHeaders",
@@ -664,7 +662,7 @@ cc_library(
"//lldb:Breakpoint",
"//lldb:Core",
"//lldb:Host",
- "//lldb:Interpreter",
+ "//lldb:InterpreterHeaders",
"//lldb:SymbolHeaders",
"//lldb:Target",
"//lldb:TargetHeaders",
@@ -1264,7 +1262,6 @@ cc_library(
"//lldb:Breakpoint",
"//lldb:Core",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1422,7 +1419,6 @@ cc_library(
deps = [
":PluginProcessUtility",
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1438,7 +1434,6 @@ cc_library(
deps = [
":PluginProcessUtility",
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1475,7 +1470,6 @@ cc_library(
":PluginProcessUtility",
"//lldb:Core",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1495,7 +1489,6 @@ cc_library(
":PluginProcessUtility",
"//lldb:Core",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1515,7 +1508,6 @@ cc_library(
deps = [
":PluginProcessUtility",
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1532,7 +1524,6 @@ cc_library(
deps = [
":PluginProcessUtility",
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1570,7 +1561,6 @@ cc_library(
"//lldb:Expression",
"//lldb:Headers",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1608,7 +1598,7 @@ cc_library(
"//lldb:Core",
"//lldb:Expression",
"//lldb:Headers",
- "//lldb:Interpreter",
+ "//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
"//lldb:Target",
@@ -1629,7 +1619,6 @@ cc_library(
"//lldb:Expression",
"//lldb:Headers",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1682,7 +1671,6 @@ cc_library(
":PluginObjectFileMachO",
"//lldb:Breakpoint",
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -1838,7 +1826,6 @@ cc_library(
include_prefix = "Plugins",
deps = [
"//lldb:Core",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Utility",
"//llvm:Support",
@@ -2215,7 +2202,6 @@ cc_library(
"//lldb:Core",
"//lldb:Headers",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -2262,7 +2248,6 @@ cc_library(
"//lldb:DataFormattersHeaders",
"//lldb:ExpressionHeaders",
"//lldb:Headers",
- "//lldb:Interpreter",
"//lldb:InterpreterHeaders",
"//lldb:Symbol",
"//lldb:SymbolHeaders",
@@ -2287,7 +2272,6 @@ cc_library(
"//lldb:Expression",
"//lldb:Headers",
"//lldb:Host",
- "//lldb:Interpreter",
"//lldb:Symbol",
"//lldb:Target",
"//lldb:TargetHeaders",
More information about the llvm-commits
mailing list