Commit f3a33dff2 for llama.cpp
commit f3a33dff26f5d5ba8fbf47a26d4857c6edfe69a8
Author: Ed Addario <29247825+EAddario@users.noreply.github.com>
Date: Sat Sep 12 07:22:57 2026 +0100
rpc : fix linking when compiling with BUILD_SHARED_LIBS=OFF (#28492)
diff --git a/ggml/src/ggml-rpc/CMakeLists.txt b/ggml/src/ggml-rpc/CMakeLists.txt
index af3bd0290..e3d0c9b4c 100644
--- a/ggml/src/ggml-rpc/CMakeLists.txt
+++ b/ggml/src/ggml-rpc/CMakeLists.txt
@@ -36,8 +36,10 @@ if (GGML_RPC_RDMA)
target_compile_definitions(ggml-rpc PRIVATE GGML_RPC_RDMA)
if (APPLE)
# librdma.dylib only exists on macOS 26.2 and later. Link it weakly so a build made
- # where it exists still loads where it does not; checked at runtime before use.
- target_link_options(ggml-rpc PRIVATE "LINKER:-weak_library,${RDMA_LIB}")
+ # where it exists still loads where it does not; checked at runtime before use
+ # but with BUILD_SHARED_LIBS=OFF ggml-rpc is a static archive and never links
+ # so the librdma symbols used by transport-apple.cpp stay undefined.
+ target_link_options(ggml-rpc PUBLIC "LINKER:-weak_library,${RDMA_LIB}")
target_compile_definitions(ggml-rpc PRIVATE GGML_RPC_RDMA_APPLE)
target_sources(ggml-rpc PRIVATE transport-apple.cpp)
else()