Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jun 2026 17:08:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 296041] libc++: __locale fails to compile due to missing isascii declaration on FreeBSD 15.0
Message-ID:  <bug-296041-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296041

            Bug ID: 296041
           Summary: libc++: __locale fails to compile due to missing
                    isascii declaration on FreeBSD 15.0
           Product: Base System
           Version: 15.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: info@babaei.net

I am trying to build the latest Protobuf v35.1 on FreeBSD (v34.2 builds fine),
but it seems the new release triggers a bug inside libc++ internal headers:

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;
      |            ^


I've already reported it to Protobufs's developers here
https://github.com/protocolbuffers/protobuf/issues/27942 but it seems this is
not a bug in Protobuf. Rather a libc++ internal header or GNU extensions
compatibility issue, where that header is trying to use a GNU extension, which
will break when compiled with Clang enforcing that the GNU extensions are not
available.

I'm not sure whether this is the right place to report the issue or it's best
to report to LLVM libc++ team. But, checking the libc++ version on FreeBSD:

mamadou@freebsd-dev:~ $ cat p.cpp 
#include <iostream>
#include <__config>

int main()
{
#ifdef _LIBCPP_VERSION
    std::cout << "_LIBCPP_VERSION = " << _LIBCPP_VERSION << '\n';
#else
    std::cout << "_LIBCPP_VERSION not defined\n";
#endif
}
mamadou@freebsd-dev:~ $ clang++ -o p p.cpp
mamadou@freebsd-dev:~ $ ./p
_LIBCPP_VERSION = 190107
mamadou@freebsd-dev:~ $ 


It seems libc++ on the latest FreeBSD 15-RELEASE is not the latest version. I
am not sure if I can, or if I can how to install a newer libc++ on FreeBSD to
see if I can reproduce before reporting to the LLVM team.

More info about this issue can be found here:
https://github.com/protocolbuffers/protobuf/issues/27942

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-296041-227>