diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2025-03-21 13:04:02 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2025-04-02 15:32:09 +0200 |
commit | 6d6a44d2d005cc76354565fa0cfde5699e7d96bc (patch) | |
tree | 63fac79a1cbe4e8e9481138dc7904ce941452162 /etc | |
parent | e954e9e0d78413f32d8c11fcb2c96d17e157484b (diff) | |
download | bootstrappable-toolchain-6d6a44d2d005cc76354565fa0cfde5699e7d96bc.tar.gz |
Add Clang 20.1.0
Diffstat (limited to 'etc')
-rw-r--r-- | etc/patches/TARGETS | 1 | ||||
-rw-r--r-- | etc/patches/clang-20/libcxx-musl-support.patch | 59 | ||||
-rw-r--r-- | etc/repos.json | 33 |
3 files changed, 92 insertions, 1 deletions
diff --git a/etc/patches/TARGETS b/etc/patches/TARGETS index f52388c..aacebe8 100644 --- a/etc/patches/TARGETS +++ b/etc/patches/TARGETS @@ -8,4 +8,5 @@ , "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"]]} +, "clang-20": {"type": "install", "deps": [["TREE", null, "clang-20"]]} } diff --git a/etc/patches/clang-20/libcxx-musl-support.patch b/etc/patches/clang-20/libcxx-musl-support.patch new file mode 100644 index 0000000..96cf13d --- /dev/null +++ b/etc/patches/clang-20/libcxx-musl-support.patch @@ -0,0 +1,59 @@ +From cfceef12ffa2963ffc32a0e2797dfc7e5ff7a2ac Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +Date: Fri, 21 Mar 2025 13:10:23 +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_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h +index c1e73ca..3ece532 100644 +--- a/libcxx/include/__locale_dir/locale_base_api.h ++++ b/libcxx/include/__locale_dir/locale_base_api.h +@@ -133,6 +133,40 @@ + # include <__locale_dir/locale_base_api/openbsd.h> + # elif defined(__wasi__) || _LIBCPP_HAS_MUSL_LIBC + # include <__locale_dir/locale_base_api/musl.h> ++# else ++ // 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__ ++# include <clocale> ++# include <cstdlib> ++ // 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 + # endif + + # include <__locale_dir/locale_base_api/bsd_locale_fallbacks.h> +-- +2.30.2 + diff --git a/etc/repos.json b/etc/repos.json index dab8c31..c77def8 100644 --- a/etc/repos.json +++ b/etc/repos.json @@ -510,6 +510,23 @@ , "iwyu": "iwyu-19" } } + , "compilers/clang-20.1.0-native": + { "repository": + { "type": "archive" + , "content": "459410a5cbe900b5653ead14ca39808f57d24f4f" + , "fetch": "https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-20.1.0.tar.gz" + , "sha256": "08bc382733777dda3c96259e3732ff96c1df98d0470c4f85b163274eae687f4f" + , "subdir": "llvm-project-llvmorg-20.1.0" + , "pragma": {"special": "resolve-partially"} + } + , "target_root": "compilers" + , "target_file_name": "clang-20-native.TARGETS" + , "bindings": + { "rules": "rules/clang_with_gcc14" + , "binutils": "imports/binutils-latest" + , "patches": "patches" + } + } , "tools/busybox-1.36.1": { "repository": { "type": "archive" @@ -606,7 +623,12 @@ , "clang-latest-native": { "repository": "toolchains" , "target_file_name": "clang.TARGETS" - , "bindings": {"rules": "rules", "clang": "compilers/clang-19.1.1-native"} + , "bindings": {"rules": "rules", "clang": "compilers/clang-20.1.0-native"} + } + , "clang-20.1.0-native": + { "repository": "toolchains" + , "target_file_name": "clang.TARGETS" + , "bindings": {"rules": "rules", "clang": "compilers/clang-20.1.0-native"} } , "clang-19.1.1-native": { "repository": "toolchains" @@ -751,6 +773,15 @@ , "compiler": "clang-latest-native" } } + , "clang-20.1.0-native+tools": + { "repository": "toolchains" + , "target_file_name": "compiler+tools.TARGETS" + , "bindings": + { "rules": "rules" + , "tools": "tools-all" + , "compiler": "clang-20.1.0-native" + } + } , "clang-19.1.1-native+tools": { "repository": "toolchains" , "target_file_name": "compiler+tools.TARGETS" |