Open curu opened 1 month ago
I could work on this if maintainers assign?
@llvm/issue-subscribers-lldb
Author: Curu Wong (curu)
@curu I'm pretty much done but what must the install dedstination of the config package be?
@curu I'm pretty much done but what must the install dedstination of the config package be?
maybe under CMAKE_INSTALL_PREFIX ? eg, if CMAKE_INSTALL_PREFIX is /usr/local
, then the config pkg should be under /usr/local/lib/cmake/lldb/LLDBConfig.cmake
it would be better if you add an option to enable/disable static library build of LLDB.
In fact, I tried to do a static build of bpftrace, which requires LLDB, if there's a LLDB config pkg, then a simple find_package(LLDB)
would populate the required library link option for lldb, then
target_link_libraries(runtime LLDB)
would get the correct link flag from lldb cmake pkg.
if we got just a partial liblldb.a(missing other symbol it links to like what in libCore.a), then compilation would fail.
@curu I'm pretty much done but what must the install dedstination of the config package be?
maybe under CMAKE_INSTALL_PREFIX ? eg, if CMAKE_INSTALL_PREFIX is
/usr/local
, then the config pkg should be under/usr/local/lib/cmake/lldb/LLDBConfig.cmake
it would be better if you add an option to enable/disable static library build of LLDB.
In fact, I tried to do a static build of bpftrace, which requires LLDB, if there's a LLDB config pkg, then a simple
find_package(LLDB)
would populate the required library link option for lldb, thentarget_link_libraries(runtime LLDB)
would get the correct link flag from lldb cmake pkg.
if we got just a partial liblldb.a(missing other symbol it links to like what in libCore.a), then compilation would fail.
Sure I'll put a PR and you can let me know if you meant something else.
So long as people aren't led to assume that anything outside the lldb: namespace is a stable API, this is fine. I wouldn't want to appear to be making false promises, and we have no intention of supporting the lldb_private API's as stable API's.
@curu Can you give some more context behind your request? I assume you want to statically link liblldb into another program?
@curu Can you give some more context behind your request? I assume you want to statically link liblldb into another program?
it's bpftrace that requires lldb, and I want to build a static version of bpftrace. you may check this at https://github.com/bpftrace/bpftrace/blob/master/CMakeLists.txt
@curu Can you give some more context behind your request? I assume you want to statically link liblldb into another program?
it's bpftrace that requires lldb, and I want to build a static version of bpftrace. you may check this at https://github.com/bpftrace/bpftrace/blob/master/CMakeLists.txt
bpftrace calls find_package(lldb)
, but we don't currently produce a CMake package like LLVM and Clang do. How does this work today? Do they create their own package? LLDB vending a package would certainly make this easier, but I'd like to know what they're doing now to better inform a solution. I'd prefer not to break them downstream (unless it makes sense to from our perspective).
cc @ajor @danobi
bpftrace calls
find_package(lldb)
, but we don't currently produce a CMake package like LLVM and Clang do. How does this work today?
bpftrace uses this FindLLDB.cmake
file which just looks for LLDB libraries and headers in the standard locations: https://github.com/bpftrace/bpftrace/blob/master/cmake/FindLLDB.cmake
We'd definitely appreciate a static liblldb as we do support building bpftrace as a statically linked executable. LLDB is treated as an optional dependency, so right now, without a static liblldb, static bpftrace is missing DWARF support.
bpftrace uses this
FindLLDB.cmake
file which just looks for LLDB libraries and headers in the standard locations: https://github.com/bpftrace/bpftrace/blob/master/cmake/FindLLDB.cmake
and it would be better if the static version of liblldb and its dependency contain only necessary public symbol to reduce the final static binary object size.
can anyone please add output static library option for lldb build? it's hard coded to be
shared
inlldb/source/API/CMakeLists.txt
:and it would be better to generate a lldb cmake package file so that other tool which requires lldb can work smoothly. that is, when install , create a file like
<PREFIX>lib/cmake/clang/LLDBConfig.cmake