[clang] [clang-cl] Sanitize command line in COFF CV debug info for the deterministic builds. (PR #205736)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 26 19:47:45 PDT 2026
================
@@ -122,6 +122,9 @@ DEBUGOPT(CodeViewGHash, 1, 0, Compatible)
/// Whether to emit the compiler path and command line into the CodeView debug information.
DEBUGOPT(CodeViewCommandLine, 1, 0, Compatible)
+/// Wheither to remove non-deterministic build options from the CodeView debug information.
----------------
rnk wrote:
I'd push back on describing these flags as non-deterministic. Their determinism is a function of deterministic the build system is, or whether the absolute path to the working directory is included. To determinize my builds and make them insensitive to the working directory path, I typically pass /proc/self/cwd on Linux to the compiler as a workaround when the compiler wants an absolute path, which is somewhat of a hack. I'm not aware of a good way to do this for debug info.
Perhaps the modern way of doing this is with explicit path remapping files, but those files and flags themselves will include the absolute path of the working directory, which I guess explains what we're really trying to do here.
https://github.com/llvm/llvm-project/pull/205736
More information about the cfe-commits
mailing list