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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 04:17:25 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 135434 tests passed
* 3364 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGen/asan-sanitize-compilation-dir.c</summary>

```
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
mkdir -p C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub
# executed command: mkdir -p 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub'
# note: command had no output on stdout or stderr
# RUN: at line 5
cp C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c
# executed command: cp 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c'
# note: command had no output on stdout or stderr
# RUN: at line 6
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-DEFAULT C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-DEFAULT 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c'
# note: command had no output on stdout or stderr
# RUN: at line 7
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address -fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/ C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address '-fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c'
# note: command had no output on stdout or stderr
# RUN: at line 8
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address -fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address '-fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c'
# note: command had no output on stdout or stderr
# RUN: at line 9
cd C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir && c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address -fsanitize-compilation-dir=. C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c
# executed command: cd 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address -fsanitize-compilation-dir=. 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c' -o -
# .---command stderr------------
# | fatal error: error in backend: IO sandbox violation
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\clang.exe -cc1 -internal-isystem C:\\_work\\llvm-project\\llvm-project\\build\\lib\\clang\\23\\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=address -fsanitize-compilation-dir=. C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\test\\CodeGen\\Output\\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c -o -
# | 1.	<eof> parser at end of file
# | 2.	Optimizer
# | 3.	Running pass "asan<>" on module "C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\asan-sanitize-compilation-dir.c.tmp.dir/sub/test.c"
# `-----------------------------
# error: command failed with exit status: 70
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\asan-sanitize-compilation-dir.c
# `-----------------------------
# error: command failed with exit status: 2

--

```
</details>
<details>
<summary>Clang.CodeGen/ubsan-sanitize-compilation-dir.cpp</summary>

```
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 9
mkdir -p C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub
# executed command: mkdir -p 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub'
# note: command had no output on stdout or stderr
# RUN: at line 10
cp C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c
# executed command: cp 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c'
# note: command had no output on stdout or stderr
# RUN: at line 11
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-DEFAULT C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-DEFAULT 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 12
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/ C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable '-fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 13
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable '-fsanitize-compilation-dir=C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp'
# note: command had no output on stdout or stderr
# RUN: at line 14
cd C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir && c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -fsanitize-compilation-dir=. C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp
# executed command: cd 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -fsanitize-compilation-dir=. 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c' -o -
# .---command stderr------------
# | fatal error: error in backend: IO sandbox violation
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\clang.exe -cc1 -internal-isystem C:\\_work\\llvm-project\\llvm-project\\build\\lib\\clang\\23\\include -nostdsysteminc -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -fsanitize-compilation-dir=. C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\test\\CodeGen\\Output\\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c -o -
# | 1.	<eof> parser at end of file
# | 2.	C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c:25:6: LLVM IR generation of declaration 'f'
# | 3.	C:\_work\llvm-project\llvm-project\build\tools\clang\test\CodeGen\Output\ubsan-sanitize-compilation-dir.cpp.tmp.dir/sub/test.c:25:6: Generating code for declaration 'f'
# `-----------------------------
# error: command failed with exit status: 70
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' -check-prefix=CHECK-STRIPPED 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -check-prefix=CHECK-STRIPPED C:\_work\llvm-project\llvm-project\clang\test\CodeGen\ubsan-sanitize-compilation-dir.cpp
# `-----------------------------
# error: command failed with exit status: 2

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list