[llvm] [orc-rt] Updating socket handling on win to get it fully stubbed (PR #228038)
Jared Wyles via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 04:08:42 PDT 2026
https://github.com/jaredwy created https://github.com/llvm/llvm-project/pull/228038
This also fixes a missing header.
>From e5b6a362e71824bee9821ccbf4d196c6fe27a80c Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Thu, 1 Oct 2026 21:07:26 +1000
Subject: [PATCH] Updating socket handling on win to get it fully stubbed. Also
a missing header for mingw
---
orc-rt/lib/bedrock/CMakeLists.txt | 2 ++
.../lib/bedrock/sys/windows/CPUFeatures.cpp | 1 +
.../bedrock/sys/windows/SocketConnector.cpp | 16 +++++----------
.../lib/bedrock/sys/windows/SocketHandle.cpp | 20 +++++++++++++++++++
4 files changed, 28 insertions(+), 11 deletions(-)
create mode 100644 orc-rt/lib/bedrock/sys/windows/SocketHandle.cpp
diff --git a/orc-rt/lib/bedrock/CMakeLists.txt b/orc-rt/lib/bedrock/CMakeLists.txt
index 207900d0fa468..3867507abc0b4 100644
--- a/orc-rt/lib/bedrock/CMakeLists.txt
+++ b/orc-rt/lib/bedrock/CMakeLists.txt
@@ -65,6 +65,8 @@ set(ORC_RT_BEDROCK_WINDOWS_SOURCES
sys/windows/Memory.cpp
sys/windows/CPUFeatures.cpp
sys/windows/PageSize.cpp
+ sys/windows/SocketConnector.cpp
+ sys/windows/SocketHandle.cpp
sys/windows/TargetTriple.cpp
)
diff --git a/orc-rt/lib/bedrock/sys/windows/CPUFeatures.cpp b/orc-rt/lib/bedrock/sys/windows/CPUFeatures.cpp
index 9928a978c53a2..dc80681262637 100644
--- a/orc-rt/lib/bedrock/sys/windows/CPUFeatures.cpp
+++ b/orc-rt/lib/bedrock/sys/windows/CPUFeatures.cpp
@@ -1,5 +1,6 @@
#include "orc-rt-internal/bedrock/sys/CPUFeatures.h"
+#include <cstdint>
#include <intrin.h>
#include <windows.h>
diff --git a/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp b/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
index 31362b79c11ff..496bbb8203cae 100644
--- a/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
+++ b/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
@@ -10,20 +10,14 @@
using namespace orc_rt;
-namespace {
-
-Error socketConnectorNotImplemented(const ConnectionSpec &, Session &,
- BootstrapInfo) noexcept {
- return make_error<StringError>(
- "Socket transport is not implemented on Windows");
-}
-
-} // namespace
-
namespace orc_rt {
Error registerSocketConnector(ConnectorRegistry &R) noexcept {
- return R.registerConnector("socket", socketConnectorNotImplemented);
+ return R.registerConnector(
+ "socket",
+ [](const ConnectionSpec &, Session &, BootstrapInfo) noexcept -> Error {
+ return make_error<StringError>("socket connector not implemented");
+ });
}
} // namespace orc_rt
diff --git a/orc-rt/lib/bedrock/sys/windows/SocketHandle.cpp b/orc-rt/lib/bedrock/sys/windows/SocketHandle.cpp
new file mode 100644
index 0000000000000..a5b8e3ccd657b
--- /dev/null
+++ b/orc-rt/lib/bedrock/sys/windows/SocketHandle.cpp
@@ -0,0 +1,20 @@
+//===- SocketHandle.cpp - Windows SocketHandle stub -------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Compile-only Windows placeholder. This does not close a native socket and
+// must be replaced before SocketHandle is used to own real Windows sockets.
+//
+//===----------------------------------------------------------------------===//
+
+#include "orc-rt/bedrock/SocketHandle.h"
+
+namespace orc_rt {
+
+void SocketHandle::reset() noexcept { H = InvalidNativeSocketHandle; }
+
+} // namespace orc_rt
More information about the llvm-commits
mailing list