[Bug 281431] www/qt5-webengine: fix build with clang and libc++ 19

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Sep 11 17:23:49 BST 2024


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

--- Comment #4 from commit-hook at FreeBSD.org ---
A commit in branch 2024Q3 references this bug:

URL:
https://cgit.FreeBSD.org/ports/commit/?id=9689b3535590a801ea7ffaad455981642c6bdfb7

commit 9689b3535590a801ea7ffaad455981642c6bdfb7
Author:     Dimitry Andric <dim at FreeBSD.org>
AuthorDate: 2024-09-11 07:12:57 +0000
Commit:     Dimitry Andric <dim at FreeBSD.org>
CommitDate: 2024-09-11 16:22:32 +0000

    www/qt5-webengine: fix build with clang and libc++ 19

    As noted in the libc++ 19 release notes [1], std::char_traits<> is now
    only provided for char, char8_t, char16_t, char32_t and wchar_t, and any
    instantiation for other types will fail.

    This causes www/qt5-webengine to fail to compile with clang 19 and
    libc++ 19, resulting in errors similar to:

      /usr/include/c++/v1/string:820:42: error: implicit instantiation of
undefined template 'std::char_traits<unsigned short>'
        820 |   static_assert(is_same<_CharT, typename
traits_type::char_type>::value,
            |                                          ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/v8/src/inspector/v8-string-conversions.cc:390:26:
note: in instantiation of template class 'std::basic_string<unsigned short>'
requested here
        390 | std::basic_string<UChar> UTF8ToUTF16(const char* stringStart,
size_t length) {
            |                          ^
      /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
         23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
            |                             ^

    Upstream v8 has fixed this in commit 182d9c05e78 [2], so add it as a
    backported patch, until the next version of qt5-webengine is released.

    Also, clang 19 now implements CWG 96 [1], which requires a template
    argument list after a 'template' keyword, resulting in errors similar
    to:

     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/hash_table.h:1789:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
       1789 |   Allocator::template BackingWriteBarrier(&table_);
            |                       ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/hash_table.h:1847:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
       1847 |   Allocator::template BackingWriteBarrier(&table_);
            |                       ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/hash_table.h:2015:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
       2015 |   Allocator::template BackingWriteBarrier(&table_);
            |                       ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/hash_table.h:2016:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
       2016 |   Allocator::template BackingWriteBarrier(&other.table_);
            |                       ^

    and:

     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:110:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
        110 |     Base::template Trace([](typename Base::TraceContext ctx) {
ctx.Flush(); });
            |                    ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:124:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
        124 |     Base::template Trace([&](typename Base::TraceContext ctx) {
            |                    ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:431:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
        431 |     Base::template Trace([&](typename Base::TraceContext ctx) {
            |                    ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:548:22:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
        548 |       Base::template TraceWithInstances(instances,
std::move(lambda));
            |                      ^
     
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h:563:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
        563 |     Base::template Trace([&](typename Base::TraceContext ctx) {
            |                    ^

    In case of wtf, appending "<>" is enough to satisfy the constraint. For
    perfetto, this was fixed by upstream commit e2f661907a [3].

    [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
    [2] https://chromium.googlesource.com/v8/v8.git/+/182d9c05e78
    [3]
https://android.googlesource.com/platform/external/perfetto/+/e2f661907a

    PR:             281431
    Approved by:    jhale (maintainer)
    MFH:            2024Q3

    (cherry picked from commit 0ddd6468fb3cb9ba390973520517cb1ca2cd690d)

 www/qt5-webengine/files/patch-libc++19 (new)       | 176 +++++++++++++++++++++
 ...blink_renderer_platform_wtf_hash__table.h (new) |  31 ++++
 ...ing_internal_track__event__data__source.h (new) |  47 ++++++
 3 files changed, 254 insertions(+)

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


More information about the kde-freebsd mailing list