-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ansible: temporarily patch libstdc++ header on s390x
As a stop-gap until gcc-toolset-12 in RHEL 8 is updated, manually patch the affected libstdc++ header file. Refs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113960
- Loading branch information
1 parent
7ac14e9
commit a9e2757
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- a/usr/include/c++/12/bits/stl_algobase.h | ||
+++ b/usr/include/c++/12/bits/stl_algobase.h | ||
@@ -1778,11 +1778,14 @@ | ||
} | ||
|
||
#if __cpp_lib_three_way_comparison | ||
- // Iter points to a contiguous range of unsigned narrow character type | ||
- // or std::byte, suitable for comparison by memcmp. | ||
- template<typename _Iter> | ||
- concept __is_byte_iter = contiguous_iterator<_Iter> | ||
- && __is_memcmp_ordered<iter_value_t<_Iter>>::__value; | ||
+ // Both iterators refer to contiguous ranges of unsigned narrow characters, | ||
+ // or std::byte, or big-endian unsigned integers, suitable for comparison | ||
+ // using memcmp. | ||
+ template<typename _Iter1, typename _Iter2> | ||
+ concept __memcmp_ordered_with | ||
+ = (__is_memcmp_ordered_with<iter_value_t<_Iter1>, | ||
+ iter_value_t<_Iter2>>::__value) | ||
+ && contiguous_iterator<_Iter1> && contiguous_iterator<_Iter2>; | ||
|
||
// Return a struct with two members, initialized to the smaller of x and y | ||
// (or x if they compare equal) and the result of the comparison x <=> y. | ||
@@ -1832,20 +1835,20 @@ | ||
if (!std::__is_constant_evaluated()) | ||
if constexpr (same_as<_Comp, __detail::_Synth3way> | ||
|| same_as<_Comp, compare_three_way>) | ||
- if constexpr (__is_byte_iter<_InputIter1>) | ||
- if constexpr (__is_byte_iter<_InputIter2>) | ||
- { | ||
- const auto [__len, __lencmp] = _GLIBCXX_STD_A:: | ||
- __min_cmp(__last1 - __first1, __last2 - __first2); | ||
- if (__len) | ||
- { | ||
- const auto __c | ||
- = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0; | ||
- if (__c != 0) | ||
- return __c; | ||
- } | ||
- return __lencmp; | ||
- } | ||
+ if constexpr (__memcmp_ordered_with<_InputIter1, _InputIter2>) | ||
+ { | ||
+ const auto [__len, __lencmp] = _GLIBCXX_STD_A:: | ||
+ __min_cmp(__last1 - __first1, __last2 - __first2); | ||
+ if (__len) | ||
+ { | ||
+ const auto __blen = __len * sizeof(*__first1); | ||
+ const auto __c | ||
+ = __builtin_memcmp(&*__first1, &*__first2, __blen) <=> 0; | ||
+ if (__c != 0) | ||
+ return __c; | ||
+ } | ||
+ return __lencmp; | ||
+ } | ||
|
||
while (__first1 != __last1) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters