[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt][fuzzer] SetThreadName build fix for Mingw… (PR #106908)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Sep 1 06:12:18 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: David CARLIER (devnexen)
<details>
<summary>Changes</summary>
…in attempt (#<!-- -->106902)
---
Full diff: https://github.com/llvm/llvm-project/pull/106908.diff
1 Files Affected:
- (modified) compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp (+4)
``````````diff
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
index db80eb383885e6..b262755fa436b2 100644
--- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
@@ -239,6 +239,7 @@ size_t PageSize() {
}
void SetThreadName(std::thread &thread, const std::string &name) {
+#if !defined(__MINGW32__)
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
proc ThreadNameProc =
@@ -253,6 +254,9 @@ void SetThreadName(std::thread &thread, const std::string &name) {
}
}
}
+#else
+ (void)pthread_setname_np(thread.native_handle(), name.c_str());
+#endif
}
} // namespace fuzzer
``````````
</details>
https://github.com/llvm/llvm-project/pull/106908
More information about the llvm-branch-commits
mailing list