[libc-commits] [PATCH] D154105: [libc] Make the RPC server target always availible

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 29 09:25:50 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, sivachandra, lntue, michaelrj.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.

This patch makes sure that we always build the RPC server. The proposed
used for this is to begin integrating this server implementation into
`libomptarget`. That requires that we build this server ahead of time
when using a `LLVM_ENABLE_PROJECTS` build. Make a few tweaks to ensure
that the GCC compiler which may be used for this build doesn't complain.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154105

Files:
  libc/CMakeLists.txt
  libc/utils/gpu/server/CMakeLists.txt
  libc/utils/gpu/server/rpc_server.h


Index: libc/utils/gpu/server/rpc_server.h
===================================================================
--- libc/utils/gpu/server/rpc_server.h
+++ libc/utils/gpu/server/rpc_server.h
@@ -22,7 +22,7 @@
 
 /// The symbol name associated with the client for use with the LLVM C library
 /// implementation.
-static const char *rpc_client_symbol_name = "__llvm_libc_rpc_client";
+inline const char *rpc_client_symbol_name = "__llvm_libc_rpc_client";
 
 /// status codes.
 typedef enum {
Index: libc/utils/gpu/server/CMakeLists.txt
===================================================================
--- libc/utils/gpu/server/CMakeLists.txt
+++ libc/utils/gpu/server/CMakeLists.txt
@@ -5,6 +5,10 @@
 target_include_directories(llvmlibc_rpc_server PUBLIC ${LIBC_SOURCE_DIR}/include)
 target_include_directories(llvmlibc_rpc_server PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
 
+# Ignore unsupported clang attributes if we're using GCC.
+target_compile_options(llvmlibc_rpc_server PUBLIC
+                       $<$<CXX_COMPILER_ID:GNU>:-Wno-attributes>)
+
 # Install the server and associated header.
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/rpc_server.h
         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gpu-none-llvm/
Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -35,6 +35,11 @@
   # When libc is build as part of the runtimes/bootstrap build's CMake run, we
   # only need to build the host tools to build the libc. So, we just do enough
   # to build libc-hdrgen and return.
+
+  # Always make the RPC server availible to other projects for GPU mode.
+  if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
+    add_subdirectory(utils/gpu/server)
+  endif()
   return()
 endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154105.535848.patch
Type: text/x-patch
Size: 1770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230629/14e0a20b/attachment.bin>


More information about the libc-commits mailing list