Description
I'm trying to reduce the size of lldb-server binary.
The size of lldb-server binary for Aarch64 (release) is about 42MB.
I have analyzed the code and found a lot of x86, PDB, MIPS and Darwin related code.
Many "lldb plug-ins" are not plug-ins, but libraries used by other plug-ins.
See ac1ea0d
-
It is necessary to review and isolate plug-ins more accurately.
llvm-project/lldb/tools/lldb-server/SystemInitializerLLGS.cpp includes only necessary plug-ins, but it is not enough.
For example, llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp uses PDB code in
PDBASTParser *TypeSystemClang::GetPDBParser()
andnpdb::PdbAstBuilder *TypeSystemClang::GetNativePDBParser()
.
That's why Aarch64 lldb-server binary contains unwanted x86 and PDB code.
I'm trying to figure out how to disable some plug-ins (with loss of some functionality) to reduce the size of lldb-server binary. But they have a lot of cross-dependencies.
PlatformPOSIX::DoLoadImage() uses TypeSystemClang directly, etc. -
A lot of unwanted code is used directly in the base LLVM code and cannot be disabled in lldb.
For examplems_demangler
is used in llvm-project/llvm/lib/Demangle/Demangle.cpp
Currently I have no solution how to remove such unwanted code except by using local patches.
Any thoughts are welcome.