[clang] [llvm] [Clang] Add `-fsanitize-compilation-dir=` for reproducible sanitizer builds (PR #201803)

Björn Svensson via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 05:49:42 PDT 2026


================
@@ -408,6 +413,30 @@ run-time performance, which leads to increased binary size. Using the
 flag forces all code instrumentation to be outlined, which reduces the size
 of the generated code, but also reduces the run-time performance.
 
+Remapping source paths
+----------------------
+
+AddressSanitizer embeds the source file path in global metadata. For
+reproducible builds, the option ``-fsanitize-compilation-dir=<dir>`` can be
----------------
bjosv wrote:

Are you suggesting we drop `-fsanitize-compilation-dir=` entirely and only support this through `-ffile-compilation-dir=`? I added the granular flag for consistency with `-fdebug-compilation-dir=` and `-fcoverage-compilation-dir=`, but maybe these extra flags are not needed?

https://github.com/llvm/llvm-project/pull/201803


More information about the cfe-commits mailing list