summaryrefslogtreecommitdiff
path: root/etc/patches
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2025-03-20 12:49:00 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2025-04-02 15:32:09 +0200
commite954e9e0d78413f32d8c11fcb2c96d17e157484b (patch)
tree9b614cb9692781931ed155ee23bec05c143da306 /etc/patches
parent9fb01463bf1e829e38ac2ec24eb474017ce6709f (diff)
downloadbootstrappable-toolchain-e954e9e0d78413f32d8c11fcb2c96d17e157484b.tar.gz
Add Clang 19.1.1
Diffstat (limited to 'etc/patches')
-rw-r--r--etc/patches/TARGETS1
-rw-r--r--etc/patches/clang-19/libcxx-musl-support.patch57
2 files changed, 58 insertions, 0 deletions
diff --git a/etc/patches/TARGETS b/etc/patches/TARGETS
index 6eab87b..f52388c 100644
--- a/etc/patches/TARGETS
+++ b/etc/patches/TARGETS
@@ -7,4 +7,5 @@
, "clang-16": {"type": "install", "deps": [["TREE", null, "clang-16"]]}
, "clang-17": {"type": "install", "deps": [["TREE", null, "clang-17"]]}
, "clang-18": {"type": "install", "deps": [["TREE", null, "clang-18"]]}
+, "clang-19": {"type": "install", "deps": [["TREE", null, "clang-19"]]}
}
diff --git a/etc/patches/clang-19/libcxx-musl-support.patch b/etc/patches/clang-19/libcxx-musl-support.patch
new file mode 100644
index 0000000..f19a221
--- /dev/null
+++ b/etc/patches/clang-19/libcxx-musl-support.patch
@@ -0,0 +1,57 @@
+From cfceef12ffa2963ffc32a0e2797dfc7e5ff7a2ac Mon Sep 17 00:00:00 2001
+From: Oliver Reiche <oliver.reiche@huawei.com>
+Date: Thu, 20 Mar 2025 12:05:42 +0200
+Subject: [PATCH] libcxx: Add musl support for __locale
+
+... which does not provide a known rune table and uses
+missing locale-based string to integer conversion functions.
+---
+ libcxx/include/__locale | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/libcxx/include/__locale b/libcxx/include/__locale
+index 3ba7ac1..98563b6 100644
+--- a/libcxx/include/__locale
++++ b/libcxx/include/__locale
+@@ -27,6 +27,38 @@
+ #include <cstddef>
+ #include <cstring>
+
++// Detect musl libc (inspired by musl detection from gcc's config.guess)
++#include <features.h>
++#if !(defined(__UCLIBC__) || defined(__dietlibc__) || defined(__GLIBC__))
++# include <stdarg.h>
++# ifdef __DEFINED_va_list
++# ifndef __MUSL_LIBC__
++# define __MUSL_LIBC__
++# endif
++# endif
++#endif
++
++#ifdef __MUSL_LIBC__
++// Fall back to default rune table for musl libc
++# ifndef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
++# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
++# endif
++// Implement missing strto*_l functions for musl libc
++# define __MUSL_LIBC_CREATE_STRTOX_L(X) \
++ static inline auto \
++ strto ## X ## _l(const char* str, char** end, int base, locale_t l) { \
++ locale_t old = uselocale(l); \
++ auto result = strto ## X(str, end, base); \
++ uselocale(old); \
++ return result; \
++ }
++__MUSL_LIBC_CREATE_STRTOX_L(l)
++__MUSL_LIBC_CREATE_STRTOX_L(ll)
++__MUSL_LIBC_CREATE_STRTOX_L(ul)
++__MUSL_LIBC_CREATE_STRTOX_L(ull)
++# undef __MUSL_LIBC_CREATE_STRTOX_L
++#endif
++
+ #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ # include <cwchar>
+ #else
+--
+2.30.2
+