From ee994832cff6d00c824fd7d2a031dee991a6dd5a Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 21 Dec 2021 19:35:17 +0100 Subject: [PATCH] Ports: Remove wstring patch from LLVM One of the chunks in `remove-wstring.patch` was not wchar-related and has been moved to `insert-ifdef-serenity.patch` instead. --- Ports/llvm/patches/ReadMe.md | 10 --- .../llvm/patches/insert-ifdef-serenity.patch | 12 ++++ Ports/llvm/patches/remove-wstring.patch | 69 ------------------- 3 files changed, 12 insertions(+), 79 deletions(-) delete mode 100644 Ports/llvm/patches/remove-wstring.patch diff --git a/Ports/llvm/patches/ReadMe.md b/Ports/llvm/patches/ReadMe.md index 8d964da28ab..7192608b293 100644 --- a/Ports/llvm/patches/ReadMe.md +++ b/Ports/llvm/patches/ReadMe.md @@ -31,16 +31,6 @@ symbol versioning, which our dynamic linker does not support. - [X] Resolves issue(s) with our side of things - [ ] Hack -## `remove-wstring.patch` - -Removes `std::wstring`s from the source code, as our libstdc++ does not support it. - -### Status -- [ ] Local? -- [ ] Should be merged to upstream? -- [X] Resolves issue(s) with our side of things -- [X] Hack - ## `toolchain.patch` Adds support for the `$arch-pc-serenity` target to the Clang front end. This makes the compiler diff --git a/Ports/llvm/patches/insert-ifdef-serenity.patch b/Ports/llvm/patches/insert-ifdef-serenity.patch index 318382c0cdb..e1b16686d7c 100644 --- a/Ports/llvm/patches/insert-ifdef-serenity.patch +++ b/Ports/llvm/patches/insert-ifdef-serenity.patch @@ -99,3 +99,15 @@ index 8bd384ec7..a28e938ec 100644 // FIXME: Add TCP support for Windows. return make_error("-" + OutOfProcessExecutorConnect.ArgStr + " not supported on non-unix platforms", +diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h +--- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-04-06 19:38:18.000000000 +0300 ++++ llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-06-09 16:00:20.111549941 +0300 +@@ -22,7 +22,7 @@ + #endif + + #if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \ +- defined(__Fuchsia__) || defined(__EMSCRIPTEN__) ++ defined(__Fuchsia__) || defined(__EMSCRIPTEN__) || defined(__serenity__) + #include + #elif defined(_AIX) + #include diff --git a/Ports/llvm/patches/remove-wstring.patch b/Ports/llvm/patches/remove-wstring.patch deleted file mode 100644 index b40d8491203..00000000000 --- a/Ports/llvm/patches/remove-wstring.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h ---- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-04-06 19:38:18.000000000 +0300 -+++ llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-06-09 16:00:20.111549941 +0300 -@@ -22,7 +22,7 @@ - #endif - - #if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \ -- defined(__Fuchsia__) || defined(__EMSCRIPTEN__) -+ defined(__Fuchsia__) || defined(__EMSCRIPTEN__) || defined(__serenity__) - #include - #elif defined(_AIX) - #include -diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h ---- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h 2021-04-06 19:38:18.000000000 +0300 -+++ llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h 2021-06-09 16:04:10.069288846 +0300 -@@ -200,19 +200,19 @@ - * Converts a UTF-8 StringRef to a std::wstring. - * \return true on success. - */ --bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result); -+bool ConvertUTF8toWide(llvm::StringRef Source, std::string &Result); - - /** - * Converts a UTF-8 C-string to a std::wstring. - * \return true on success. - */ --bool ConvertUTF8toWide(const char *Source, std::wstring &Result); -+bool ConvertUTF8toWide(const char *Source, std::string &Result); - - /** - * Converts a std::wstring to a UTF-8 encoded std::string. - * \return true on success. - */ --bool convertWideToUTF8(const std::wstring &Source, std::string &Result); -+bool convertWideToUTF8(const std::string &Source, std::string &Result); - - - /** -diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp ---- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp 2021-04-06 19:38:18.000000000 +0300 -+++ llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp 2021-06-09 16:15:53.330400711 +0300 -@@ -196,15 +196,15 @@ - Result.clear(); - return false; - } -- Result.resize(reinterpret_cast(ResultPtr) - &Result[0]); -+ Result.resize(reinterpret_cast(ResultPtr) - &Result[0]); - return true; - } - --bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result) { -+bool ConvertUTF8toWide(llvm::StringRef Source, std::string &Result) { - return ConvertUTF8toWideInternal(Source, Result); - } - --bool ConvertUTF8toWide(const char *Source, std::wstring &Result) { -+bool ConvertUTF8toWide(const char *Source, std::string &Result) { - if (!Source) { - Result.clear(); - return true; -@@ -212,7 +212,7 @@ - return ConvertUTF8toWide(llvm::StringRef(Source), Result); - } - --bool convertWideToUTF8(const std::wstring &Source, std::string &Result) { -+bool convertWideToUTF8(const std::string &Source, std::string &Result) { - if (sizeof(wchar_t) == 1) { - const UTF8 *Start = reinterpret_cast(Source.data()); - const UTF8 *End =