diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-tools/libc++.patch')
| -rw-r--r-- | meta/recipes-kernel/lttng/lttng-tools/libc++.patch | 48 |
1 files changed, 48 insertions, 0 deletions
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 0000000000..be793c7699 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/libc++.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | sessiond: avoid std::vector range-ctor on non-standard iterators (libc++) | ||
| 2 | |||
| 3 | libc++ SFINAE-gates std::vector(It, It) behind standard iterator requirements. | ||
| 4 | The events_view/channels_ht_view iterators don’t model Input/Forward, so the | ||
| 5 | range constructor is not viable and the build fails under clang+libc++. | ||
| 6 | Populate the vectors via a simple loop instead, which only relies on !=, ++, | ||
| 7 | and dereference. No functional change; fixes clang/libc++ builds while keeping | ||
| 8 | libstdc++ behavior unchanged. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/15163] | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | |||
| 13 | Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp | ||
| 14 | =================================================================== | ||
| 15 | --- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-channel.cpp | ||
| 16 | +++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-channel.cpp | ||
| 17 | @@ -529,8 +529,11 @@ void lsu::registry_channel::_accept_on_e | ||
| 18 | events_view(*_events->ht); | ||
| 19 | |||
| 20 | /* Copy the event ptrs from the _events ht to this vector which we'll sort. */ | ||
| 21 | - std::vector<const lttng::sessiond::ust::registry_event *> sorted_event_classes( | ||
| 22 | - events_view.begin(), events_view.end()); | ||
| 23 | + std::vector<const lttng::sessiond::ust::registry_event *> sorted_event_classes; | ||
| 24 | + /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */ | ||
| 25 | + for (auto it = events_view.begin(); it != events_view.end(); ++it) { | ||
| 26 | + sorted_event_classes.push_back(*it); | ||
| 27 | + } | ||
| 28 | |||
| 29 | std::sort(sorted_event_classes.begin(), | ||
| 30 | sorted_event_classes.end(), | ||
| 31 | Index: lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp | ||
| 32 | =================================================================== | ||
| 33 | --- lttng-tools-2.14.0.orig/src/bin/lttng-sessiond/ust-registry-session.cpp | ||
| 34 | +++ lttng-tools-2.14.0/src/bin/lttng-sessiond/ust-registry-session.cpp | ||
| 35 | @@ -586,8 +586,11 @@ void lsu::registry_session::_accept_on_s | ||
| 36 | decltype(lsu::registry_channel::_node), | ||
| 37 | &lsu::registry_channel::_node> | ||
| 38 | channels_ht_view(*_channels->ht); | ||
| 39 | - std::vector<const lttng::sessiond::ust::registry_channel *> sorted_stream_classes( | ||
| 40 | - channels_ht_view.begin(), channels_ht_view.end()); | ||
| 41 | + std::vector<const lttng::sessiond::ust::registry_channel *> sorted_stream_classes; | ||
| 42 | + /* Avoid libc++’s range-ctor SFINAE on non-standard iterators. */ | ||
| 43 | + for (auto it = channels_ht_view.begin(); it != channels_ht_view.end(); ++it) { | ||
| 44 | + sorted_stream_classes.push_back(*it); | ||
| 45 | + } | ||
| 46 | |||
| 47 | std::sort(sorted_stream_classes.begin(), | ||
| 48 | sorted_stream_classes.end(), | ||
