protoc v35.1 fails to build on FreeBSD 15.0 and LLVM/Clang 19.1.7 with libc++
Author: NuLL3rr0rCreated Jun 12, 2026Updated Sep 15, 2026
Labelsbuguntriagedinactive
What version of protobuf and what language are you using?
Version: v35.1
Language: C++
FreeBSD
LLVM/Clang and libc++ (system's default)
What did you do?
Steps to reproduce the behavior:
I have a Makefile that builds protoc like this:
echo "$(FMT_HEADER_PREFIX) Configuring protoc sources..."; \
echo ; \
echo " - $${SOURCE_DIR}"; \
echo " - $${BUILD_DIR}"; \
echo ; \
"$(CMAKE)" \
-G "Ninja Multi-Config" \
-DCMAKE_MAKE_PROGRAM="$(NINJA)" \
-DCMAKE_CONFIGURATION_TYPES="Release" \
-DCMAKE_INSTALL_PREFIX="$${STAGE_DIR}" \
-DCMAKE_INSTALL_LIBDIR=lib \
-S "$${SOURCE_DIR}" \
-B "$${BUILD_DIR}" \
-DCMAKE_PREFIX_PATH="$${ABSEIL_STAGE_DIR};$${ZLIB_STAGE_DIR}" \
-Dutf8_range_ENABLE_TESTS=OFF \
-Dutf8_range_ENABLE_INSTALL=ON \
-Dprotobuf_INSTALL=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_CONFORMANCE=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-Dprotobuf_BUILD_PROTOBUF_BINARIES=ON \
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_BUILD_LIBUPB=ON \
-Dprotobuf_DISABLE_RTTI=ON \
-Dprotobuf_TEST_XML_OUTDIR=OFF \
-Dprotobuf_ALLOW_CCACHE=OFF \
-Dprotobuf_FORCE_FETCH_DEPENDENCIES=OFF \
-Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON \
-Dprotobuf_BUILD_SHARED_LIBS=OFF \
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF \
-Dprotobuf_WITH_ZLIB_DEFAULT=ON \
-Dprotobuf_WITH_ZLIB=ON \
-Dprotobuf_DEBUG_POSTFIX="d" \
-Dprotobuf_USE_UNITY_BUILD=ON;
What did you expect to see
It should build like older releases e.g. v34.2. But v35.2 fails with the following error.
What did you see instead?
!! Configuring protoc sources...
- /home/mamadou/WickHopper/third-party/protobuf
- /tmp/WickHopper-XXXXXX.KaVLQW729E/build
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- protobuf version: 35.1.0
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /tmp/WickHopper-XXXXXX.KaVLQW729E/zlib-stage/lib/libz.a (found version "1.3.2")
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done (1.8s)
-- Generating done (0.1s)
-- Build files have been written to: /tmp/WickHopper-XXXXXX.KaVLQW729E/build
!! Building protoc...
- /home/mamadou/WickHopper/third-party/protobuf
- /tmp/WickHopper-XXXXXX.KaVLQW729E/build
[17/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/arena.cc.o
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/arena.cc:703:19: warning: 'MutexLock' is deprecated: Use the constructor that takes a reference instead [-Wdeprecated-declarations]
703 | absl::MutexLock lock(&mutex_);
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:620:5: note: 'MutexLock' has been explicitly marked deprecated here
620 | [[deprecated("Use the constructor that takes a reference instead")]]
| ^
1 warning generated.
[18/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/arenastring.cc.o
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/arenastring.cc:60:6: warning: 'Lock' is deprecated [-Wdeprecated-declarations]
60 | mu.Lock();
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:181:3: note: 'Lock' has been explicitly marked deprecated here
181 | ABSL_DEPRECATE_AND_INLINE()
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/base/macros.h:229:39: note: expanded from macro 'ABSL_DEPRECATE_AND_INLINE'
229 | #define ABSL_DEPRECATE_AND_INLINE() [[deprecated]] ABSL_REFACTOR_INLINE
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/arenastring.cc:68:6: warning: 'Unlock' is deprecated [-Wdeprecated-declarations]
68 | mu.Unlock();
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:190:3: note: 'Unlock' has been explicitly marked deprecated here
190 | ABSL_DEPRECATE_AND_INLINE()
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/base/macros.h:229:39: note: expanded from macro 'ABSL_DEPRECATE_AND_INLINE'
229 | #define ABSL_DEPRECATE_AND_INLINE() [[deprecated]] ABSL_REFACTOR_INLINE
| ^
2 warnings generated.
[21/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/dynamic_message.cc.o
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/dynamic_message.cc:845:27: warning: 'weak' is deprecated [-Wdeprecated-declarations]
845 | !field->options().weak() && !InRealOneof(field) &&
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/dynamic_message.cc:880:19: warning: 'MutexLock' is deprecated: Use the constructor that takes a reference instead [-Wdeprecated-declarations]
880 | absl::MutexLock lock(&prototypes_mutex_);
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:620:5: note: 'MutexLock' has been explicitly marked deprecated here
620 | [[deprecated("Use the constructor that takes a reference instead")]]
| ^
2 warnings generated.
[31/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/generated_message_tctable_gen.cc.o
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc:668:41: warning: 'weak' is deprecated [-Wdeprecated-declarations]
668 | if (descriptor->field(i)->options().weak()) {
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc:707:24: warning: 'weak' is deprecated [-Wdeprecated-declarations]
707 | field->options().weak()) {
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc:742:50: warning: 'weak' is deprecated [-Wdeprecated-declarations]
742 | !field->is_map() && !field->options().weak() &&
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_tctable_gen.cc:782:35: warning: 'weak' is deprecated [-Wdeprecated-declarations]
782 | } else if (field->options().weak()) {
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
4 warnings generated.
[44/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/generated_message_reflection.cc.o
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:62:
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/reflection_visit_fields.h:109:35: warning: 'weak' is deprecated [-Wdeprecated-declarations]
109 | ABSL_DCHECK(!field->options().weak()) << "weak fields are not supported";
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:2518:25: warning: 'weak' is deprecated [-Wdeprecated-declarations]
2518 | !field->options().weak() && !IsLazyField(field) &&
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3228:33: warning: 'weak' is deprecated [-Wdeprecated-declarations]
3228 | ABSL_DCHECK(!field->options().weak());
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3261:33: warning: 'weak' is deprecated [-Wdeprecated-declarations]
3261 | ABSL_DCHECK(!field->options().weak());
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3270:33: warning: 'weak' is deprecated [-Wdeprecated-declarations]
3270 | ABSL_DCHECK(!field->options().weak());
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3279:33: warning: 'weak' is deprecated [-Wdeprecated-declarations]
3279 | ABSL_DCHECK(!field->options().weak());
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:12:
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.h:26:
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.h:2702:29: warning: 'ReaderMutexLock' is deprecated: Use the constructor that takes a reference instead [-Wdeprecated-declarations]
2702 | absl::ReaderMutexLock lock(&pool->field_memo_table_mutex_);
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3698:29: note: in instantiation of function template specialization 'google::protobuf::DescriptorPool::MemoizeProjection<google::protobuf::EnumDescriptor, (lambda at /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3700:17)>' requested here
3698 | DescriptorPool::MemoizeProjection(
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:663:5: note: 'ReaderMutexLock' has been explicitly marked deprecated here
663 | [[deprecated("Use the constructor that takes a reference instead")]]
| ^
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:12:
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.h:26:
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.h:2711:23: warning: 'MutexLock' is deprecated: Use the constructor that takes a reference instead [-Wdeprecated-declarations]
2711 | absl::MutexLock lock(&pool->field_memo_table_mutex_);
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:620:5: note: 'MutexLock' has been explicitly marked deprecated here
620 | [[deprecated("Use the constructor that takes a reference instead")]]
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3935:8: warning: 'Lock' is deprecated [-Wdeprecated-declarations]
3935 | mu.Lock();
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:181:3: note: 'Lock' has been explicitly marked deprecated here
181 | ABSL_DEPRECATE_AND_INLINE()
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/base/macros.h:229:39: note: expanded from macro 'ABSL_DEPRECATE_AND_INLINE'
229 | #define ABSL_DEPRECATE_AND_INLINE() [[deprecated]] ABSL_REFACTOR_INLINE
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:3937:8: warning: 'Unlock' is deprecated [-Wdeprecated-declarations]
3937 | mu.Unlock();
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:190:3: note: 'Unlock' has been explicitly marked deprecated here
190 | ABSL_DEPRECATE_AND_INLINE()
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/base/macros.h:229:39: note: expanded from macro 'ABSL_DEPRECATE_AND_INLINE'
229 | #define ABSL_DEPRECATE_AND_INLINE() [[deprecated]] ABSL_REFACTOR_INLINE
| ^
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:62:
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/reflection_visit_fields.h:109:35: warning: 'weak' is deprecated [-Wdeprecated-declarations]
109 | ABSL_DCHECK(!field->options().weak()) << "weak fields are not supported";
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/reflection_visit_fields.h:447:20: note: in instantiation of function template specialization 'google::protobuf::internal::ReflectionVisit::VisitFields<google::protobuf::Message, (lambda at /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/reflection_visit_fields.h:449:7)>' requested here
447 | ReflectionVisit::VisitFields(
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/reflection_visit_fields.h:502:20: note: in instantiation of function template specialization 'google::protobuf::internal::ReflectionVisit::VisitMessageFields<(lambda at /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:1399:48)>' requested here
502 | ReflectionVisit::VisitMessageFields(message, std::forward<CallbackFn>(func));
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:1399:15: note: in instantiation of function template specialization 'google::protobuf::internal::VisitMutableMessageFields<(lambda at /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/generated_message_reflection.cc:1399:48)>' requested here
1399 | internal::VisitMutableMessageFields(*curr, [&](Message& msg) {
| ^
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.pb.h:8215:19: note: 'weak' has been explicitly marked deprecated here
8215 | [[nodiscard]] [[deprecated]] bool weak() const;
| ^
11 warnings generated.
[45/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/io/zero_copy_stream_impl.cc.o
FAILED: [code=1] CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/io/zero_copy_stream_impl.cc.o
/usr/bin/c++ -DGOOGLE_PROTOBUF_CMAKE_BUILD -DGOOGLE_PROTOBUF_NO_RTTI=1 -DHAVE_ZLIB -DCMAKE_INTDIR=\"Release\" -I/tmp/WickHopper-XXXXXX.KaVLQW729E/build -I/home/mamadou/WickHopper/third-party/protobuf -I/tmp/WickHopper-XXXXXX.KaVLQW729E/build/src -I/home/mamadou/WickHopper/third-party/protobuf/src -I/home/mamadou/WickHopper/third-party/protobuf/third_party/utf8_range -isystem /tmp/WickHopper-XXXXXX.KaVLQW729E/zlib-stage/include -isystem /tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include -O3 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/io/zero_copy_stream_impl.cc.o -MF CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/io/zero_copy_stream_impl.cc.o.d -o CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/io/zero_copy_stream_impl.cc.o -c /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc
In file included from /home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:24:
In file included from /usr/include/c++/v1/istream:164:
In file included from /usr/include/c++/v1/__ostream/basic_ostream.h:24:
In file included from /usr/include/c++/v1/ios:220:
/usr/include/c++/v1/__locale:530:12: error: use of undeclared identifier 'isascii'
530 | return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) != 0 : false;
| ^
/usr/include/c++/v1/__locale:535:16: error: use of undeclared identifier 'isascii'
535 | *__vec = isascii(*__low) ? __tab_[static_cast<int>(*__low)] : 0;
| ^
/usr/include/c++/v1/__locale:541:11: error: use of undeclared identifier 'isascii'
541 | if (isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m))
| ^
/usr/include/c++/v1/__locale:548:12: error: use of undeclared identifier 'isascii'
548 | if (!isascii(*__low) || !(__tab_[static_cast<int>(*__low)] & __m))
| ^
4 errors generated.
[48/344] Building CXX object CMakeFiles/libprotobuf.dir/Release/src/google/protobuf/descriptor.cc.o
/home/mamadou/WickHopper/third-party/protobuf/src/google/protobuf/descriptor.cc:1985:27: warning: 'ReaderMutexLock' is deprecated: Use the constructor that takes a reference instead [-Wdeprecated-declarations]
1985 | absl::ReaderMutexLock lock(pool->mutex_);
| ^
/tmp/WickHopper-XXXXXX.KaVLQW729E/abseil-stage/include/absl/synchronization/mutex.h:663:5: note: 'ReaderMutexLock' has been explicitly marked deprecated here
663 | [[deprecated("Use the constructor that takes a
Source: protocolbuffers/protobuf