From: Khem Raj Date: Thu, 21 Aug 2025 06:45:20 +0000 (-0700) Subject: lttng-tools: Fix build with libcxx runtime X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d66afee0a040e4417db774425297ca43497f5386;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git lttng-tools: Fix build with libcxx runtime Signed-off-by: Khem Raj Signed-off-by: Mathieu Dubois-Briand --- diff --git a/meta/recipes-kernel/lttng/lttng-tools/libc++.patch b/meta/recipes-kernel/lttng/lttng-tools/libc++.patch new file mode 100644 index 00000000000..be793c76992 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/libc++.patch @@ -0,0 +1,48 @@ +sessiond: avoid std::vector range-ctor on non-standard iterators (libc++) + +libc++ SFINAE-gates std::vector(It, It) behind standard iterator requirements. +The events_view/channels_ht_view iterators don’t model Input/Forward, so the +range constructor is not viable and the build fails under clang+libc++. +Populate the vectors via a simple loop instead, which only relies on !=, ++, +and dereference. No functional change; fixes clang/libc++ builds while keeping +libstdc++ behavior unchanged. + +Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/15163] +Signed-off-by: Khem Raj + +Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp +=================================================================== +--- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-channel.cpp ++++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp +@@ -529,8 +529,11 @@ void lsu::registry_channel::_accept_on_e + events_view(*_events->ht); + + /* Copy the event ptrs from the _events ht to this vector which we'll sort. */ +- std::vector sorted_event_classes( +- events_view.begin(), events_view.end()); ++ std::vector sorted_event_classes; ++ /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */ ++ for (auto it = events_view.begin(); it != events_view.end(); ++it) { ++ sorted_event_classes.push_back(*it); ++ } + + std::sort(sorted_event_classes.begin(), + sorted_event_classes.end(), +Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp +=================================================================== +--- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-session.cpp ++++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp +@@ -586,8 +586,11 @@ void lsu::registry_session::_accept_on_s + decltype(lsu::registry_channel::_node), + &lsu::registry_channel::_node> + channels_ht_view(*_channels->ht); +- std::vector sorted_stream_classes( +- channels_ht_view.begin(), channels_ht_view.end()); ++ std::vector sorted_stream_classes; ++ /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */ ++ for (auto it = channels_ht_view.begin(); it != channels_ht_view.end(); ++it) { ++ sorted_stream_classes.push_back(*it); ++ } + + std::sort(sorted_stream_classes.begin(), + sorted_stream_classes.end(), diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb index ed420384bf8..49575ef57cd 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb @@ -53,6 +53,7 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ file://0001-eventfd.cpp-Remove-the-scope-resolution-operator.patch \ file://disable-tests2.patch \ file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \ + file://libc++.patch \ " SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"