[Bug 293165] devel/libddwaf: fix build with clang 21

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 13 Feb 2026 19:22:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293165

            Bug ID: 293165
           Summary: devel/libddwaf: fix build with clang 21
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

With clang 21 devel/libddwaf fails to build, with errors similar to:

    In file included from
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format.cc:8:
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format-inl.h:61:19:
error: call to consteval function 'ddwaf::fmt::basic_format_string<char,
ddwaf::fmt::basic_string_view<char> &, const char
(&)[3]>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant
expression
       61 |     format_to(it, FMT_STRING("{}{}"), message, SEP);
          |                   ^
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format.h:1905:23:
note: expanded from macro 'FMT_STRING'
     1905 | #define FMT_STRING(s) FMT_STRING_IMPL(s,
fmt::detail::compile_string, )
          |                       ^
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format.h:1882:3:
note: expanded from macro 'FMT_STRING_IMPL'
     1882 |   [] {                                                             
          \
          |   ^
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:688:54:
note: subexpression not valid in a constant expression
      688 |     format_str_.remove_prefix(detail::to_unsigned(it - begin()));
          |                                                   ~~~^~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:2639:5:
note: in call to 'this->context_.advance_to(&"{}{}"[1])'
     2639 |     context_.advance_to(begin);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:2634:5:
note: in call to 'this->on_format_specs(0, &"{}{}"[1], &"{}{}"[1])'
     2634 |     on_format_specs(id, begin, begin);  // Call parse() on empty
specs.
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:2459:5:
note: in call to 'handler.on_replacement_field(0, &"{}{}"[1])'
     2459 |     handler.on_replacement_field(handler.on_arg_id(), begin);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:2491:21:
note: in call to 'parse_replacement_field<char,
ddwaf::fmt::detail::format_string_checker<char,
ddwaf::fmt::basic_string_view<char>, char[3]> &>(&"{}{}"[1], &"{}{}"[4],
checker(s))'
     2491 |         begin = p = parse_replacement_field(p - 1, end, handler);
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/core.h:2742:7:
note: in call to 'parse_format_string<true, char,
ddwaf::fmt::detail::format_string_checker<char,
ddwaf::fmt::basic_string_view<char>, char[3]>>({&"{}{}"[0], 4}, checker(s))'
     2742 |       detail::parse_format_string<true>(str_, checker(s));
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format-inl.h:61:19:
note: in call to 'basic_format_string<FMT_COMPILE_STRING, 0>([] {
        struct __attribute__((visibility("hidden")))  FMT_COMPILE_STRING :
fmt::detail::compile_string {
            using char_type [[maybe_unused]] =
fmt::remove_cvref_t<decltype("{}{}"[0])>;
            [[maybe_unused]] constexpr operator
fmt::basic_string_view<char_type>() const {
                return
fmt::detail_exported::compile_string_to_view<char_type>("{}{}");
            }
        };
        return FMT_COMPILE_STRING();
    }())'
       61 |     format_to(it, FMT_STRING("{}{}"), message, SEP);
          |                   ^~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format.h:1905:23:
note: expanded from macro 'FMT_STRING'
     1905 | #define FMT_STRING(s) FMT_STRING_IMPL(s,
fmt::detail::compile_string, )
          |                      
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/wrkdirs/usr/ports/devel/libddwaf/work/libddwaf-1.30.1/src/vendor/fmt/format.h:1882:3:
note: expanded from macro 'FMT_STRING_IMPL'
     1882 |   [] {                                                             
          \
          |  
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1883 |     /* Use the hidden visibility as a workaround for a GCC bug
(#1973). */    \
          |    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1884 |     /* Use a macro-like name to avoid shadowing warnings. */       
          \
          |    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1885 |     struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base {    
          \
          |    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1886 |       using char_type FMT_MAYBE_UNUSED =
fmt::remove_cvref_t<decltype(s[0])>; \
          |      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1887 |       FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit                      
          \
          |      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1888 |       operator fmt::basic_string_view<char_type>() const {         
          \
          |      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1889 |         return
fmt::detail_exported::compile_string_to_view<char_type>(s);    \
          |        
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1890 |       }                                                            
          \
          |      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1891 |     };                                                             
          \
          |    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1892 |     return FMT_COMPILE_STRING();                                   
          \
          |    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1893 |   }()
          |   ~~~

This is caused by an outdated vendored version of the fmt library, from
<https://github.com/fmtlib/fmt>. Upstream libddwaf updated their
vendored copy in <https://github.com/DataDog/libddwaf/commit/d9dd3eb>,
which is a bit large due to the vendor update, but the patch applies
with a minimum of fuzz, and makes libddwaf build with clang 21.

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