Skip to content

Commit

Permalink
ci: fix llvm 19 + libstdc++ build by patching the g++ library
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed Oct 1, 2024
1 parent 0483517 commit ff0da0b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
47 changes: 47 additions & 0 deletions .github/patches/gcc_14_2.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From c9e05b03c18e898be604ab90401476e9c473cc52 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <[email protected]>
Date: Thu, 16 May 2024 17:15:55 +0100
Subject: [PATCH] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator
[PR115119]

libstdc++-v3/ChangeLog:

PR libstdc++/115119
* include/bits/unicode.h (_Iterator::operator++(int)): Fix typo
in increment expression.
* testsuite/ext/unicode/grapheme_view.cc: Check post-increment
on view's iterator.

Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=c9e05b03c18e898be604ab90401476e9c473cc52
Modified paths, to make it work
---
bits/unicode.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bits/unicode.h b/bits/unicode.h
index 46238143fb61..a14a17c5dfcf 100644
--- a/bits/unicode.h
+++ b/bits/unicode.h
@@ -34,10 +34,12 @@
#include <array>
#include <bit> // bit_width
#include <charconv> // __detail::__from_chars_alnum_to_val_table
+#include <string_view>
#include <cstdint>
#include <bits/stl_algo.h>
#include <bits/stl_iterator.h>
-#include <bits/ranges_base.h>
+#include <bits/ranges_base.h> // iterator_t, sentinel_t, input_range, etc.
+#include <bits/ranges_util.h> // view_interface

namespace std _GLIBCXX_VISIBILITY(default)
{
@@ -802,7 +804,7 @@ inline namespace __v15_1_0
operator++(int)
{
auto __tmp = *this;
- ++this;
+ ++*this;
return __tmp;
}

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

0 comments on commit ff0da0b

Please sign in to comment.