Skip to content

Commit a14c98d

Browse files
committed
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
1 parent 7ac14e9 commit a14c98d

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
--- a/usr/include/c++/12/bits/stl_algobase.h
2+
+++ b/usr/include/c++/12/bits/stl_algobase.h
3+
@@ -1778,11 +1778,14 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
4+
}
5+
6+
#if __cpp_lib_three_way_comparison
7+
- // Iter points to a contiguous range of unsigned narrow character type
8+
- // or std::byte, suitable for comparison by memcmp.
9+
- template<typename _Iter>
10+
- concept __is_byte_iter = contiguous_iterator<_Iter>
11+
- && __is_memcmp_ordered<iter_value_t<_Iter>>::__value;
12+
+ // Both iterators refer to contiguous ranges of unsigned narrow characters,
13+
+ // or std::byte, or big-endian unsigned integers, suitable for comparison
14+
+ // using memcmp.
15+
+ template<typename _Iter1, typename _Iter2>
16+
+ concept __memcmp_ordered_with
17+
+ = (__is_memcmp_ordered_with<iter_value_t<_Iter1>,
18+
+ iter_value_t<_Iter2>>::__value)
19+
+ && contiguous_iterator<_Iter1> && contiguous_iterator<_Iter2>;
20+
21+
// Return a struct with two members, initialized to the smaller of x and y
22+
// (or x if they compare equal) and the result of the comparison x <=> y.
23+
@@ -1832,20 +1832,20 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
24+
if (!std::__is_constant_evaluated())
25+
if constexpr (same_as<_Comp, __detail::_Synth3way>
26+
|| same_as<_Comp, compare_three_way>)
27+
- if constexpr (__is_byte_iter<_InputIter1>)
28+
- if constexpr (__is_byte_iter<_InputIter2>)
29+
- {
30+
- const auto [__len, __lencmp] = _GLIBCXX_STD_A::
31+
- __min_cmp(__last1 - __first1, __last2 - __first2);
32+
- if (__len)
33+
- {
34+
- const auto __c
35+
- = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
36+
- if (__c != 0)
37+
- return __c;
38+
- }
39+
- return __lencmp;
40+
- }
41+
+ if constexpr (__memcmp_ordered_with<_InputIter1, _InputIter2>)
42+
+ {
43+
+ const auto [__len, __lencmp] = _GLIBCXX_STD_A::
44+
+ __min_cmp(__last1 - __first1, __last2 - __first2);
45+
+ if (__len)
46+
+ {
47+
+ const auto __blen = __len * sizeof(*__first1);
48+
+ const auto __c
49+
+ = __builtin_memcmp(&*__first1, &*__first2, __blen) <=> 0;
50+
+ if (__c != 0)
51+
+ return __c;
52+
+ }
53+
+ return __lencmp;
54+
+ }
55+
56+
while (__first1 != __last1)
57+
{

ansible/roles/build-test-v8/tasks/partials/rhel8-s390x.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Newer V8 builds require Python 3.8, or later.
99
- name: install packages required to build V8
1010
ansible.builtin.dnf:
11-
name: ['GConf2-devel', 'python2', 'python2-pip', 'python39']
11+
name: ['GConf2-devel', 'python2', 'python2-pip', 'python39', 'patch']
1212
state: present
1313
notify: package updated
1414

@@ -35,3 +35,11 @@
3535
executable: pip-3
3636
name: ['httplib2', 'six']
3737
state: present
38+
39+
- name: temporary patch for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113960
40+
ansible.posix.patch:
41+
basedir: /opt/rh/gcc-toolset-12/root/
42+
ignore_whitespace: true
43+
src: gcc-bug-113960.patch
44+
strip: 1
45+
become: true

0 commit comments

Comments
 (0)