Skip to contentSkip to conversation

package/grpc: install utf8_range_lib for host-grpc

PATCH New Yegor Yefremov via buildroot 1 participant 1 message Nov 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/grpc: install utf8_range_lib for host-grpc

On build hosts whose linker does not default to --as-needed (e.g. Arch Linux), packages using the host grpc_cpp_plugin fail to build:

PROTOC collectd.grpc.pb.cc
.../host/bin/grpc_cpp_plugin: error while loading shared libraries: libutf8_range_lib.so.56: cannot open shared object file: No such file or directory --grpc_out: protoc-gen-grpc: Plugin failed with status code 127.

Since grpc 1.76.0, grpc_plugin_support links with grpc's bundled utf8_range_lib. Our patch adding the gRPC_BUILD_PLUGIN_SUPPORT_ONLY option, used for host-grpc, was updated accordingly to build utf8_range_lib, but kept its installation disabled in this mode, while grpc_plugin_support and grpc_cpp_plugin are installed. As host-grpc is built as shared libraries, the installed libgrpc_plugin_support.so then depends on a library missing from $(HOST_DIR)/lib. With --as-needed, the dependency is dropped as the symbols are also provided by protobuf's libutf8_range, which hides the issue on most distributions.

Update the patch to also install utf8_range_lib in plugin support only mode, like grpc_plugin_support.

This issue has been present since commit 656fc0f78e ("package/grpc:
bump to version 1.76.0"), which made the patch build utf8_range_lib without installing it. It therefore affects 2026.02 and later, including the 2026.02.x LTS branch.

Fixes:
https://autobuild.buildroot.org/results/0b105f951e923ac1c8292a1655f6b87e73cb19de
https://autobuild.buildroot.org/results/cdb4dba11d1cb2854184da3ebe2f5d82a4745e56

Fixes 656fc0f78e9f225136a0161998b328902ca514d2 ("package/grpc: bump to version 1.76.0")
Assisted-by Claude:claude-opus-5-5
---
 ...strict-building-of-host-grpc-to-grpc.patch | 28 ++++++++-----------
 1 file changed, 11 insertions(+), 17 deletions(-)
package/grpc/0002-Add-option-to-restrict-building-of-host-grpc-to-grpc.patch +11 -17
index 03ca1d7bf4..a74b44258c 100644
@@ -17,9 +17,12 @@ Updated for 1.76.0:
 Signed-off-by: Michael Nosthoff <[email protected]>
 [Bernd: rebased for 1.83.1]
 Signed-off-by: Bernd Kuhls <[email protected]>
+[Yegor: install utf8_range_lib in plugin support only mode, as the
+ installed grpc_plugin_support library links with it]
+Signed-off-by: Yegor Yefremov <[email protected]>
 ---
- CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++------
- 1 file changed, 33 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 37 +++++++++++++++++++++++++++++++------
+ 1 file changed, 31 insertions(+), 6 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index bc86c00463..08441ddbd2 100644
@@ -113,24 +116,15 @@ index bc86c00463..08441ddbd2 100644
  
  add_library(utf8_range_lib
    third_party/utf8_range/utf8_range.c
-@@ -4681,7 +4698,7 @@ target_link_libraries(utf8_range_lib
-   ${_gRPC_ALLTARGETS_LIBRARIES}
- )
+@@ -4683,7 +4700,7 @@ target_link_libraries(utf8_range_lib
  
--
-+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
  
- if(gRPC_INSTALL)
-   install(TARGETS utf8_range_lib EXPORT gRPCTargets
-@@ -4692,6 +4709,8 @@ if(gRPC_INSTALL)
-   )
- endif()
  
-+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
-+
- if(gRPC_BUILD_TESTS)
- 
- if(gRPC_BUILD_CODEGEN)
+-if(gRPC_INSTALL)
++if(gRPC_INSTALL OR gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+   install(TARGETS utf8_range_lib EXPORT gRPCTargets
+     RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+     BUNDLE DESTINATION  ${gRPC_INSTALL_BINDIR}
 @@ -4784,6 +4803,8 @@ endif()
  
  endif()
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot