diff --git a/riscv64/include/atomic b/riscv64/include/atomic index 1462cf5..a75baf3 100644 --- a/riscv64/include/atomic +++ b/riscv64/include/atomic @@ -1650,6 +1650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __atomic_float::operator=; }; +#if !(defined(__clang__) && !__STDC_HOSTED__) // clang in kernel context template<> struct atomic : __atomic_float { @@ -1664,6 +1665,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __atomic_float::operator=; }; +#endif #ifdef __STDCPP_FLOAT16_T__ template<> diff --git a/riscv64/include/bits/stl_algobase.h b/riscv64/include/bits/stl_algobase.h index d831e0e..f0fbf22 100644 --- a/riscv64/include/bits/stl_algobase.h +++ b/riscv64/include/bits/stl_algobase.h @@ -1072,8 +1072,10 @@ _GLIBCXX_END_NAMESPACE_CONTAINER __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; }