[Lldb-commits] [lldb] [lldb][rpc] Fix build failures when building lldb-rpc-gen (PR #151603)
Chelsea Cassanova via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 1 14:01:49 PDT 2025
chelcassanova wrote:
> Your initial attempts seem quite close to actually getting this right (already attempting to use get_host_tool_path etc), but both the initial attempt and this one missed one subtle detail: The cmake functions get_host_tool_path and setup_host_tool do take a cmake variable name LLDB_RPC_GEN_EXE as input, which allows the user to set this variable if they want to point to the tool, but it doesn't set the final path in that variable, but in a different variable.
Ah, so if I'm understanding correctly I'm still using LLDB_RPC_GEN_EXE as the variable for the tool path even though `setup_host_tool` is setting this up to be `lldb_rpc_gen_exe`.
> But it's very unclear to me exactly how this is meant to work - the condition seems to miss a negation with regards to CMAKE_CROSS_COMPILING? (And the check for LLVM_HOST_TRIPLE and LLVM_DEFAULT_TARGET_TRIPLE seems unusual here - we don't normally check LLVM_DEFAULT_TARGET_TRIPLE like that - just checking CMAKE_CROSSCOMPILING should be enough.)
The original logic for cross compile builds was implemented to prevent an issue where the files generated from the rpc-gen tool were processed too early, before the Clang toolchain itself was also built: https://github.com/llvm/llvm-project/pull/148996#issuecomment-3091328752, which would cause errors of missing includes of files like cstddef.
> So we can probably do something like my inline diff above, to make the build succeed if we want to build this, but we probably should default to having this disabled in general:
Thank you very very much for the help, cross compile builds are configurations I haven't adjusted to working with yet so this is fairly new for me.
Also, for the universal binary issue, technically building for a universal binary is doing a cross compile build. To avoid the issue of there being 2 compile jobs when clang tooling expects 1, we could possibly modify the build such that in a universal build we only process the input header files for the host architecture.
https://github.com/llvm/llvm-project/pull/151603
More information about the lldb-commits
mailing list