mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
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:
parent
e6c90a3048
commit
ee994832cf
3 changed files with 12 additions and 79 deletions
|
@ -31,16 +31,6 @@ symbol versioning, which our dynamic linker does not support.
|
||||||
- [X] Resolves issue(s) with our side of things
|
- [X] Resolves issue(s) with our side of things
|
||||||
- [ ] Hack
|
- [ ] 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`
|
## `toolchain.patch`
|
||||||
|
|
||||||
Adds support for the `$arch-pc-serenity` target to the Clang front end. This makes the compiler
|
Adds support for the `$arch-pc-serenity` target to the Clang front end. This makes the compiler
|
||||||
|
|
|
@ -99,3 +99,15 @@ index 8bd384ec7..a28e938ec 100644
|
||||||
// FIXME: Add TCP support for Windows.
|
// FIXME: Add TCP support for Windows.
|
||||||
return make_error<StringError>("-" + OutOfProcessExecutorConnect.ArgStr +
|
return make_error<StringError>("-" + OutOfProcessExecutorConnect.ArgStr +
|
||||||
" not supported on non-unix platforms",
|
" 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>
|
||||||
|
|
|
@ -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 =
|
|
Loading…
Add table
Add a link
Reference in a new issue