Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: abseil-cpp / protobuf on ILP32 archs
To:
Stuart Henderson <stu@spacehopper.org>
Cc:
ports <ports@openbsd.org>
Date:
Fri, 12 Sep 2025 02:32:03 +0200

Download raw body.

Thread
On Thu, Sep 04, 2025 at 12:46:07PM +0100, Stuart Henderson wrote:
> Several ports started failing on i386 after the protobuf update, and
> the later abseil-cpp update didn't improve the situation, this results
> in graphics/orthanc/server and productivity/libphonenumber failing to
> build with undefined symbols;
> 
> ld.lld: error: undefined symbol: char const* absl::lts_20250814::log_internal::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long, unsigned long long, char const*)
> >>> referenced by phonenumberutil.cc
> >>>               phonenumberutil.cc.o:(google::protobuf::RepeatedField<int>::GrowNoAnnotate(bool, int, int)) in archive libphonenumber.a
> 
> Does anyone have ideas about fixing or should we just mark them
> as ONLY_FOR_ARCHS = ${LP64_ARCHS} ?

This particular symbol is available in libabs_log_internal_check_op.so
which is correctly marked as NEEDED in the protobuf shared objects and
listed in the protobuf WANTLIBs

$ c++filt _ZN4absl12lts_2025081412log_internal17MakeCheckOpStringIyyEEPKcT_T0_S4_
char const* absl::lts_20250814::log_internal::MakeCheckOpString<unsigned long long, unsigned long long>(unsigned long long, unsigned long long, char const*)
$ grep -R _ZN4absl12lts_2025081412log_internal17MakeCheckOpStringIyyEEPKcT_T0_S4_ /usr/ >
Binary file /usr/local/lib/libabsl_log_internal_check_op.so.7.0 matches
Binary file /usr/local/lib/libprotobuf-lite.so.30.0 matches
Binary file /usr/local/lib/libprotobuf.so.33.0 matches
Binary file /usr/local/lib/libprotoc.so.34.0 matches

I admit I don't understand the CMakeLists.txt patch in libphonenumber at
all and I also don't know why this currently links on 64-bit architectures.

Anyway, the following diff fixes the build of libphonenumber for me with
a WIP update for protobuf 6.32.1 on i386 and still works on current arm64.

Index: Makefile
===================================================================
RCS file: /cvs/ports/productivity/libphonenumber/Makefile,v
diff -u -p -r1.76 Makefile
--- Makefile	31 Aug 2025 14:49:18 -0000	1.76
+++ Makefile	12 Sep 2025 00:16:21 -0000
@@ -3,7 +3,7 @@ COMMENT =	C++ library to parse/format/va
 GH_ACCOUNT =	google
 GH_PROJECT =	libphonenumber
 GH_TAGNAME =	v9.0.13
-REVISION =	0
+REVISION =	1
 
 SHARED_LIBS +=  geocoding                 0.1 # 8.12
 SHARED_LIBS +=  phonenumber               2.0 # 8.12
@@ -19,14 +19,21 @@ WANTLIB += ${COMPILER_LIBCXX} absl_base 
 WANTLIB += absl_cord absl_cord_internal absl_cordz_functions absl_cordz_handle
 WANTLIB += absl_cordz_info absl_crc32c absl_crc_cord_state absl_crc_cpu_detect
 WANTLIB += absl_crc_internal absl_debugging_internal absl_decode_rust_punycode
-WANTLIB += absl_demangle_internal absl_demangle_rust absl_exponential_biased
-WANTLIB += absl_graphcycles_internal absl_hash absl_hashtablez_sampler
-WANTLIB += absl_int128 absl_kernel_timeout_internal absl_log_severity
-WANTLIB += absl_malloc_internal absl_raw_hash_set absl_raw_logging_internal
-WANTLIB += absl_spinlock_wait absl_stacktrace absl_str_format_internal
-WANTLIB += absl_string_view absl_strings absl_strings_internal
-WANTLIB += absl_symbolize absl_synchronization absl_throw_delegate
-WANTLIB += absl_time absl_time_zone absl_tracing_internal absl_utf8_for_code_point
+WANTLIB += absl_demangle_internal absl_demangle_rust absl_examine_stack
+WANTLIB += absl_exponential_biased absl_graphcycles_internal absl_hash
+WANTLIB += absl_hashtablez_sampler absl_int128 absl_kernel_timeout_internal
+WANTLIB += absl_leak_check absl_log_entry absl_log_globals absl_log_internal_check_op
+WANTLIB += absl_log_internal_conditions absl_log_internal_fnmatch
+WANTLIB += absl_log_internal_format absl_log_internal_globals
+WANTLIB += absl_log_internal_log_sink_set absl_log_internal_message
+WANTLIB += absl_log_internal_nullguard absl_log_internal_proto
+WANTLIB += absl_log_internal_structured_proto absl_log_severity
+WANTLIB += absl_log_sink absl_malloc_internal absl_raw_hash_set
+WANTLIB += absl_raw_logging_internal absl_spinlock_wait absl_stacktrace
+WANTLIB += absl_str_format_internal absl_strerror absl_string_view
+WANTLIB += absl_strings absl_strings_internal absl_symbolize absl_synchronization
+WANTLIB += absl_throw_delegate absl_time absl_time_zone absl_tracing_internal
+WANTLIB += absl_utf8_for_code_point absl_vlog_config_internal
 WANTLIB += boost_date_time-mt boost_system-mt boost_thread-mt
 WANTLIB += icui18n icuuc m protobuf
 
Index: patches/patch-cpp_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/productivity/libphonenumber/patches/patch-cpp_CMakeLists_txt,v
diff -u -p -r1.8 patch-cpp_CMakeLists_txt
--- patches/patch-cpp_CMakeLists_txt	21 Sep 2023 07:31:10 -0000	1.8
+++ patches/patch-cpp_CMakeLists_txt	12 Sep 2025 00:12:32 -0000
@@ -60,3 +60,12 @@ Index: cpp/CMakeLists.txt
  endif ()
  
  include_directories ("src")
+@@ -427,7 +400,7 @@ include_directories ("src")
+ # Collate dependencies
+ #----------------------------------------------------------------
+ 
+-set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} absl::node_hash_set absl::strings absl::synchronization)
++set (LIBRARY_DEPS ${ICU_LIB} ${PROTOBUF_LIB} absl::check absl::log absl::node_hash_set absl::strings absl::synchronization)
+ 
+ if (USE_BOOST)
+   list (APPEND LIBRARY_DEPS ${Boost_LIBRARIES})