https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/150591
Backport 1a32bcb4379fb90d2b764ac33b917de1431c6b16 Requested by: @DavidSpickett >From d1bc064bff5c4ed84fbad4f415527ad73eaf2556 Mon Sep 17 00:00:00 2001 From: cvspvr <cs...@outlook.com> Date: Thu, 24 Jul 2025 20:35:42 +1000 Subject: [PATCH] [lldb] Allow building using Mingw-w64 on Windows. (#150398) I wasn't able to build lldb using Mingw-w64 on Windows without changing these 3 lines. It seems like `std::atomic<bool>` wasn't being found without `#include <atomic>` and `ceil` was defaulting to `std::ceil` instead of `std::chrono::ceil`, but I'm not smart enough to know the root cause. I'm sure I'm not the first people to try and compile lldb (and clang and lld) with Mingw-w64 and I don't know if something is wrong with my Mingw-w64, but my changes shouldn't have any affect if they aren't needed. (cherry picked from commit 1a32bcb4379fb90d2b764ac33b917de1431c6b16) --- lldb/source/Host/windows/MainLoopWindows.cpp | 1 + lldb/source/Host/windows/PipeWindows.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lldb/source/Host/windows/MainLoopWindows.cpp b/lldb/source/Host/windows/MainLoopWindows.cpp index a1de895c0ba98..c1a018238432d 100644 --- a/lldb/source/Host/windows/MainLoopWindows.cpp +++ b/lldb/source/Host/windows/MainLoopWindows.cpp @@ -14,6 +14,7 @@ #include "llvm/Config/llvm-config.h" #include "llvm/Support/WindowsError.h" #include <algorithm> +#include <atomic> #include <cassert> #include <ctime> #include <io.h> diff --git a/lldb/source/Host/windows/PipeWindows.cpp b/lldb/source/Host/windows/PipeWindows.cpp index 0b495fff69dfa..001396fafde04 100644 --- a/lldb/source/Host/windows/PipeWindows.cpp +++ b/lldb/source/Host/windows/PipeWindows.cpp @@ -279,7 +279,8 @@ llvm::Expected<size_t> PipeWindows::Read(void *buf, size_t size, return Status(failure_error, eErrorTypeWin32).takeError(); DWORD timeout_msec = - timeout ? ceil<std::chrono::milliseconds>(*timeout).count() : INFINITE; + timeout ? std::chrono::ceil<std::chrono::milliseconds>(*timeout).count() + : INFINITE; DWORD wait_result = ::WaitForSingleObject(m_read_overlapped.hEvent, timeout_msec); if (wait_result != WAIT_OBJECT_0) { @@ -324,7 +325,8 @@ llvm::Expected<size_t> PipeWindows::Write(const void *buf, size_t size, return Status(failure_error, eErrorTypeWin32).takeError(); DWORD timeout_msec = - timeout ? ceil<std::chrono::milliseconds>(*timeout).count() : INFINITE; + timeout ? std::chrono::ceil<std::chrono::milliseconds>(*timeout).count() + : INFINITE; DWORD wait_result = ::WaitForSingleObject(m_write_overlapped.hEvent, timeout_msec); if (wait_result != WAIT_OBJECT_0) { _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits