[clang] [clang] Add -fno-debug-record-sysroot (PR #192541)
Adrian Prantl via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 17 08:30:45 PDT 2026
adrian-prantl wrote:
I (think I) understand the problem you want solve, but I don't think this is a good solution because it breaks LLDB's ability to detect what SDK type the object file was built with. On Darwin-derived operating systems LLDB really only consumes the name of the SDK directory, because it will want to look up a compatible sysroot relative to where LLDB is running (as opposed to where the object file was built). I would propose that for the sysroot in the compile unit we either
- only store the `.sdk` directory name
- introduce a new `DW_AT_APPLE_sdk` attribute for this purpose
For the sysroot/include_dir in `DW_TAG_module`, the former should be redundant with the sysroot of the compile unit, but LLDB needs at least the latter to attempt to import the Clang module from source. The key to making that reproducible should IMHO be a prefix remapping.
I need to double-check what we practically pass as sysroot on Windows and Linux (is it always `/` or always the install prefix of the toolchain)? In both cases the information contained in it seems to not carry too much weight, assuming LLDB is part of the same toolchain.
https://github.com/llvm/llvm-project/pull/192541
More information about the cfe-commits
mailing list