diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-06-26 20:55:06 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-30 12:34:16 +0100 |
commit | 010190beb88b72b8b1735760041d3cd44f7d32ce (patch) | |
tree | 4efa7162fc6bfe9c4dd12d725bc5d3a476a773ac /Toolchain/Patches/llvm | |
parent | efc1805b8f625ca727c781fe6e06f4d735d251ab (diff) | |
download | serenity-010190beb88b72b8b1735760041d3cd44f7d32ce.zip |
Toolchain: Remove workarounds for initializer_list and _aligned_alloc
These are no longer required to use libc++ on Serenity
Diffstat (limited to 'Toolchain/Patches/llvm')
-rw-r--r-- | Toolchain/Patches/llvm/0005-libc-Add-support-for-SerenityOS.patch | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/Toolchain/Patches/llvm/0005-libc-Add-support-for-SerenityOS.patch b/Toolchain/Patches/llvm/0005-libc-Add-support-for-SerenityOS.patch index d9e316a079..fda1e66841 100644 --- a/Toolchain/Patches/llvm/0005-libc-Add-support-for-SerenityOS.patch +++ b/Toolchain/Patches/llvm/0005-libc-Add-support-for-SerenityOS.patch @@ -10,24 +10,17 @@ LibC, namely: * The number of errno constants defined by us is given by the value of the `ELAST` macro. * Multithreading is implemented though the pthread library. -* Aligned memory allocation is provided by the MSVCRT-like - `_aligned_{malloc,free}` functions. - -Adds a hack for a header not found error when including -`<initializer_list>` inside the SerenityOS kernel. - -Makes libc++ use its builtin character type table instead of the one -provided by LibC as it is incomplete. +* Use libc++'s builtin character type table instead of the one provided + by LibC as there's a lot of extra porting work to convince the rest of + locale.cpp to use our character type table properly. --- libcxx/include/CMakeLists.txt | 1 + libcxx/include/__config | 6 ++++-- libcxx/include/__locale | 2 ++ libcxx/include/__support/serenity/xlocale.h | 24 +++++++++++++++++++++ - libcxx/include/initializer_list | 2 ++ libcxx/include/locale | 2 +- - libcxx/include/new | 4 ++-- libcxx/src/include/config_elast.h | 2 ++ - 8 files changed, 38 insertions(+), 5 deletions(-) + 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 libcxx/include/__support/serenity/xlocale.h diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt @@ -109,20 +102,6 @@ index 000000000..0f939d2f6 +#endif // __serenity__ + +#endif -diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list -index fefaf8cf8..c388bc246 100644 ---- a/libcxx/include/initializer_list -+++ b/libcxx/include/initializer_list -@@ -43,7 +43,9 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in - */ - - #include <__config> -+#if !defined(__serenity__) || !defined(KERNEL) - #include <cstddef> -+#endif - - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) - #pragma GCC system_header diff --git a/libcxx/include/locale b/libcxx/include/locale index 7c2d2361f..229ca7258 100644 --- a/libcxx/include/locale @@ -136,28 +115,6 @@ index 7c2d2361f..229ca7258 100644 # define _LIBCPP_HAS_CATOPEN 1 # include <nl_types.h> # endif -diff --git a/libcxx/include/new b/libcxx/include/new -index be0d972f4..d212bae46 100644 ---- a/libcxx/include/new -+++ b/libcxx/include/new -@@ -320,7 +320,7 @@ inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, s - // Returns the allocated memory, or `nullptr` on failure. - inline _LIBCPP_INLINE_VISIBILITY - void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) { --#if defined(_LIBCPP_MSVCRT_LIKE) -+#if defined(_LIBCPP_MSVCRT_LIKE) || (defined(__serenity__) && !defined(KERNEL)) - return ::_aligned_malloc(__size, __alignment); - #else - void* __result = nullptr; -@@ -332,7 +332,7 @@ void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) { - - inline _LIBCPP_INLINE_VISIBILITY - void __libcpp_aligned_free(void* __ptr) { --#if defined(_LIBCPP_MSVCRT_LIKE) -+#if defined(_LIBCPP_MSVCRT_LIKE) || (defined(__serenity__) && !defined(KERNEL)) - ::_aligned_free(__ptr); - #else - ::free(__ptr); diff --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h index 0ed53a3b2..7fffd937e 100644 --- a/libcxx/src/include/config_elast.h |