Am 15.12.23 um 06:39 schrieb Rainer Hurling:
Am 15.12.23 um 00:53 schrieb Dimitry Andric:
On 14 Dec 2023, at 21:23, Dimitry Andric <d...@freebsd.org> wrote:

On 14 Dec 2023, at 20:49, Rainer Hurling <rhur...@gwdg.de> wrote:

On my FreeBSD 15.0-CURRENT amd64 boxes with clang 17 as base compiler I get:

===>  Building for electron25-25.9.8_1
ninja: Entering directory `out/Release'
[  0% 1/32805] c++ -MMD -MF obj/base/base/reentry_guard.o.d -DBASE_IMPLEMENTATION -DIS_RAW_PTR_IMPL -DSYSTEM_NATIVE_UTF8 -DUSE_SYMBOLIZE -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-DNO_UNWIND_TABLES -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DIS_MAS_BUILD\(\)=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DUSE_SYSTEM_LIBEVENT=1 -DGLOG_EXPORT= -DUSING_SYSTEM_ICU=1
-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_FINAL=final -DU_NOEXCEPT=noexcept -DU_OVERRIDE=override -DU_IMPORT=U_EXPORT -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/libevent_shim  -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim
-I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -msse3 -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare -Wexit-time-destructors -Wglobal-constructors -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/local/include -I/usr/local/include -std=c++20 -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -c ../../base/allocator/dispatcher/reentry_guard.cc -o obj/base/base/reentry_guard.o
FAILED: obj/base/base/reentry_guard.o
c++ -MMD -MF obj/base/base/reentry_guard.o.d -DBASE_IMPLEMENTATION -DIS_RAW_PTR_IMPL -DSYSTEM_NATIVE_UTF8 -DUSE_SYMBOLIZE -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES
-D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DIS_MAS_BUILD\(\)=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DUSE_SYSTEM_LIBEVENT=1 -DGLOG_EXPORT= -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_FINAL=final -DU_NOEXCEPT=noexcept -DU_OVERRIDE=override -DU_IMPORT=U_EXPORT -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/libevent_shim -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -m64 -msse3 -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare -Wexit-time-destructors -Wglobal-constructors -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/local/include -I/usr/local/include -std=c++20 -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -c ../../base/allocator/dispatcher/reentry_guard.cc -o obj/base/base/reentry_guard.o
In file included from ../../base/allocator/dispatcher/reentry_guard.cc:9:
In file included from ../../base/debug/crash_logging.h:16:
In file included from ../../base/strings/string_number_conversions.h:15:
In file included from ../../base/containers/span.h:19:
../../base/containers/checked_iterators.h:248:8: error: no template named '__is_cpp17_contiguous_iterator'; did you mean '__libcpp_is_contiguous_iterator'? 248 | 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<
     |        ^
1 error generated.
ninja: build stopped: subcommand failed.
*** Error code 1

This is the same problem that I fixed for qt6-webengine here:
https://cgit.freebsd.org/ports/commit/?id=660b01aa59ee1266ce0faf5718dc5c90abfa4f31 
<https://cgit.freebsd.org/ports/commit/?id=660b01aa59ee1266ce0faf5718dc5c90abfa4f31>

I'll take a look.

I haven't yet been able to build the port itself as my test machine is
swamped with jobs, but the patch from qt6-webengine applied without
fuzz. Can you please try the attached diff?

-Dimitry

It applies fine here, I am building now and will report back.

Many thanks so far!

The build and installation are ok, the updated electron25 seems usable, tested by updating editors/vscode :D

Attached you will find the almost same patch, but in the naming convention of ports, derived by 'make makepatch'.

BTW, do we also have to patch other electon versions?

Again, many thanks for your quick help.

Best wishes,
Rainer
--- base/containers/checked_iterators.h.orig	2023-08-12 07:07:10 UTC
+++ base/containers/checked_iterators.h
@@ -24,6 +24,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>
@@ -31,10 +34,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;
 
@@ -224,7 +225,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
@@ -242,13 +242,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;
@@ -267,6 +289,5 @@ struct pointer_traits<::base::CheckedContiguousIterato
 };
 
 }  // namespace std
-#endif
 
 #endif  // BASE_CONTAINERS_CHECKED_ITERATORS_H_

Reply via email to