Skip to content

[lldb] Remove GDBRemoteCommunication::ConnectLocally #145293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Jun 23, 2025

Originally added for reproducers, it is now only used for test code.

While we could make it a test helper, I think that after #145015 it is simple enough to not be needed.

Also squeeze in a change to make ConnectionFileDescriptor accept a unique_ptr.

Originally added for reproducers, it is now only used for test code.

While we could make it a test helper, I think that after llvm#145015 it is
simple enough to not be needed.

Also squeeze in a change to make ConnectionFileDescriptor accept a
unique_ptr<Socket>.
@labath labath requested a review from JDevlieghere as a code owner June 23, 2025 08:57
@llvmbot llvmbot added the lldb label Jun 23, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 23, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

Originally added for reproducers, it is now only used for test code.

While we could make it a test helper, I think that after #145015 it is simple enough to not be needed.

Also squeeze in a change to make ConnectionFileDescriptor accept a unique_ptr<Socket>.


Full diff: https://github.com/llvm/llvm-project/pull/145293.diff

11 Files Affected:

  • (modified) lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h (+1-6)
  • (modified) lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp (+5-8)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (+2-16)
  • (modified) lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h (-3)
  • (modified) lldb/tools/lldb-server/lldb-platform.cpp (+2-2)
  • (modified) lldb/unittests/Core/CommunicationTest.cpp (+2-2)
  • (modified) lldb/unittests/Host/ConnectionFileDescriptorTest.cpp (+3-3)
  • (modified) lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp (+7-2)
  • (modified) lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp (+7-2)
  • (modified) lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp (+8-2)
  • (modified) lldb/unittests/tools/lldb-server/tests/TestClient.cpp (+2-1)
diff --git a/lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h b/lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
index b771f9c3f45a2..df0e196fea688 100644
--- a/lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
+++ b/lldb/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
@@ -18,13 +18,10 @@
 #include "lldb/Host/Pipe.h"
 #include "lldb/Host/Socket.h"
 #include "lldb/Utility/Connection.h"
