diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt --- a/libc/CMakeLists.txt +++ b/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() diff --git a/libc/utils/gpu/server/CMakeLists.txt b/libc/utils/gpu/server/CMakeLists.txt --- a/libc/utils/gpu/server/CMakeLists.txt +++ b/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 + $<$:-Wno-attributes>) + # Install the server and associated header. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/rpc_server.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gpu-none-llvm/ diff --git a/libc/utils/gpu/server/rpc_server.h b/libc/utils/gpu/server/rpc_server.h --- a/libc/utils/gpu/server/rpc_server.h +++ b/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 {