Skip to content

Commit ff0da0b

Browse files
committed
ci: fix llvm 19 + libstdc++ build by patching the g++ library
1 parent 0483517 commit ff0da0b

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

.github/patches/gcc_14_2.diff

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From c9e05b03c18e898be604ab90401476e9c473cc52 Mon Sep 17 00:00:00 2001
2+
From: Jonathan Wakely <[email protected]>
3+
Date: Thu, 16 May 2024 17:15:55 +0100
4+
Subject: [PATCH] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator
5+
[PR115119]
6+
7+
libstdc++-v3/ChangeLog:
8+
9+
PR libstdc++/115119
10+
* include/bits/unicode.h (_Iterator::operator++(int)): Fix typo
11+
in increment expression.
12+
* testsuite/ext/unicode/grapheme_view.cc: Check post-increment
13+
on view's iterator.
14+
15+
Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=c9e05b03c18e898be604ab90401476e9c473cc52
16+
Modified paths, to make it work
17+
---
18+
bits/unicode.h | 6 ++++--
19+
1 files changed, 4 insertions(+), 2 deletions(-)
20+
21+
diff --git a/bits/unicode.h b/bits/unicode.h
22+
index 46238143fb61..a14a17c5dfcf 100644
23+
--- a/bits/unicode.h
24+
+++ b/bits/unicode.h
25+
@@ -34,10 +34,12 @@
26+
#include <array>
27+
#include <bit> // bit_width
28+
#include <charconv> // __detail::__from_chars_alnum_to_val_table
29+
+#include <string_view>
30+
#include <cstdint>
31+
#include <bits/stl_algo.h>
32+
#include <bits/stl_iterator.h>
33+
-#include <bits/ranges_base.h>
34+
+#include <bits/ranges_base.h> // iterator_t, sentinel_t, input_range, etc.
35+
+#include <bits/ranges_util.h> // view_interface
36+
37+
namespace std _GLIBCXX_VISIBILITY(default)
38+
{
39+
@@ -802,7 +804,7 @@ inline namespace __v15_1_0
40+
operator++(int)
41+
{
42+
auto __tmp = *this;
43+
- ++this;
44+
+ ++*this;
45+
return __tmp;
46+
}
47+

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,11 @@ jobs:
139139
echo "CC=clang-19" >> "$GITHUB_ENV"
140140
echo "CXX=clang++-19" >> "$GITHUB_ENV"
141141
echo "OBJC=clang-19" >> "$GITHUB_ENV"
142-
# Also install the newest g++ (For the libstd++ library)
143-
echo "deb http://archive.ubuntu.com/ubuntu/ oracular main" | sudo tee -a /etc/apt/sources.list.d/new_ubuntu.list
144-
sudo apt-get update
145-
sudo apt-get install libstdc++-14-dev -y --no-install-recommends
146-
sudo rm -rf /etc/apt/sources.list.d/new_ubuntu.list
147-
sudo apt-get update
142+
# Patch the libstd++ library, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115119
143+
# This is a dirty workaround, but it is needed, since gcc 14.2 (where this was patched usptream) is not easily available
144+
# If we use the oracular (Ubuntu 24.10) repos, we could install gcc 14.2, but clang-19 isn't compatible with that
145+
# TODO: remove this, after it works again
146+
sudo patch -p1 /usr/include/c++/14/bits/unicode.h .github/patches/gcc_14_2.diff
148147
149148
- name: Setup GCC (Linux)
150149
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == false

0 commit comments

Comments
 (0)