Skip to content

Commit 13875dc

Browse files
authored
[bazel] Add -lbsd for lldb on Linux (#156954)
In the case you link libedit statically with a vendored sysroot, this flag is also required. It should be harmless in the case you link it dynamically since libedit already links libbsd otherwise.
1 parent a752ff0 commit 13875dc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

utils/bazel/llvm-project-overlay/lldb/BUILD.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ selects.config_setting_group(
6262
],
6363
)
6464

65+
selects.config_setting_group(
66+
name = "needs_libbsd",
67+
match_all = [
68+
":libedit_enabled_setting",
69+
"@platforms//os:linux",
70+
],
71+
)
72+
6573
_VERSION_SUBSTITUTIONS = {
6674
"@LLDB_VERSION@": PACKAGE_VERSION,
6775
"@LLDB_VERSION_MAJOR@": LLVM_VERSION_MAJOR,
@@ -562,6 +570,11 @@ cc_library(
562570
"-ledit",
563571
],
564572
"//conditions:default": [],
573+
}) + select({
574+
":needs_libbsd": [
575+
"-lbsd",
576+
],
577+
"//conditions:default": [],
565578
}),
566579
deps = [
567580
":Headers",

0 commit comments

Comments
 (0)