[compiler-rt] b32dc67 - Revert "[compiler-rt][fuzzer] SetThreadName build fix for Mingwin attempt (#106902)"

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 05:26:16 PDT 2024


Author: Martin Storsjö
Date: 2024-09-02T15:25:56+03:00
New Revision: b32dc677325ccf992f7e957e15e97f41fdfa9c77

URL: https://github.com/llvm/llvm-project/commit/b32dc677325ccf992f7e957e15e97f41fdfa9c77
DIFF: https://github.com/llvm/llvm-project/commit/b32dc677325ccf992f7e957e15e97f41fdfa9c77.diff

LOG: Revert "[compiler-rt][fuzzer] SetThreadName build fix for Mingwin attempt (#106902)"

This reverts commit 7c4cffd9d8be424e9e9542be9aec3b5a6f69073e.

This commit broke compilation in environments that don't use
winpthreads.

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
index 7252d99dd375df..e0210aa0ac3651 100644
--- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
@@ -239,7 +239,6 @@ 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 = reinterpret_cast<proc>(
@@ -254,9 +253,6 @@ void SetThreadName(std::thread &thread, const std::string &name) {
       }
     }
   }
-#else
-  (void)pthread_setname_np(thread.native_handle(), name.c_str());
-#endif
 }
 
 } // namespace fuzzer


        


More information about the llvm-commits mailing list