[compiler-rt] [compiler-rt][asan] Include intrin.h for MinGW GCC (PR #222709)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 09:50:37 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: oltolm (oltolm)

<details>
<summary>Changes</summary>

asan_globals_win.cpp calls __debugbreak in the runtime thunk configurations. Include MinGW's intrinsic header so the function is declared when this file is compiled with GCC.

---
Full diff: https://github.com/llvm/llvm-project/pull/222709.diff


1 Files Affected:

- (modified) compiler-rt/lib/asan/asan_globals_win.cpp (+4) 


``````````diff
diff --git a/compiler-rt/lib/asan/asan_globals_win.cpp b/compiler-rt/lib/asan/asan_globals_win.cpp
index aeef42749fa8c..156bfe10d36db 100644
--- a/compiler-rt/lib/asan/asan_globals_win.cpp
+++ b/compiler-rt/lib/asan/asan_globals_win.cpp
@@ -14,6 +14,10 @@
 #if SANITIZER_WINDOWS
 #  include "sanitizer_common/sanitizer_win_defs.h"
 
+#  if defined(__GNUC__) && !defined(__clang__)
+#    include <intrin.h>
+#  endif
+
 namespace __asan {
 
 #  pragma section(".ASAN$GA", read, write)

``````````

</details>


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


More information about the llvm-commits mailing list