Skip to content

Commit

Permalink
Backport managarm/gcc@61271f4 into clang compat patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Sep 22, 2024
1 parent 34b801a commit 0d930af
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
mv toolchain/include/c++/* ${{matrix.target_arch}}/include
cp -rp ${{matrix.target_arch}}/include/${{matrix.target_arch}}-elf/* ${{matrix.target_arch}}/include/
rm -rf ${{matrix.target_arch}}/include/${{matrix.target_arch}}-elf
for f in patches/*; do \
( cd ${{matrix.target_arch}} && patch -p0 <../$f ); \
done
- name: Push
run: |
Expand Down
33 changes: 33 additions & 0 deletions patches/clang-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff '--color=auto' -urN include/atomic include-patched/atomic
--- include/atomic 2024-09-22 05:50:48.546122362 +0200
+++ include-patched/atomic 2024-09-22 05:59:15.115746337 +0200
@@ -1650,6 +1650,7 @@
using __atomic_float<double>::operator=;
};

+#if !(defined(__clang__) && !__STDC_HOSTED__) // clang in kernel context
template<>
struct atomic<long double> : __atomic_float<long double>
{
@@ -1664,6 +1665,7 @@

using __atomic_float<long double>::operator=;
};
+#endif

#ifdef __STDCPP_FLOAT16_T__
template<>
diff '--color=auto' -urN include/bits/stl_algobase.h include-patched/bits/stl_algobase.h
--- include/bits/stl_algobase.h 2024-09-22 05:50:48.546122362 +0200
+++ include-patched/bits/stl_algobase.h 2024-09-22 05:58:04.080067281 +0200
@@ -1072,8 +1072,10 @@
__size_to_integer(float __n) { return (long long)__n; }
inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(double __n) { return (long long)__n; }
+#if !(defined(__clang__) && !__STDC_HOSTED__) // clang in kernel context
inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(long double __n) { return (long long)__n; }
+#endif
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
__extension__ inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(__float128 __n) { return (long long)__n; }

0 comments on commit 0d930af

Please sign in to comment.