git: 660b01aa59ee - main - www/qt6-webengine: fix build with libc++ 17
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 11 Nov 2023 09:46:42 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=660b01aa59ee1266ce0faf5718dc5c90abfa4f31 commit 660b01aa59ee1266ce0faf5718dc5c90abfa4f31 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-11-11 09:35:15 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-11-11 09:46:07 +0000 www/qt6-webengine: fix build with libc++ 17 Building www/qt6-webengine with libc++ 17 results in the following compile errors: In file included from gen/base/base_jumbo_2.cc:7: In file included from ./../../../../../qtwebengine-everywhere-src-6.5.3/src/3rdparty/chromium/base/check.cc:17: In file included from ../../../../../qtwebengine-everywhere-src-6.5.3/src/3rdparty/chromium/base/debug/crash_logging.h:16: In file included from ../../../../../qtwebengine-everywhere-src-6.5.3/src/3rdparty/chromium/base/strings/string_number_conversions.h:15: In file included from ../../../../../qtwebengine-everywhere-src-6.5.3/src/3rdparty/chromium/base/containers/span.h:18: ../../../../../qtwebengine-everywhere-src-6.5.3/src/3rdparty/chromium/base/containers/checked_iterators.h:241:8: error: no template named '__is_cpp17_contiguous_iterator'; did you mean '__libcpp_is_contiguous_iterator'? 241 | struct __is_cpp17_contiguous_iterator<::base::CheckedContiguousIterator<T>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | __libcpp_is_contiguous_iterator /usr/include/c++/v1/__iterator/iterator_traits.h:476:8: note: '__libcpp_is_contiguous_iterator' declared here 476 | struct __libcpp_is_contiguous_iterator : _Or< | ^ This is because the copy of chromium in qt6-webengine is missing an upstream fix for recent libc++ changes, in particular: https://chromium.googlesource.com/chromium/src/+/9bfbbffdba73668fdb483e5a850911d2b64c35d7 and its dependency: https://chromium.googlesource.com/chromium/src/+/5b5551edd3961481e617e510276b9f015a35b861 Apply these patches to work around the compile error. PR: 273753 MFH: 2023Q4 --- ...y_chromium_base_containers_checked__iterators.h | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_base_containers_checked__iterators.h b/www/qt6-webengine/files/patch-src_3rdparty_chromium_base_containers_checked__iterators.h new file mode 100644 index 000000000000..5a63712a10bb --- /dev/null +++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_base_containers_checked__iterators.h @@ -0,0 +1,75 @@ +--- src/3rdparty/chromium/base/containers/checked_iterators.h.orig 2023-09-07 16:02:00 UTC ++++ src/3rdparty/chromium/base/containers/checked_iterators.h +@@ -23,6 +23,9 @@ class CheckedContiguousIterator { + using pointer = T*; + using reference = T&; + using iterator_category = std::random_access_iterator_tag; ++#if __cplusplus >= 202002L ++ using iterator_concept = std::contiguous_iterator_tag; ++#endif + + // Required for converting constructor below. + template <typename U> +@@ -30,10 +33,8 @@ class CheckedContiguousIterator { + + // Required for certain libc++ algorithm optimizations that are not available + // for NaCl. +-#if defined(_LIBCPP_VERSION) && !BUILDFLAG(IS_NACL) + template <typename Ptr> + friend struct std::pointer_traits; +-#endif + + constexpr CheckedContiguousIterator() = default; + +@@ -217,7 +218,6 @@ using CheckedContiguousConstIterator = CheckedContiguo + + } // namespace base + +-#if defined(_LIBCPP_VERSION) && !BUILDFLAG(IS_NACL) + // Specialize both std::__is_cpp17_contiguous_iterator and std::pointer_traits + // for CCI in case we compile with libc++ outside of NaCl. The former is + // required to enable certain algorithm optimizations (e.g. std::copy can be a +@@ -235,13 +235,35 @@ using CheckedContiguousConstIterator = CheckedContiguo + // [1] https://wg21.link/iterator.concept.contiguous + // [2] https://wg21.link/std.iterator.tags + // [3] https://wg21.link/pointer.traits.optmem +-namespace std { + ++#if defined(_LIBCPP_VERSION) ++ ++// TODO(crbug.com/1284275): Remove when C++20 is on by default, as the use ++// of `iterator_concept` above should suffice. ++_LIBCPP_BEGIN_NAMESPACE_STD ++ ++// TODO(crbug.com/1449299): https://reviews.llvm.org/D150801 renamed this from ++// `__is_cpp17_contiguous_iterator` to `__libcpp_is_contiguous_iterator`. Clean ++// up the old spelling after libc++ rolls. + template <typename T> ++struct __is_cpp17_contiguous_iterator; ++template <typename T> + struct __is_cpp17_contiguous_iterator<::base::CheckedContiguousIterator<T>> + : true_type {}; + + template <typename T> ++struct __libcpp_is_contiguous_iterator; ++template <typename T> ++struct __libcpp_is_contiguous_iterator<::base::CheckedContiguousIterator<T>> ++ : true_type {}; ++ ++_LIBCPP_END_NAMESPACE_STD ++ ++#endif ++ ++namespace std { ++ ++template <typename T> + struct pointer_traits<::base::CheckedContiguousIterator<T>> { + using pointer = ::base::CheckedContiguousIterator<T>; + using element_type = T; +@@ -260,6 +282,5 @@ struct pointer_traits<::base::CheckedContiguousIterato + }; + + } // namespace std +-#endif + + #endif // BASE_CONTAINERS_CHECKED_ITERATORS_H_