[llvm] [orc-rt] add stub for windows socket support. (PR #226855)
Jared Wyles via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 27 22:20:58 PDT 2026
https://github.com/jaredwy updated https://github.com/llvm/llvm-project/pull/226855
>From b2316bbe5c5254e415f81e916b3b6744d10102f9 Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Mon, 28 Sep 2026 10:19:35 +1000
Subject: [PATCH 1/3] [orc-rt] remove socket support per platform from ogre
---
orc-rt/tools/ogre/CMakeLists.txt | 4 ++++
orc-rt/tools/ogre/ogre.cpp | 2 ++
2 files changed, 6 insertions(+)
diff --git a/orc-rt/tools/ogre/CMakeLists.txt b/orc-rt/tools/ogre/CMakeLists.txt
index a448a7f1b76bf..373fd4aae65a6 100644
--- a/orc-rt/tools/ogre/CMakeLists.txt
+++ b/orc-rt/tools/ogre/CMakeLists.txt
@@ -1,5 +1,9 @@
add_executable(ogre ogre.cpp)
target_compile_options(ogre PRIVATE ${ORC_RT_COMPILE_FLAGS})
+if (APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_compile_definitions(ogre PRIVATE ORC_RT_HAS_SOCKET_CONNECTOR)
+endif()
+
# ogre uses the C++ API, which orc-rt-bedrock does not export when built as a
# shared library, so link the objects rather than the shipped library.
target_link_libraries(ogre
diff --git a/orc-rt/tools/ogre/ogre.cpp b/orc-rt/tools/ogre/ogre.cpp
index 1e9f1f3f12215..2a8a1134c5980 100644
--- a/orc-rt/tools/ogre/ogre.cpp
+++ b/orc-rt/tools/ogre/ogre.cpp
@@ -17,7 +17,9 @@
#include "orc-rt/bedrock/NativeDylibManager.h"
#include "orc-rt/bedrock/Session.h"
#include "orc-rt/bedrock/SimpleNativeMemoryMap.h"
+#ifdef ORC_RT_HAS_SOCKET_CONNECTOR
#include "orc-rt/bedrock/SocketConnector.h"
+#endif
#include "orc-rt/bedrock/ThreadPoolRunner.h"
#include "orc-rt/bedrock/sps/AllSPSCI.h"
>From 4a9edb83150c11fc4e9454a56e8c2e2a7a58f261 Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Mon, 28 Sep 2026 13:35:35 +1000
Subject: [PATCH 2/3] [orc-rt] Stubbing the symbol instead of turning it off
---
.../bedrock/sys/windows/SocketConnector.cpp | 29 +++++++++++++++++++
orc-rt/tools/ogre/ogre.cpp | 2 --
2 files changed, 29 insertions(+), 2 deletions(-)
create mode 100644 orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
diff --git a/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp b/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
new file mode 100644
index 0000000000000..31362b79c11ff
--- /dev/null
+++ b/orc-rt/lib/bedrock/sys/windows/SocketConnector.cpp
@@ -0,0 +1,29 @@
+//===- SocketConnector.cpp - Socket connector on Windows --------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "orc-rt/bedrock/SocketConnector.h"
+
+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);
+}
+
+} // namespace orc_rt
diff --git a/orc-rt/tools/ogre/ogre.cpp b/orc-rt/tools/ogre/ogre.cpp
index 2a8a1134c5980..1e9f1f3f12215 100644
--- a/orc-rt/tools/ogre/ogre.cpp
+++ b/orc-rt/tools/ogre/ogre.cpp
@@ -17,9 +17,7 @@
#include "orc-rt/bedrock/NativeDylibManager.h"
#include "orc-rt/bedrock/Session.h"
#include "orc-rt/bedrock/SimpleNativeMemoryMap.h"
-#ifdef ORC_RT_HAS_SOCKET_CONNECTOR
#include "orc-rt/bedrock/SocketConnector.h"
-#endif
#include "orc-rt/bedrock/ThreadPoolRunner.h"
#include "orc-rt/bedrock/sps/AllSPSCI.h"
>From 5fc3d0da0ba472ee02a9e5dc631248d67f660117 Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Mon, 28 Sep 2026 15:05:59 +1000
Subject: [PATCH 3/3] [orc-rt] removing the cmake toggle and fixing a copy and
paste error
---
orc-rt/tools/ogre/CMakeLists.txt | 3 ---
1 file changed, 3 deletions(-)
diff --git a/orc-rt/tools/ogre/CMakeLists.txt b/orc-rt/tools/ogre/CMakeLists.txt
index 373fd4aae65a6..4f7eb2e6a2d4a 100644
--- a/orc-rt/tools/ogre/CMakeLists.txt
+++ b/orc-rt/tools/ogre/CMakeLists.txt
@@ -1,8 +1,5 @@
add_executable(ogre ogre.cpp)
target_compile_options(ogre PRIVATE ${ORC_RT_COMPILE_FLAGS})
-if (APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
- target_compile_definitions(ogre PRIVATE ORC_RT_HAS_SOCKET_CONNECTOR)
-endif()
# ogre uses the C++ API, which orc-rt-bedrock does not export when built as a
# shared library, so link the objects rather than the shipped library.
More information about the llvm-commits
mailing list