aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2024-04-17 17:03:39 -0400
committerGitHub <noreply@github.com>2024-04-17 17:03:39 -0400
commit1b87418b9960983f54aa67f87018466ae12d0ec6 (patch)
tree9dffb96ac66bdecc13069a005a5b5c3be200d87d /utils
parent9435edf628cb2011652897e1f10f7c55313d50be (diff)
downloadllvm-1b87418b9960983f54aa67f87018466ae12d0ec6.zip
llvm-1b87418b9960983f54aa67f87018466ae12d0ec6.tar.gz
llvm-1b87418b9960983f54aa67f87018466ae12d0ec6.tar.bz2
[bazel] Improve liblldb building (#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.
Diffstat (limited to 'utils')
-rw-r--r--utils/bazel/llvm-project-overlay/lldb/BUILD.bazel42
-rw-r--r--utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel20
2 files changed, 26 insertions, 36 deletions
diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index 1f2b5b4..7958c60 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",
@@ -203,13 +207,29 @@ 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,
)
cc_library(
@@ -690,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(
@@ -889,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 b5f5bed..e0907a8 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",