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.
This commit is contained in:
Tim Schumacher 2021-12-21 19:35:17 +01:00 committed by Brian Gianforcaro
parent e6c90a3048
commit ee994832cf
Notes: sideshowbarker 2024-07-17 22:24:26 +09:00
3 changed files with 12 additions and 79 deletions

View File

@ -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

View File

@ -99,3 +99,15 @@ index 8bd384ec7..a28e938ec 100644
// FIXME: Add TCP support for Windows.
return make_error<StringError>("-" + 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 <endian.h>
#elif defined(_AIX)
#include <sys/machine.h>

View File

@ -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 <endian.h>
#elif defined(_AIX)
#include <sys/machine.h>
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<wchar_t *>(ResultPtr) - &Result[0]);
+ Result.resize(reinterpret_cast<char *>(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<const UTF8 *>(Source.data());
const UTF8 *End =