[libc-commits] [libc] 72ebda2 - [libc] Ensure the RPC server is alwaus used

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Oct 8 15:25:27 PDT 2025


Author: Joseph Huber
Date: 2025-10-08T17:25:16-05:00
New Revision: 72ebda2ba50fbcff44b77076cee06d256835a74a

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

LOG: [libc] Ensure the RPC server is alwaus used

Summary:
Previous change made us no longer link `exit` by default which implied
the RPC server. This is a required symbol for the loader. This will be
fixed later when I port the loader to LLVMOffload. For now just work
around it to fix the bots.

Added: 
    

Modified: 
    libc/startup/gpu/amdgpu/start.cpp
    libc/startup/gpu/nvptx/start.cpp

Removed: 
    


################################################################################
diff  --git a/libc/startup/gpu/amdgpu/start.cpp b/libc/startup/gpu/amdgpu/start.cpp
index bf6c96ea7c617..48f095d924931 100644
--- a/libc/startup/gpu/amdgpu/start.cpp
+++ b/libc/startup/gpu/amdgpu/start.cpp
@@ -21,6 +21,9 @@ namespace LIBC_NAMESPACE_DECL {
 // FIXME: Factor this out into common logic so we don't need to stub it here.
 void teardown_main_tls() {}
 
+// FIXME: Touch this symbol to force this to be linked in statically.
+volatile void *dummy = &LIBC_NAMESPACE::rpc::client;
+
 DataEnvironment app;
 
 extern "C" uintptr_t __init_array_start[];

diff  --git a/libc/startup/gpu/nvptx/start.cpp b/libc/startup/gpu/nvptx/start.cpp
index 3dd85fdf36731..ce8f5bbb6d4eb 100644
--- a/libc/startup/gpu/nvptx/start.cpp
+++ b/libc/startup/gpu/nvptx/start.cpp
@@ -23,6 +23,9 @@ DataEnvironment app;
 // FIXME: Factor this out into common logic so we don't need to stub it here.
 void teardown_main_tls() {}
 
+// FIXME: Touch this symbol to force this to be linked in statically.
+volatile void *dummy = &LIBC_NAMESPACE::rpc::client;
+
 extern "C" {
 // Nvidia's 'nvlink' linker does not provide these symbols. We instead need
 // to manually create them and update the globals in the loader implememtation.


        


More information about the libc-commits mailing list