Index | Thread | Search

From:
Renato Aguiar <renato@renatoaguiar.net>
Subject:
net/grpc: fix missing symbol
To:
Rafael Sadowski <rsadowski@openbsd.org>
Cc:
OpenBSD ports <ports@openbsd.org>
Date:
Thu, 14 Aug 2025 19:40:17 -0700

Download raw body.

Thread
When trying to use gRPC library with C++, I got the following link error:

ld: error: undefined reference: grpc_core::MakeDirectoryReader(std::__1::basic_string_view<char, std::__1::char_traits<char>>)
>>> referenced by /usr/local/lib/libgrpc.so.3.0 (disallowed by --no-allow-shlib-undefined)

Here is a patch adding that missing symbol to the gRPC library:

--- net/grpc/Makefile
+++ net/grpc/Makefile
@@ -5,6 +5,7 @@ COMMENT =	HTTP/2-based RPC framework
 
 V =		1.74.1
 DISTNAME =	grpc-${V}
+REVISION =	0
 
 DIST_TUPLE +=	github grpc grpc v${V} .
 
--- /dev/null
+++ net/grpc/patches/patch-src_core_util_posix_directory_reader_cc
@@ -0,0 +1,12 @@
+Index: src/core/util/posix/directory_reader.cc
+--- src/core/util/posix/directory_reader.cc.orig
++++ src/core/util/posix/directory_reader.cc
+@@ -25,7 +25,7 @@
+ #include "absl/strings/string_view.h"
+ 
+ #if defined(GPR_LINUX) || defined(GPR_ANDROID) || defined(GPR_FREEBSD) || \
+-    defined(GPR_APPLE) || defined(GPR_NETBSD)
++    defined(GPR_APPLE) || defined(GPR_NETBSD) || defined(GPR_OPENBSD)
+ 
+ #include <dirent.h>
+