-#include "lldb/Utility/IOObject.h"
 
 namespace lldb_private {
 
 class Status;
-class Socket;
-class SocketAddress;
 
 class ConnectionFileDescriptor : public Connection {
 public:
@@ -35,7 +32,7 @@ class ConnectionFileDescriptor : public Connection {
 
   ConnectionFileDescriptor(int fd, bool owns_fd);
 
-  ConnectionFileDescriptor(Socket *socket);
+  ConnectionFileDescriptor(std::unique_ptr<Socket> socket_up);
 
   ~ConnectionFileDescriptor() override;
 
@@ -136,8 +133,6 @@ class ConnectionFileDescriptor : public Connection {
   std::string m_uri;
 
 private:
-  void InitializeSocket(Socket *socket);
-
   ConnectionFileDescriptor(const ConnectionFileDescriptor &) = delete;
   const ConnectionFileDescriptor &
   operator=(const ConnectionFileDescriptor &) = delete;
diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
index ae935dda5af4e..57dce44812c89 100644
--- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
+++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
@@ -72,9 +72,11 @@ ConnectionFileDescriptor::ConnectionFileDescriptor(int fd, bool owns_fd)
   OpenCommandPipe();
 }
 
-ConnectionFileDescriptor::ConnectionFileDescriptor(Socket *socket)
-    : Connection(), m_pipe(), m_mutex(), m_shutting_down(false) {
-  InitializeSocket(socket);
+ConnectionFileDescriptor::ConnectionFileDescriptor(
+    std::unique_ptr<Socket> socket_up)
+    : m_shutting_down(false) {
+  m_uri = socket_up->GetRemoteConnectionURI();
+  m_io_sp = std::move(socket_up);
 }
 
 ConnectionFileDescriptor::~ConnectionFileDescriptor() {
@@ -796,8 +798,3 @@ ConnectionStatus ConnectionFileDescriptor::ConnectSerialPort(
 #endif // LLDB_ENABLE_POSIX
   llvm_unreachable("this function should be only called w/ LLDB_ENABLE_POSIX");
 }
-
-void ConnectionFileDescriptor::InitializeSocket(Socket *socket) {
-  m_io_sp.reset(socket);
-  m_uri = socket->GetRemoteConnectionURI();
-}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index d1f57cc22d8bd..0d3ead840b080 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -1128,8 +1128,8 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
     Socket *accepted_socket = nullptr;
     error = sock_up->Accept(/*timeout=*/std::nullopt, accepted_socket);
     if (accepted_socket) {
-      SetConnection(
-          std::make_unique<ConnectionFileDescriptor>(accepted_socket));
+      SetConnection(std::make_unique<ConnectionFileDescriptor>(
+          std::unique_ptr<Socket>(accepted_socket)));
     }
   }
 
@@ -1138,20 +1138,6 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
 
 void GDBRemoteCommunication::DumpHistory(Stream &strm) { m_history.Dump(strm); }
 
-llvm::Error
-GDBRemoteCommunication::ConnectLocally(GDBRemoteCommunication &client,
-                                       GDBRemoteCommunication &server) {
-  llvm::Expected<Socket::Pair> pair = Socket::CreatePair();
-  if (!pair)
-    return pair.takeError();
-
-  client.SetConnection(
-      std::make_unique<ConnectionFileDescriptor>(pair->first.release()));
-  server.SetConnection(
-      std::make_unique<ConnectionFileDescriptor>(pair->second.release()));
-  return llvm::Error::success();
-}
-
 GDBRemoteCommunication::ScopedTimeout::ScopedTimeout(
     GDBRemoteCommunication &gdb_comm, std::chrono::seconds timeout)
     : m_gdb_comm(gdb_comm), m_saved_timeout(0), m_timeout_modified(false) {
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index ee87629d9077b..fc86f801f0d8a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -149,9 +149,6 @@ class GDBRemoteCommunication : public Communication {
 
   void DumpHistory(Stream &strm);
 
-  static llvm::Error ConnectLocally(GDBRemoteCommunication &client,
-                                    GDBRemoteCommunication &server);
-
   /// Expand GDB run-length encoding.
   static std::optional<std::string> ExpandRLE(std::string);
 
diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp
index 37ec8455c63a7..3c79dc001f65e 100644
--- a/lldb/tools/lldb-server/lldb-platform.cpp
+++ b/lldb/tools/lldb-server/lldb-platform.cpp
@@ -485,8 +485,8 @@ int main_platform(int argc, char *argv[]) {
 
     GDBRemoteCommunicationServerPlatform platform(socket->GetSocketProtocol(),
                                                   gdbserver_port);
-    platform.SetConnection(std::unique_ptr<Connection>(
-        new ConnectionFileDescriptor(socket.release())));
+    platform.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(socket)));
     client_handle(platform, inferior_arguments);
     return 0;
   }
diff --git a/lldb/unittests/Core/CommunicationTest.cpp b/lldb/unittests/Core/CommunicationTest.cpp
index fd07b4da9f8c1..51e218af8baf4 100644
--- a/lldb/unittests/Core/CommunicationTest.cpp
+++ b/lldb/unittests/Core/CommunicationTest.cpp
@@ -41,7 +41,7 @@ static void CommunicationReadTest(bool use_read_thread) {
 
   ThreadedCommunication comm("test");
   comm.SetConnection(
-      std::make_unique<ConnectionFileDescriptor>(pair->second.release()));
+      std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
   comm.SetCloseOnEOF(true);
 
   if (use_read_thread) {
@@ -126,7 +126,7 @@ TEST_F(CommunicationTest, SynchronizeWhileClosing) {
 
   ThreadedCommunication comm("test");
   comm.SetConnection(
-      std::make_unique<ConnectionFileDescriptor>(pair->second.release()));
+      std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
   comm.SetCloseOnEOF(true);
   ASSERT_TRUE(comm.StartReadThread());
 
diff --git a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
index 250ed6fe8fd37..171481acca01b 100644
--- a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
+++ b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
@@ -22,11 +22,11 @@ class ConnectionFileDescriptorTest : public testing::Test {
     std::unique_ptr<TCPSocket> socket_a_up;
     std::unique_ptr<TCPSocket> socket_b_up;
     CreateTCPConnectedSockets(ip, &socket_a_up, &socket_b_up);
-    auto *socket = socket_a_up.release();
-    ConnectionFileDescriptor connection_file_descriptor(socket);
+    uint16_t socket_a_remote_port = socket_a_up->GetRemotePortNumber();
+    ConnectionFileDescriptor connection_file_descriptor(std::move(socket_a_up));
 
     std::string uri(connection_file_descriptor.GetURI());
-    EXPECT_EQ((URI{"connect", ip, socket->GetRemotePortNumber(), "/"}),
+    EXPECT_EQ((URI{"connect", ip, socket_a_remote_port, "/"}),
               *URI::Parse(uri));
   }
 };
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
index ed77e86ac3701..b28b8013bcdc7 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -10,6 +10,7 @@
 #include "GDBRemoteTestUtils.h"
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h"
+#include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Utility/GDBRemote.h"
 #include "lldb/Utility/Listener.h"
 #include "llvm/ADT/StringRef.h"
@@ -51,8 +52,12 @@ struct TestClient : public GDBRemoteClientBase {
 class GDBRemoteClientBaseTest : public GDBRemoteTest {
 public:
   void SetUp() override {
-    ASSERT_THAT_ERROR(GDBRemoteCommunication::ConnectLocally(client, server),
-                      llvm::Succeeded());
+    llvm::Expected<Socket::Pair> pair = Socket::CreatePair();
+    ASSERT_THAT_EXPECTED(pair, llvm::Succeeded());
+    client.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->first)));
+    server.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
     ASSERT_EQ(TestClient::eBroadcastBitRunPacketSent,
               listener_sp->StartListeningForEvents(
                   &client, TestClient::eBroadcastBitRunPacketSent));
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 96f377ec7dfac..f940229985887 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -8,6 +8,7 @@
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
 #include "GDBRemoteTestUtils.h"
 #include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/ConnectionFileDescriptor.h"
 #include "lldb/Host/XML.h"
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Utility/DataBuffer.h"
@@ -63,8 +64,12 @@ std::string one_register_hex = "41424344";
 class GDBRemoteCommunicationClientTest : public GDBRemoteTest {
 public:
   void SetUp() override {
-    ASSERT_THAT_ERROR(GDBRemoteCommunication::ConnectLocally(client, server),
-                      llvm::Succeeded());
+    llvm::Expected<Socket::Pair> pair = Socket::CreatePair();
+    ASSERT_THAT_EXPECTED(pair, llvm::Succeeded());
+    client.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->first)));
+    server.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
   }
 
 protected:
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp
index 3da1f0a718fc5..e96d587b10e25 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp
@@ -5,7 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
+
 #include "GDBRemoteTestUtils.h"
+#include "lldb/Host/ConnectionFileDescriptor.h"
 #include "llvm/Testing/Support/Error.h"
 
 using namespace lldb_private::process_gdb_remote;
@@ -28,8 +30,12 @@ class TestClient : public GDBRemoteCommunication {
 class GDBRemoteCommunicationTest : public GDBRemoteTest {
 public:
   void SetUp() override {
-    ASSERT_THAT_ERROR(GDBRemoteCommunication::ConnectLocally(client, server),
-                      llvm::Succeeded());
+    llvm::Expected<Socket::Pair> pair = Socket::CreatePair();
+    ASSERT_THAT_EXPECTED(pair, llvm::Succeeded());
+    client.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->first)));
+    server.SetConnection(
+        std::make_unique<ConnectionFileDescriptor>(std::move(pair->second)));
   }
 
 protected:
diff --git a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
index 48e089bc0fcff..f3510cad22e7f 100644
--- a/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
+++ b/lldb/unittests/tools/lldb-server/tests/TestClient.cpp
@@ -125,7 +125,8 @@ TestClient::launchCustom(StringRef Log, bool disable_stdio,
           listen_socket.Accept(2 * GetDefaultTimeout(), accept_socket)
               .takeError())
     return E;
-  auto Conn = std::make_unique<ConnectionFileDescriptor>(accept_socket);
+  auto Conn = std::make_unique<ConnectionFileDescriptor>(
+      std::unique_ptr<Socket>(accept_socket));
   auto Client = std::unique_ptr<TestClient>(new TestClient(std::move(Conn)));
 
   if (Error E = Client->initializeConnection())

@labath labath merged commit cf9546b into llvm:main Jun 24, 2025
9 checks passed
@labath labath deleted the socketpair branch June 24, 2025 09:11
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building lldb at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/17943

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[227/2502] Copying CXX header __algorithm/partial_sort.h
[228/2502] Generating header stdint.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdint.yaml
[229/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.llabs.dir/llabs.cpp.obj
[230/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strspn.dir/strspn.cpp.obj
[231/2502] Copying CXX header __algorithm/ranges_contains.h
[232/2502] Copying CXX header __algorithm/out_value_result.h
[233/2502] Copying CXX header __algorithm/nth_element.h
[234/2502] Copying CXX header __algorithm/ranges_adjacent_find.h
[235/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.srand.dir/srand.cpp.obj
[236/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/include/riscv32-unknown-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=riscv32-unknown-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:3: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |   ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:37: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |                                     ^
2 errors generated.
[237/2502] Copying CXX header __atomic/is_always_lock_free.h
[238/2502] Copying CXX header __algorithm/ranges_sort.h
[239/2502] Copying CXX header __algorithm/transform.h
[240/2502] Generating header uchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/uchar.yaml
[241/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strcasecmp.dir/strcasecmp.cpp.obj
[242/2502] Copying CXX header __algorithm/partition.h
[243/2502] Copying CXX header __algorithm/partial_sort_copy.h
[244/2502] Copying CXX header __algorithm/ranges_swap_ranges.h
[245/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strncasecmp.dir/strncasecmp.cpp.obj
[246/2502] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[247/2502] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[248/2502] Building CXX object libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.obj
[249/2502] Generating header strings.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/strings.yaml
[250/2502] Generating header complex.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/complex.yaml
[251/2502] Building CXX object libc/src/errno/CMakeFiles/libc.src.errno.errno.dir/libc_errno.cpp.obj
[252/2502] Generating header setjmp.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/setjmp.yaml
[253/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strstr.dir/strstr.cpp.obj
[254/2502] Generating header wchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/wchar.yaml
[255/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strcasestr.dir/strcasestr.cpp.obj
[256/2502] Generating header ctype.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/ctype.yaml
[257/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
[258/2502] Generating header string.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/string.yaml
[259/2502] Generating header stdio.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdio.yaml
[260/2502] Generating header stdbit.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdbit.yaml
[261/2502] Generating header time.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/time.yaml
[262/2502] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.crealf.dir/crealf.cpp.obj
[263/2502] Generating header stdlib.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdlib.yaml
[264/2502] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[265/2502] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf.dir/cimagf.cpp.obj
[266/2502] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_leading_zeros_ui.dir/stdc_leading_zeros_ui.cpp.obj
Step 6 (build) failure: build (failure)
...
[227/2502] Copying CXX header __algorithm/partial_sort.h
[228/2502] Generating header stdint.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdint.yaml
[229/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.llabs.dir/llabs.cpp.obj
[230/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strspn.dir/strspn.cpp.obj
[231/2502] Copying CXX header __algorithm/ranges_contains.h
[232/2502] Copying CXX header __algorithm/out_value_result.h
[233/2502] Copying CXX header __algorithm/nth_element.h
[234/2502] Copying CXX header __algorithm/ranges_adjacent_find.h
[235/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.srand.dir/srand.cpp.obj
[236/2502] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj
FAILED: libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/./bin/clang++ --target=riscv32-unknown-elf -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/include/riscv32-unknown-unknown-elf --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-g77y29y1/runtimes/runtimes-riscv32-unknown-elf-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=riscv32-unknown-elf -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -MF libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj.d -o libc/src/stdlib/CMakeFiles/libc.src.stdlib.memalignment.dir/memalignment.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:3: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |   ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdlib/memalignment.cpp:20:37: error: unknown type name 'uintptr_t'
   20 |   uintptr_t addr = reinterpret_cast<uintptr_t>(p);
      |                                     ^
2 errors generated.
[237/2502] Copying CXX header __atomic/is_always_lock_free.h
[238/2502] Copying CXX header __algorithm/ranges_sort.h
[239/2502] Copying CXX header __algorithm/transform.h
[240/2502] Generating header uchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/uchar.yaml
[241/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strcasecmp.dir/strcasecmp.cpp.obj
[242/2502] Copying CXX header __algorithm/partition.h
[243/2502] Copying CXX header __algorithm/partial_sort_copy.h
[244/2502] Copying CXX header __algorithm/ranges_swap_ranges.h
[245/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.strncasecmp.dir/strncasecmp.cpp.obj
[246/2502] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[247/2502] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[248/2502] Building CXX object libc/src/compiler/generic/CMakeFiles/libc.src.compiler.generic.__stack_chk_fail.dir/__stack_chk_fail.cpp.obj
[249/2502] Generating header strings.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/strings.yaml
[250/2502] Generating header complex.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/complex.yaml
[251/2502] Building CXX object libc/src/errno/CMakeFiles/libc.src.errno.errno.dir/libc_errno.cpp.obj
[252/2502] Generating header setjmp.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/setjmp.yaml
[253/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strstr.dir/strstr.cpp.obj
[254/2502] Generating header wchar.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/wchar.yaml
[255/2502] Building CXX object libc/src/string/CMakeFiles/libc.src.string.strcasestr.dir/strcasestr.cpp.obj
[256/2502] Generating header ctype.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/ctype.yaml
[257/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
[258/2502] Generating header string.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/string.yaml
[259/2502] Generating header stdio.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdio.yaml
[260/2502] Generating header stdbit.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdbit.yaml
[261/2502] Generating header time.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/time.yaml
[262/2502] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.crealf.dir/crealf.cpp.obj
[263/2502] Generating header stdlib.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/stdlib.yaml
[264/2502] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[265/2502] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf.dir/cimagf.cpp.obj
[266/2502] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_leading_zeros_ui.dir/stdc_leading_zeros_ui.cpp.obj

labath added a commit that referenced this pull request Jun 24, 2025
Mid-flight collision with #145293.
@antmox
Copy link
Contributor

antmox commented Jun 24, 2025

Hi @labath,
Looks like the build failure is not completely fixed : https://lab.llvm.org/buildbot/#/builders/141/builds/9634

labath added a commit that referenced this pull request Jun 24, 2025
@labath
Copy link
Collaborator Author

labath commented Jun 24, 2025

Thanks. I just noticed the windows failure. 3e98d2b ought to take care of it.

DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
Originally added for reproducers, it is now only used for test code.

While we could make it a test helper, I think that after llvm#145015 it is
simple enough to not be needed.

Also squeeze in a change to make ConnectionFileDescriptor accept a
unique_ptr<Socket>.
DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
Mid-flight collision with llvm#145293.
DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
Originally added for reproducers, it is now only used for test code.

While we could make it a test helper, I think that after llvm#145015 it is
simple enough to not be needed.

Also squeeze in a change to make ConnectionFileDescriptor accept a
unique_ptr<Socket>.
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
Mid-flight collision with llvm#145293.
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants