mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Ports: Add a cmake port
Yes, you build this *inside* serenity.
This commit is contained in:
parent
bb777459a0
commit
80d6f46d4e
Notes:
sideshowbarker
2024-07-18 22:14:35 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/80d6f46d4e2 Pull-request: https://github.com/SerenityOS/serenity/pull/5325 Issue: https://github.com/SerenityOS/serenity/issues/90 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/sunverwerth
32 changed files with 9490 additions and 0 deletions
|
@ -9,6 +9,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
|
|||
| [`binutils`](binutils/) | GNU Binutils | 2.32 | https://www.gnu.org/software/binutils/ |
|
||||
| [`byacc`](byacc/) | Berkeley Yacc | 20191125 | https://invisible-island.net/byacc/byacc.html |
|
||||
| [`c-ray`](c-ray/) | C-Ray | | https://github.com/vkoskiv/c-ray |
|
||||
| [`cmake`](cmake/) | CMake | 3.19.4 | https://cmake.org/ |
|
||||
| [`curl`](curl/) | curl | 7.65.3 | https://curl.se/ |
|
||||
| [`dash`](dash/) | DASH | 0.5.10.2 | http://gondor.apana.org.au/~herbert/dash |
|
||||
| [`diffutils`](diffutils/) | GNU Diffutils | 3.5 | https://www.gnu.org/software/diffutils/ |
|
||||
|
|
40
Ports/cmake/howto.md
Normal file
40
Ports/cmake/howto.md
Normal file
|
@ -0,0 +1,40 @@
|
|||
## Build Guide
|
||||
|
||||
- Run `./package.sh` here, which should install the dependencies and copy the patched source code to `~anon/Source/cmake`
|
||||
- Give the vm at least 2G of RAM, and at least 1.5G of free disk space (actual values used may be different, but ~1.3GiB of RAM and 1.2GiB of disk space has been observed)
|
||||
- Build the bootstrap cmake binary:
|
||||
```sh
|
||||
$ cd Source/cmake
|
||||
$ ./bootstrap
|
||||
```
|
||||
- Go entertain yourself for a few minutes (build takes about 10m)
|
||||
- The bootstrap binary should be built, but may fail for any of the reasons detailed in [Troubleshooting](#troubleshooting).
|
||||
- Build and install cmake (this takes a long time, about 80 minutes on my machine)
|
||||
```sh
|
||||
$ make
|
||||
# mount -o bind /usr /usr
|
||||
# make install
|
||||
```
|
||||
- Optionally, add `/usr/local/bin` to PATH:
|
||||
```sh
|
||||
$ export PATH="$PATH:/usr/local/bin"
|
||||
```
|
||||
- Hopefully look back at the experience and laugh at its ease
|
||||
|
||||
## Current Status
|
||||
|
||||
Fully working :P
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Failed to open check cache file for write..." while bootstrap cmake is configuring cmake
|
||||
|
||||
The cause for this is unknown, but it seems to be a transitive state; simply restarting the bootstrap process fixes it:
|
||||
```sh
|
||||
$ Bootstrap.cmk/cmake . -C Bootstrap.cmk/InitialCacheFlags.cmake -G 'Unix Makefiles' -DCMAKE_BOOTSTRAP=1 -DBUILD_TESTING=0
|
||||
```
|
||||
You might have to repeat this many times.
|
||||
|
||||
### "unable to rename '...', reason: File already exists" while making cmake
|
||||
|
||||
Cause unknown. re-running make made it go away.
|
33
Ports/cmake/package.sh
Executable file
33
Ports/cmake/package.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port=cmake
|
||||
version=3.19.4
|
||||
useconfigure=false
|
||||
files="https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version.tar.gz cmake-$version.tar.gz"
|
||||
depends="bash gcc make sed"
|
||||
|
||||
port_path=$(realpath $(dirname ${BASH_SOURCE[0]}))
|
||||
|
||||
build() {
|
||||
return
|
||||
}
|
||||
|
||||
install() {
|
||||
cmake_dir="${SERENITY_ROOT}/Build/Root/home/anon/Source/cmake"
|
||||
run rm -rf "$cmake_dir"
|
||||
run mkdir -p "$cmake_dir"
|
||||
run cp -r . "$cmake_dir"
|
||||
}
|
||||
|
||||
post_install() {
|
||||
echo +===================================================================
|
||||
echo "| Successfully prepared the sources for cmake v$version!"
|
||||
echo "| The other half of the install has to be done inside serenity"
|
||||
echo "| to continue, re-image and run the vm, then do the following:"
|
||||
echo '| '
|
||||
echo '| $ cd Source/cmake'
|
||||
echo '| $ ./bootstrap'
|
||||
echo '| $ make && make install'
|
||||
echo '| '
|
||||
echo "| (These instructions are also available in $port_path/howto.md)"
|
||||
echo +===================================================================
|
||||
}
|
6873
Ports/cmake/patches/0000-no_wide_string.patch
Normal file
6873
Ports/cmake/patches/0000-no_wide_string.patch
Normal file
File diff suppressed because it is too large
Load diff
62
Ports/cmake/patches/0002-stoi-atoi.patch
Normal file
62
Ports/cmake/patches/0002-stoi-atoi.patch
Normal file
|
@ -0,0 +1,62 @@
|
|||
From f9a88260a01aff91971ca88030b74e916a5daa39 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 19:25:37 +0330
|
||||
Subject: [PATCH 02/11] stoi -> atoi
|
||||
|
||||
---
|
||||
Source/cmForEachCommand.cxx | 2 +-
|
||||
Source/cmStandardLevelResolver.cxx | 4 ++--
|
||||
Source/cmVSSetupHelper.cxx | 2 +-
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
|
||||
index bcacb15..c74cbdb 100644
|
||||
--- a/Source/cmForEachCommand.cxx
|
||||
+++ b/Source/cmForEachCommand.cxx
|
||||
@@ -359,7 +359,7 @@ bool HandleInMode(std::vector<std::string> const& args,
|
||||
bool TryParseInteger(cmExecutionStatus& status, const std::string& str, int& i)
|
||||
{
|
||||
try {
|
||||
- i = std::stoi(str);
|
||||
+ i = atoi((str).c_str());
|
||||
} catch (std::invalid_argument&) {
|
||||
std::ostringstream e;
|
||||
e << "Invalid integer: '" << str << "'";
|
||||
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
|
||||
index 8672f61..c418b09 100644
|
||||
--- a/Source/cmStandardLevelResolver.cxx
|
||||
+++ b/Source/cmStandardLevelResolver.cxx
|
||||
@@ -116,7 +116,7 @@ struct StanardLevelComputer
|
||||
int standardValue = -1;
|
||||
int defaultValue = -1;
|
||||
try {
|
||||
- standardValue = std::stoi(standardStr);
|
||||
+ standardValue = atoi((standardStr).c_str());
|
||||
defaultValue = std::stoi(*defaultStd);
|
||||
} catch (std::invalid_argument&) {
|
||||
// fall through as we want an error
|
||||
@@ -532,7 +532,7 @@ bool cmStandardLevelResolver::IsLaterStandard(std::string const& lang,
|
||||
{
|
||||
auto mapping = StandardComputerMapping.find(lang);
|
||||
if (mapping != cm::cend(StandardComputerMapping)) {
|
||||
- return mapping->second.IsLaterStandard(std::stoi(lhs), std::stoi(rhs));
|
||||
+ return mapping->second.IsLaterStandard(atoi((lhs).c_str()), atoi((rhs).c_str()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
|
||||
index 6aa0d15..a4dac5e 100644
|
||||
--- a/Source/cmVSSetupHelper.cxx
|
||||
+++ b/Source/cmVSSetupHelper.cxx
|
||||
@@ -318,7 +318,7 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
|
||||
chosenInstanceInfo.Version =
|
||||
std::string(envVSVersion.begin(), envVSVersion.end());
|
||||
chosenInstanceInfo.VCToolsetVersion = envVSVersion;
|
||||
- chosenInstanceInfo.ullVersion = std::stoi(envVSVersion);
|
||||
+ chosenInstanceInfo.ullVersion = atoi((envVSVersion).c_str());
|
||||
chosenInstanceInfo.IsWin10SDKInstalled = true;
|
||||
chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty();
|
||||
return true;
|
||||
--
|
||||
2.30.1
|
||||
|
122
Ports/cmake/patches/0003-stoi-atoi-2.patch
Normal file
122
Ports/cmake/patches/0003-stoi-atoi-2.patch
Normal file
|
@ -0,0 +1,122 @@
|
|||
From ba18f1f52135b3dc08e4c7889f214807ce6bb966 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 19:35:50 +0330
|
||||
Subject: [PATCH 03/11] stoi -> atoi 2
|
||||
|
||||
---
|
||||
Source/cmFileCommand.cxx | 2 +-
|
||||
Source/cmListCommand.cxx | 22 +++++++++++-----------
|
||||
Source/cmStandardLevelResolver.cxx | 8 ++++----
|
||||
3 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
|
||||
index 372179c..ea9631a 100644
|
||||
--- a/Source/cmFileCommand.cxx
|
||||
+++ b/Source/cmFileCommand.cxx
|
||||
@@ -3104,7 +3104,7 @@ bool HandleArchiveCreateCommand(std::vector<std::string> const& args,
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return false;
|
||||
}
|
||||
- compressionLevel = std::stoi(parsedArgs.CompressionLevel);
|
||||
+ compressionLevel = atoi((parsedArgs.CompressionLevel).c_str());
|
||||
if (compressionLevel < 0 || compressionLevel > 9) {
|
||||
status.SetError(cmStrCat("compression level ",
|
||||
parsedArgs.CompressionLevel,
|
||||
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
|
||||
index 687273e..a79074d 100644
|
||||
--- a/Source/cmListCommand.cxx
|
||||
+++ b/Source/cmListCommand.cxx
|
||||
@@ -901,12 +901,12 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
|
||||
// get all specified indexes
|
||||
std::vector<int> indexes;
|
||||
while (args.size() > ++index) {
|
||||
- std::size_t pos;
|
||||
+ char* pos;
|
||||
int value;
|
||||
|
||||
try {
|
||||
- value = std::stoi(args[index], &pos);
|
||||
- if (pos != args[index].length()) {
|
||||
+ value = strtol(args[index].c_str(), &pos, 10);
|
||||
+ if (pos != args[index].c_str() + args[index]) {
|
||||
// this is not a number, stop processing
|
||||
break;
|
||||
}
|
||||
@@ -944,15 +944,15 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
|
||||
int step = 1;
|
||||
bool valid = true;
|
||||
try {
|
||||
- std::size_t pos;
|
||||
+ char* pos;
|
||||
|
||||
- start = std::stoi(args[index], &pos);
|
||||
- if (pos != args[index].length()) {
|
||||
+ start = strtol(args[index].c_str(), &pos, 10);
|
||||
+ if (pos != args[index].c_str() + args[index].length()) {
|
||||
// this is not a number
|
||||
valid = false;
|
||||
} else {
|
||||
- stop = std::stoi(args[++index], &pos);
|
||||
- if (pos != args[index].length()) {
|
||||
+ start = strtol(args[++index].c_str(), &pos, 10);
|
||||
+ if (pos != args[index].c_str() + args[index].length()) {
|
||||
// this is not a number
|
||||
valid = false;
|
||||
}
|
||||
@@ -969,10 +969,10 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
|
||||
// try to read a third numeric value for step
|
||||
if (args.size() > ++index) {
|
||||
try {
|
||||
- std::size_t pos;
|
||||
+ char* pos;
|
||||
|
||||
- step = std::stoi(args[index], &pos);
|
||||
- if (pos != args[index].length()) {
|
||||
+ start = strtol(args[index].c_str(), &pos, 10);
|
||||
+ if (pos != args[index].c_str() + args[index].length()) {
|
||||
// this is not a number
|
||||
step = 1;
|
||||
} else {
|
||||
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
|
||||
index c418b09..50510e4 100644
|
||||
--- a/Source/cmStandardLevelResolver.cxx
|
||||
+++ b/Source/cmStandardLevelResolver.cxx
|
||||
@@ -117,7 +117,7 @@ struct StanardLevelComputer
|
||||
int defaultValue = -1;
|
||||
try {
|
||||
standardValue = atoi((standardStr).c_str());
|
||||
- defaultValue = std::stoi(*defaultStd);
|
||||
+ defaultValue = atoi((*defaultStd).c_str());
|
||||
} catch (std::invalid_argument&) {
|
||||
// fall through as we want an error
|
||||
// when we can't find the bad value in the `stds` vector
|
||||
@@ -195,7 +195,7 @@ struct StanardLevelComputer
|
||||
if (existingStandard) {
|
||||
existingLevelIter =
|
||||
std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
|
||||
- std::stoi(*existingStandard));
|
||||
+ atoi((*existingStandard).c_str()));
|
||||
if (existingLevelIter == cm::cend(this->Levels)) {
|
||||
const std::string e =
|
||||
cmStrCat("The ", this->Language, "_STANDARD property on target \"",
|
||||
@@ -240,7 +240,7 @@ struct StanardLevelComputer
|
||||
}
|
||||
// convert defaultStandard to an integer
|
||||
if (std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
|
||||
- std::stoi(*defaultStandard)) == cm::cend(this->Levels)) {
|
||||
+ atoi((*defaultStandard).c_str())) == cm::cend(this->Levels)) {
|
||||
const std::string e = cmStrCat("The CMAKE_", this->Language,
|
||||
"_STANDARD_DEFAULT variable contains an "
|
||||
"invalid value: \"",
|
||||
@@ -257,7 +257,7 @@ struct StanardLevelComputer
|
||||
|
||||
auto existingLevelIter =
|
||||
std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
|
||||
- std::stoi(*existingStandard));
|
||||
+ atoi((*existingStandard).c_str()));
|
||||
if (existingLevelIter == cm::cend(this->Levels)) {
|
||||
const std::string e =
|
||||
cmStrCat("The ", this->Language, "_STANDARD property on target \"",
|
||||
--
|
||||
2.30.1
|
||||
|
113
Ports/cmake/patches/0004-snprintf.patch
Normal file
113
Ports/cmake/patches/0004-snprintf.patch
Normal file
|
@ -0,0 +1,113 @@
|
|||
From a624e066281d23fe8d5e36768e15ddf847693179 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 21:04:56 +0330
|
||||
Subject: [PATCH 04/11] snprintf!
|
||||
|
||||
---
|
||||
Modules/FindCUDA/select_compute_arch.cmake | 2 +-
|
||||
Source/cmProjectCommand.cxx | 2 +-
|
||||
Source/cmStringAlgorithms.cxx | 2 +-
|
||||
Tests/RunCMake/Android/android.cxx | 2 +-
|
||||
Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 4 ++--
|
||||
Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 4 ++--
|
||||
6 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
|
||||
index 9351288..6b31fc2 100644
|
||||
--- a/Modules/FindCUDA/select_compute_arch.cmake
|
||||
+++ b/Modules/FindCUDA/select_compute_arch.cmake
|
||||
@@ -132,7 +132,7 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
|
||||
" {\n"
|
||||
" cudaDeviceProp prop;\n"
|
||||
" if (cudaSuccess == cudaGetDeviceProperties(&prop, device))\n"
|
||||
- " std::printf(\"%d.%d \", prop.major, prop.minor);\n"
|
||||
+ " printf(\"%d.%d \", prop.major, prop.minor);\n"
|
||||
" }\n"
|
||||
" return 0;\n"
|
||||
"}\n")
|
||||
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
|
||||
index f8678b9..05a76ad 100644
|
||||
--- a/Source/cmProjectCommand.cxx
|
||||
+++ b/Source/cmProjectCommand.cxx
|
||||
@@ -237,7 +237,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
|
||||
&v[2], &v[3]);
|
||||
for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) {
|
||||
if (int(i) < vc) {
|
||||
- std::sprintf(vb[i], "%u", v[i]);
|
||||
+ sprintf(vb[i], "%u", v[i]);
|
||||
version_string += &"."[std::size_t(i == 0)];
|
||||
version_string += vb[i];
|
||||
version_components[i] = vb[i];
|
||||
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx
|
||||
index e0af281..f0a50cc 100644
|
||||
--- a/Source/cmStringAlgorithms.cxx
|
||||
+++ b/Source/cmStringAlgorithms.cxx
|
||||
@@ -152,7 +152,7 @@ template <std::size_t N, typename T>
|
||||
inline void MakeDigits(cm::string_view& view, char (&digits)[N],
|
||||
const char* pattern, T value)
|
||||
{
|
||||
- int res = std::snprintf(digits, N, pattern, value);
|
||||
+ int res = snprintf(digits, N, pattern, value);
|
||||
if (res > 0 && res < static_cast<int>(N)) {
|
||||
view = cm::string_view(digits, static_cast<std::size_t>(res));
|
||||
}
|
||||
diff --git a/Tests/RunCMake/Android/android.cxx b/Tests/RunCMake/Android/android.cxx
|
||||
index a6d8c55..f47611e 100644
|
||||
--- a/Tests/RunCMake/Android/android.cxx
|
||||
+++ b/Tests/RunCMake/Android/android.cxx
|
||||
@@ -20,7 +20,7 @@ int main()
|
||||
{
|
||||
#if !defined(STL_NONE)
|
||||
// Require -lm implied by linking as C++.
|
||||
- std::printf("%p\n", static_cast<double (*)(double)>(&std::sin));
|
||||
+ printf("%p\n", static_cast<double (*)(double)>(&std::sin));
|
||||
#endif
|
||||
#if defined(STL_NONE)
|
||||
return 0;
|
||||
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
|
||||
index 6eeba0e..80389e5 100644
|
||||
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
|
||||
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
|
||||
@@ -24,7 +24,7 @@
|
||||
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
|
||||
#define snprintf sprintf_s
|
||||
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
|
||||
-#define snprintf std::snprintf
|
||||
+#define snprintf snprintf
|
||||
#else
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
@@ -32,7 +32,7 @@
|
||||
#define snprintf snprintf
|
||||
#elif __cplusplus >= 201103L
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
-#define snprintf std::snprintf
|
||||
+#define snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
|
||||
index fc86505..abaa661 100644
|
||||
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
|
||||
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
|
||||
@@ -50,7 +50,7 @@
|
||||
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
|
||||
#define snprintf sprintf_s
|
||||
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
|
||||
-#define snprintf std::snprintf
|
||||
+#define snprintf snprintf
|
||||
#else
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@
|
||||
#define snprintf snprintf
|
||||
#elif __cplusplus >= 201103L
|
||||
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
-#define snprintf std::snprintf
|
||||
+#define snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
--
|
||||
2.30.1
|
||||
|
207
Ports/cmake/patches/0005-stod.patch
Normal file
207
Ports/cmake/patches/0005-stod.patch
Normal file
|
@ -0,0 +1,207 @@
|
|||
From edc401ceb014f8ec5d80d3d2b7b7e9c1e86a27ed Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 21:22:45 +0330
|
||||
Subject: [PATCH 05/11] stod
|
||||
|
||||
---
|
||||
Help/guide/importing-exporting/Downstream/main.cc | 2 +-
|
||||
Help/guide/importing-exporting/DownstreamComponents/main.cc | 2 +-
|
||||
Help/guide/tutorial/Complete/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step10/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step11/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step12/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step2/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step3/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step4/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step5/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step6/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step7/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step8/tutorial.cxx | 2 +-
|
||||
Help/guide/tutorial/Step9/tutorial.cxx | 2 +-
|
||||
14 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/Help/guide/importing-exporting/Downstream/main.cc b/Help/guide/importing-exporting/Downstream/main.cc
|
||||
index 8574373..0956348 100644
|
||||
--- a/Help/guide/importing-exporting/Downstream/main.cc
|
||||
+++ b/Help/guide/importing-exporting/Downstream/main.cc
|
||||
@@ -12,7 +12,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// calculate square root
|
||||
const double sqrt = MathFunctions::sqrt(inputValue);
|
||||
diff --git a/Help/guide/importing-exporting/DownstreamComponents/main.cc b/Help/guide/importing-exporting/DownstreamComponents/main.cc
|
||||
index f5e8fa6..9f8be40 100644
|
||||
--- a/Help/guide/importing-exporting/DownstreamComponents/main.cc
|
||||
+++ b/Help/guide/importing-exporting/DownstreamComponents/main.cc
|
||||
@@ -13,7 +13,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// calculate square root
|
||||
const double sqrt = MathFunctions::sqrt(inputValue);
|
||||
diff --git a/Help/guide/tutorial/Complete/tutorial.cxx b/Help/guide/tutorial/Complete/tutorial.cxx
|
||||
index a4f44d5..06627a9 100644
|
||||
--- a/Help/guide/tutorial/Complete/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Complete/tutorial.cxx
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
||||
|
||||
diff --git a/Help/guide/tutorial/Step10/tutorial.cxx b/Help/guide/tutorial/Step10/tutorial.cxx
|
||||
index 37a0333..553f35a 100644
|
||||
--- a/Help/guide/tutorial/Step10/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step10/tutorial.cxx
|
||||
@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
||||
|
||||
diff --git a/Help/guide/tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx
|
||||
index a4f44d5..06627a9 100644
|
||||
--- a/Help/guide/tutorial/Step11/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step11/tutorial.cxx
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
||||
|
||||
diff --git a/Help/guide/tutorial/Step12/tutorial.cxx b/Help/guide/tutorial/Step12/tutorial.cxx
|
||||
index a4f44d5..06627a9 100644
|
||||
--- a/Help/guide/tutorial/Step12/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step12/tutorial.cxx
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
||||
|
||||
diff --git a/Help/guide/tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx
|
||||
index 53b0810..7ab6adb 100644
|
||||
--- a/Help/guide/tutorial/Step2/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step2/tutorial.cxx
|
||||
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// calculate square root
|
||||
const double outputValue = sqrt(inputValue);
|
||||
diff --git a/Help/guide/tutorial/Step3/tutorial.cxx b/Help/guide/tutorial/Step3/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step3/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step3/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step4/tutorial.cxx b/Help/guide/tutorial/Step4/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step4/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step4/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step5/tutorial.cxx b/Help/guide/tutorial/Step5/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step5/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step5/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step6/tutorial.cxx b/Help/guide/tutorial/Step6/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step6/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step6/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step7/tutorial.cxx b/Help/guide/tutorial/Step7/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step7/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step7/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step8/tutorial.cxx b/Help/guide/tutorial/Step8/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step8/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step8/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
diff --git a/Help/guide/tutorial/Step9/tutorial.cxx b/Help/guide/tutorial/Step9/tutorial.cxx
|
||||
index b3c6a4f..7bfb60b 100644
|
||||
--- a/Help/guide/tutorial/Step9/tutorial.cxx
|
||||
+++ b/Help/guide/tutorial/Step9/tutorial.cxx
|
||||
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// convert input to double
|
||||
- const double inputValue = std::stod(argv[1]);
|
||||
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
|
||||
|
||||
// which square root function should we use?
|
||||
#ifdef USE_MYMATH
|
||||
--
|
||||
2.30.1
|
||||
|
93
Ports/cmake/patches/0006-stoll.patch
Normal file
93
Ports/cmake/patches/0006-stoll.patch
Normal file
|
@ -0,0 +1,93 @@
|
|||
From fbb008a5185a002c89c2ce3c3b1cf15042635d91 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 21:24:11 +0330
|
||||
Subject: [PATCH 06/11] stoll
|
||||
|
||||
---
|
||||
Source/LexerParser/cmCTestResourceGroupsLexer.cxx | 4 ++--
|
||||
Source/LexerParser/cmCTestResourceGroupsLexer.in.l | 4 ++--
|
||||
Source/LexerParser/cmExprLexer.cxx | 4 ++--
|
||||
Source/LexerParser/cmExprLexer.in.l | 4 ++--
|
||||
4 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
|
||||
index de07c46..3f59b61 100644
|
||||
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
|
||||
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
|
||||
@@ -992,14 +992,14 @@ YY_RULE_SETUP
|
||||
{
|
||||
BEGIN(RESOURCE_GROUPS_END);
|
||||
- std::size_t len = yyleng;
|
||||
- yyextra->SetProcessCount(std::stoll(yytext, &len, 10));
|
||||
+ char* end = nullptr;
|
||||
+ yyextra->SetProcessCount(strtoll(yytext, &end, 10));
|
||||
}
|
||||
YY_BREAK
|
||||
case 3:
|
||||
YY_RULE_SETUP
|
||||
{
|
||||
BEGIN(RESOURCE_END);
|
||||
- std::size_t len = yyleng;
|
||||
- yyextra->SetNeededSlots(std::stoll(yytext, &len, 10));
|
||||
+ char* end = nullptr;
|
||||
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
|
||||
yyextra->WriteRequirement();
|
||||
}
|
||||
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
|
||||
index 2aabea4..ca5f3e5 100644
|
||||
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
|
||||
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
|
||||
@@ -55,13 +55,13 @@ IDENTIFIER [a-z_][a-z0-9_]*
|
||||
<INITIAL,RESOURCE_GROUPS_START>{NUMBER} {
|
||||
BEGIN(RESOURCE_GROUPS_END);
|
||||
- std::size_t len = yyleng;
|
||||
- yyextra->SetProcessCount(std::stoll(yytext, &len, 10));
|
||||
+ char* end = nullptr;
|
||||
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
|
||||
}
|
||||
|
||||
<RESOURCE_COUNT>{NUMBER} {
|
||||
BEGIN(RESOURCE_END);
|
||||
- std::size_t len = yyleng;
|
||||
- yyextra->SetNeededSlots(std::stoll(yytext, &len, 10));
|
||||
+ char* end = nullptr;
|
||||
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
|
||||
yyextra->WriteRequirement();
|
||||
}
|
||||
|
||||
diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx
|
||||
index 72e59b6..6b743e0 100644
|
||||
--- a/Source/LexerParser/cmExprLexer.cxx
|
||||
+++ b/Source/LexerParser/cmExprLexer.cxx
|
||||
@@ -992,11 +992,11 @@ YY_RULE_SETUP
|
||||
YY_BREAK
|
||||
case 2:
|
||||
YY_RULE_SETUP
|
||||
-{ yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; }
|
||||
+{ yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; }
|
||||
YY_BREAK
|
||||
case 3:
|
||||
YY_RULE_SETUP
|
||||
-{ yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; }
|
||||
+{ yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; }
|
||||
YY_BREAK
|
||||
case 4:
|
||||
YY_RULE_SETUP
|
||||
diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l
|
||||
index f8a4224..822aaf5 100644
|
||||
--- a/Source/LexerParser/cmExprLexer.in.l
|
||||
+++ b/Source/LexerParser/cmExprLexer.in.l
|
||||
@@ -44,8 +44,8 @@ Modify cmExprLexer.cxx:
|
||||
%%
|
||||
[ \t] {}
|
||||
|
||||
-[0-9][0-9]* { yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; }
|
||||
-0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; }
|
||||
+[0-9][0-9]* { yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; }
|
||||
+0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; }
|
||||
|
||||
"+" { return exp_PLUS; }
|
||||
"-" { return exp_MINUS; }
|
||||
--
|
||||
2.30.1
|
||||
|
145
Ports/cmake/patches/0007-utimes-utime.patch
Normal file
145
Ports/cmake/patches/0007-utimes-utime.patch
Normal file
|
@ -0,0 +1,145 @@
|
|||
From dc70b3830887eea5f28e3e626b4c4ef492d77ce0 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Thu, 11 Feb 2021 21:40:57 +0330
|
||||
Subject: [PATCH 07/11] utimes->utime
|
||||
|
||||
---
|
||||
Source/kwsys/CMakeLists.txt | 2 +-
|
||||
Source/kwsys/SystemTools.cxx | 4 ++--
|
||||
Source/kwsys/kwsysPlatformTestsCXX.cxx | 2 +-
|
||||
Utilities/cmlibarchive/CMakeLists.txt | 2 +-
|
||||
Utilities/cmlibarchive/build/cmake/config.h.in | 2 +-
|
||||
.../cmlibarchive/libarchive/archive_read_disk_posix.c | 2 +-
|
||||
.../cmlibarchive/libarchive/archive_write_disk_posix.c | 8 ++++----
|
||||
Utilities/cmlibuv/src/unix/fs.c | 2 +-
|
||||
8 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
|
||||
index 77adae2..52bc809 100644
|
||||
--- a/Source/kwsys/CMakeLists.txt
|
||||
+++ b/Source/kwsys/CMakeLists.txt
|
||||
@@ -431,7 +431,7 @@ if(KWSYS_USE_SystemTools)
|
||||
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
|
||||
"Checking whether CXX compiler has environ in stdlib.h" DIRECT)
|
||||
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMES
|
||||
- "Checking whether CXX compiler has utimes" DIRECT)
|
||||
+ "Checking whether CXX compiler has utime" DIRECT)
|
||||
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT
|
||||
"Checking whether CXX compiler has utimensat" DIRECT)
|
||||
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIM
|
||||
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
|
||||
index fbe7ed9..b0c6d5c 100644
|
||||
--- a/Source/kwsys/SystemTools.cxx
|
||||
+++ b/Source/kwsys/SystemTools.cxx
|
||||
@@ -1445,8 +1445,8 @@ bool SystemTools::Touch(const std::string& filename, bool create)
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
- // fall back to utimes
|
||||
- if (utimes(filename.c_str(), nullptr) < 0) {
|
||||
+ // fall back to utime
|
||||
+ if (utime(filename.c_str(), nullptr) < 0) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx
|
||||
index 195a461..f5f50b4 100644
|
||||
--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
|
||||
+++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
|
||||
@@ -82,7 +82,7 @@ int main()
|
||||
int main()
|
||||
{
|
||||
struct timeval* current_time = 0;
|
||||
- return utimes("/example", current_time);
|
||||
+ return utime("/example", current_time);
|
||||
}
|
||||
#endif
|
||||
|
||||
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
|
||||
index 9d6f9a2..c49043a 100644
|
||||
--- a/Utilities/cmlibarchive/CMakeLists.txt
|
||||
+++ b/Utilities/cmlibarchive/CMakeLists.txt
|
||||
@@ -1411,7 +1411,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(unlinkat HAVE_UNLINKAT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(unsetenv HAVE_UNSETENV)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME)
|
||||
-CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES)
|
||||
+CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIMES)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB)
|
||||
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
|
||||
index 4c746b7..2407b94 100644
|
||||
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
|
||||
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
|
||||
@@ -916,7 +916,7 @@
|
||||
/* Define to 1 if you have the `utimensat' function. */
|
||||
#cmakedefine HAVE_UTIMENSAT 1
|
||||
|
||||
-/* Define to 1 if you have the `utimes' function. */
|
||||
+/* Define to 1 if you have the `utime' function. */
|
||||
#cmakedefine HAVE_UTIMES 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
|
||||
index 6dd1fd9..2fa08d4 100644
|
||||
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
|
||||
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
|
||||
@@ -2043,7 +2043,7 @@ close_and_restore_time(int fd, struct tree *t, struct restore_time *rt)
|
||||
#ifdef HAVE_LUTIMES
|
||||
if (lutimes(rt->name, times) != 0)
|
||||
#else
|
||||
- if (AE_IFLNK != rt->filetype && utimes(rt->name, times) != 0)
|
||||
+ if (AE_IFLNK != rt->filetype && utime(rt->name, times) != 0)
|
||||
#endif
|
||||
return (-1);
|
||||
#endif
|
||||
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
|
||||
index 67da3e1..157e27a 100644
|
||||
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
|
||||
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
|
||||
@@ -3365,8 +3365,8 @@ set_time(int fd, int mode, const char *name,
|
||||
|
||||
#elif HAVE_UTIMES
|
||||
/*
|
||||
- * The utimes()-family functions support µs-resolution and
|
||||
- * setting times fds and symlinks. utimes() is documented as
|
||||
+ * The utime()-family functions support µs-resolution and
|
||||
+ * setting times fds and symlinks. utime() is documented as
|
||||
* LEGACY by POSIX, futimes() and lutimes() are not described
|
||||
* in POSIX.
|
||||
*/
|
||||
@@ -3389,7 +3389,7 @@ set_time(int fd, int mode, const char *name,
|
||||
#else
|
||||
if (S_ISLNK(mode))
|
||||
return (0);
|
||||
- return (utimes(name, times));
|
||||
+ return (utime(name, times));
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_UTIME)
|
||||
@@ -3477,7 +3477,7 @@ set_times(struct archive_write_disk *a,
|
||||
#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
|
||||
/*
|
||||
* If you have struct stat.st_birthtime, we assume BSD
|
||||
- * birthtime semantics, in which {f,l,}utimes() updates
|
||||
+ * birthtime semantics, in which {f,l,}utime() updates
|
||||
* birthtime to earliest mtime. So we set the time twice,
|
||||
* first using the birthtime, then using the mtime. If
|
||||
* birthtime == mtime, this isn't necessary, so we skip it.
|
||||
diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c
|
||||
index 6d57cee..48c0123 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/fs.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/fs.c
|
||||
@@ -1036,7 +1036,7 @@ static ssize_t uv__fs_utime(uv_fs_t* req) {
|
||||
struct timeval tv[2];
|
||||
tv[0] = uv__fs_to_timeval(req->atime);
|
||||
tv[1] = uv__fs_to_timeval(req->mtime);
|
||||
- return utimes(req->path, tv);
|
||||
+ return utime(req->path, tv);
|
||||
#elif defined(_AIX) \
|
||||
&& !defined(_AIX71)
|
||||
struct utimbuf buf;
|
||||
--
|
||||
2.30.1
|
||||
|
76
Ports/cmake/patches/0008-unix-stuff.patch
Normal file
76
Ports/cmake/patches/0008-unix-stuff.patch
Normal file
|
@ -0,0 +1,76 @@
|
|||
From d8b3a1a970d92d5e66a7caa3805a56c186027f44 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Fri, 12 Feb 2021 03:12:38 +0330
|
||||
Subject: [PATCH 08/11] unix stuff
|
||||
|
||||
---
|
||||
Utilities/cmlibuv/src/unix/core.c | 26 +++++++++++++++++++++++++-
|
||||
1 file changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Utilities/cmlibuv/src/unix/core.c b/Utilities/cmlibuv/src/unix/core.c
|
||||
index e6d61ee..f90d9a3 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/core.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/core.c
|
||||
@@ -578,6 +578,14 @@ int uv__close(int fd) {
|
||||
}
|
||||
|
||||
|
||||
+#if defined(_AIX) || \
|
||||
+ defined(__APPLE__) || \
|
||||
+ defined(__DragonFly__) || \
|
||||
+ defined(__FreeBSD__) || \
|
||||
+ defined(__FreeBSD_kernel__) || \
|
||||
+ defined(__linux__) || \
|
||||
+ defined(__OpenBSD__) || \
|
||||
+ defined(__NetBSD__)
|
||||
int uv__nonblock_ioctl(int fd, int set) {
|
||||
int r;
|
||||
|
||||
@@ -590,9 +598,18 @@ int uv__nonblock_ioctl(int fd, int set) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
|
||||
-#if !defined(__hpux) && !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__)
|
||||
+#if defined(_AIX) || \
|
||||
+ defined(__APPLE__) || \
|
||||
+ defined(__DragonFly__) || \
|
||||
+ defined(__FreeBSD__) || \
|
||||
+ defined(__FreeBSD_kernel__) || \
|
||||
+ defined(__linux__) || \
|
||||
+ defined(__OpenBSD__) || \
|
||||
+ defined(__NetBSD__)
|
||||
+
|
||||
int uv__cloexec_ioctl(int fd, int set) {
|
||||
int r;
|
||||
|
||||
@@ -1422,8 +1439,13 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) {
|
||||
if (priority == NULL)
|
||||
return UV_EINVAL;
|
||||
|
||||
+ /*
|
||||
errno = 0;
|
||||
r = getpriority(PRIO_PROCESS, (int) pid);
|
||||
+ */
|
||||
+
|
||||
+ errno = 0;
|
||||
+ r = 1;
|
||||
|
||||
if (r == -1 && errno != 0)
|
||||
return UV__ERR(errno);
|
||||
@@ -1437,8 +1459,10 @@ int uv_os_setpriority(uv_pid_t pid, int priority) {
|
||||
if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW)
|
||||
return UV_EINVAL;
|
||||
|
||||
+ /*
|
||||
if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0)
|
||||
return UV__ERR(errno);
|
||||
+ */
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.30.1
|
||||
|
199
Ports/cmake/patches/0009-purge-non-serenity-syscalls.patch
Normal file
199
Ports/cmake/patches/0009-purge-non-serenity-syscalls.patch
Normal file
|
@ -0,0 +1,199 @@
|
|||
From 6939797ada5dbf5545d857cc60cfd5a8ceddb0ae Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Fri, 12 Feb 2021 04:49:01 +0330
|
||||
Subject: [PATCH 09/11] purge non-serenity syscalls
|
||||
|
||||
very breaky!
|
||||
---
|
||||
Utilities/cmlibuv/src/unix/fs.c | 31 ++++++++++++++++++++++++++++
|
||||
Utilities/cmlibuv/src/unix/poll.c | 2 ++
|
||||
Utilities/cmlibuv/src/unix/process.c | 2 ++
|
||||
Utilities/cmlibuv/src/unix/stream.c | 3 +--
|
||||
4 files changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c
|
||||
index 48c0123..fd102a8 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/fs.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/fs.c
|
||||
@@ -85,6 +85,8 @@
|
||||
defined(__HAIKU__) || \
|
||||
defined(__QNX__)
|
||||
# include <sys/statvfs.h>
|
||||
+#elif defined(__serenity__)
|
||||
+// No statfs
|
||||
#else
|
||||
# include <sys/statfs.h>
|
||||
#endif
|
||||
@@ -540,7 +542,11 @@ static ssize_t uv__fs_scandir(uv_fs_t* req) {
|
||||
int n;
|
||||
|
||||
dents = NULL;
|
||||
+#ifndef __serenity__
|
||||
n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
|
||||
+#else
|
||||
+ n = 0;
|
||||
+#endif
|
||||
|
||||
/* NOTE: We will use nbufs as an index field */
|
||||
req->nbufs = 0;
|
||||
@@ -651,6 +657,9 @@ static int uv__fs_statfs(uv_fs_t* req) {
|
||||
struct statvfs buf;
|
||||
|
||||
if (0 != statvfs(req->path, &buf))
|
||||
+#elif defined(__serenity__)
|
||||
+ char buf = 0;
|
||||
+ if (1)
|
||||
#else
|
||||
struct statfs buf;
|
||||
|
||||
@@ -658,6 +667,7 @@ static int uv__fs_statfs(uv_fs_t* req) {
|
||||
#endif /* defined(__sun) */
|
||||
return -1;
|
||||
|
||||
+#if !defined(__serenity__)
|
||||
stat_fs = uv__malloc(sizeof(*stat_fs));
|
||||
if (stat_fs == NULL) {
|
||||
errno = ENOMEM;
|
||||
@@ -681,6 +691,7 @@ static int uv__fs_statfs(uv_fs_t* req) {
|
||||
stat_fs->f_files = buf.f_files;
|
||||
stat_fs->f_ffree = buf.f_ffree;
|
||||
req->ptr = stat_fs;
|
||||
+#endif // !defined(__serenity__)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1107,7 +1118,11 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
|
||||
r = writev(req->file, (struct iovec*) req->bufs, req->nbufs);
|
||||
} else {
|
||||
if (req->nbufs == 1) {
|
||||
+# if defined(__serenity__)
|
||||
+ r = -1;
|
||||
+# else
|
||||
r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
|
||||
+# endif
|
||||
goto done;
|
||||
}
|
||||
#if HAVE_PREADV
|
||||
@@ -1117,7 +1132,11 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
|
||||
if (no_pwritev) retry:
|
||||
# endif
|
||||
{
|
||||
+# if defined(__serenity__)
|
||||
+ r = -1;
|
||||
+# else
|
||||
r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
|
||||
+# endif
|
||||
}
|
||||
# if defined(__linux__)
|
||||
else {
|
||||
@@ -1604,7 +1623,9 @@ static void uv__fs_work(struct uv__work* w) {
|
||||
X(COPYFILE, uv__fs_copyfile(req));
|
||||
X(FCHMOD, fchmod(req->file, req->mode));
|
||||
X(FCHOWN, fchown(req->file, req->uid, req->gid));
|
||||
+#ifndef __serenity__
|
||||
X(LCHOWN, lchown(req->path, req->uid, req->gid));
|
||||
+#endif
|
||||
X(FDATASYNC, uv__fs_fdatasync(req));
|
||||
X(FSTAT, uv__fs_fstat(req->file, &req->statbuf));
|
||||
X(FSYNC, uv__fs_fsync(req));
|
||||
@@ -1618,7 +1639,9 @@ static void uv__fs_work(struct uv__work* w) {
|
||||
X(MKSTEMP, uv__fs_mkstemp(req));
|
||||
X(OPEN, uv__fs_open(req));
|
||||
X(READ, uv__fs_read(req));
|
||||
+#ifndef __serenity__
|
||||
X(SCANDIR, uv__fs_scandir(req));
|
||||
+#endif
|
||||
X(OPENDIR, uv__fs_opendir(req));
|
||||
X(READDIR, uv__fs_readdir(req));
|
||||
X(CLOSEDIR, uv__fs_closedir(req));
|
||||
@@ -1628,7 +1651,9 @@ static void uv__fs_work(struct uv__work* w) {
|
||||
X(RMDIR, rmdir(req->path));
|
||||
X(SENDFILE, uv__fs_sendfile(req));
|
||||
X(STAT, uv__fs_stat(req->path, &req->statbuf));
|
||||
+#ifndef __serenity__
|
||||
X(STATFS, uv__fs_statfs(req));
|
||||
+#endif
|
||||
X(SYMLINK, symlink(req->path, req->new_path));
|
||||
X(UNLINK, unlink(req->path));
|
||||
X(UTIME, uv__fs_utime(req));
|
||||
@@ -1743,7 +1768,9 @@ int uv_fs_lchown(uv_loop_t* loop,
|
||||
uv_uid_t uid,
|
||||
uv_gid_t gid,
|
||||
uv_fs_cb cb) {
|
||||
+#ifndef __serenity__
|
||||
INIT(LCHOWN);
|
||||
+#endif
|
||||
PATH;
|
||||
req->uid = uid;
|
||||
req->gid = gid;
|
||||
@@ -1912,7 +1939,9 @@ int uv_fs_scandir(uv_loop_t* loop,
|
||||
const char* path,
|
||||
int flags,
|
||||
uv_fs_cb cb) {
|
||||
+#ifndef __serenity__
|
||||
INIT(SCANDIR);
|
||||
+#endif
|
||||
PATH;
|
||||
req->flags = flags;
|
||||
POST;
|
||||
@@ -2134,7 +2163,9 @@ int uv_fs_statfs(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
uv_fs_cb cb) {
|
||||
+#ifndef __serenity__
|
||||
INIT(STATFS);
|
||||
+#endif
|
||||
PATH;
|
||||
POST;
|
||||
}
|
||||
diff --git a/Utilities/cmlibuv/src/unix/poll.c b/Utilities/cmlibuv/src/unix/poll.c
|
||||
index 3d5022b..721423f 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/poll.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/poll.c
|
||||
@@ -79,9 +79,11 @@ int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {
|
||||
* Workaround for e.g. kqueue fds not supporting ioctls.
|
||||
*/
|
||||
err = uv__nonblock(fd, 1);
|
||||
+#ifndef __serenity__
|
||||
if (err == UV_ENOTTY)
|
||||
if (uv__nonblock == uv__nonblock_ioctl)
|
||||
err = uv__nonblock_fcntl(fd, 1);
|
||||
+#endif
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c
|
||||
index 08aa2f3..135260f 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/process.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/process.c
|
||||
@@ -129,6 +129,8 @@ static int uv__make_socketpair(int fds[2]) {
|
||||
return UV__ERR(errno);
|
||||
|
||||
return 0;
|
||||
+#elif defined(__serenity__)
|
||||
+ return UV__ERR(ENOTSUP);
|
||||
#else
|
||||
int err;
|
||||
|
||||
diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c
|
||||
index 3b6da8d..3e2ed5e 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/stream.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/stream.c
|
||||
@@ -985,13 +985,12 @@ uv_handle_type uv__handle_type(int fd) {
|
||||
case AF_UNIX:
|
||||
return UV_NAMED_PIPE;
|
||||
case AF_INET:
|
||||
- case AF_INET6:
|
||||
return UV_TCP;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == SOCK_DGRAM &&
|
||||
- (ss.ss_family == AF_INET || ss.ss_family == AF_INET6))
|
||||
+ (ss.ss_family == AF_INET))
|
||||
return UV_UDP;
|
||||
|
||||
return UV_UNKNOWN_HANDLE;
|
||||
--
|
||||
2.30.1
|
||||
|
48
Ports/cmake/patches/0010-don-t-use-siginfo.patch
Normal file
48
Ports/cmake/patches/0010-don-t-use-siginfo.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
From 6db96fa8e9a0519894326d0a64b72313a5879fd9 Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Fri, 12 Feb 2021 13:42:50 +0330
|
||||
Subject: [PATCH 10/11] don't use siginfo
|
||||
|
||||
---
|
||||
Source/kwsys/ProcessUNIX.c | 2 +-
|
||||
Source/kwsys/SystemInformation.cxx | 4 ++--
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
|
||||
index a24b773..cbf137b 100644
|
||||
--- a/Source/kwsys/ProcessUNIX.c
|
||||
+++ b/Source/kwsys/ProcessUNIX.c
|
||||
@@ -105,7 +105,7 @@ static inline void kwsysProcess_usleep(unsigned int msec)
|
||||
#endif
|
||||
|
||||
/* Some platforms do not have siginfo on their signal handlers. */
|
||||
-#if defined(SA_SIGINFO) && !defined(__BEOS__)
|
||||
+#if defined(SA_SIGINFO) && !defined(__BEOS__) && !defined(__serenity__)
|
||||
# define KWSYSPE_USE_SIGINFO 1
|
||||
#endif
|
||||
|
||||
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
|
||||
index 1384dbe..18f03fb 100644
|
||||
--- a/Source/kwsys/SystemInformation.cxx
|
||||
+++ b/Source/kwsys/SystemInformation.cxx
|
||||
@@ -990,7 +990,7 @@ int GetFieldsFromCommand(const char* command, const char** fieldNames,
|
||||
#endif
|
||||
|
||||
// ****************************************************************************
|
||||
-#if !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
+#if !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__serenity__)
|
||||
void StacktraceSignalHandler(int sigNo, siginfo_t* sigInfo,
|
||||
void* /*sigContext*/)
|
||||
{
|
||||
@@ -3965,7 +3965,7 @@ when set print stack trace in response to common signals.
|
||||
*/
|
||||
void SystemInformationImplementation::SetStackTraceOnError(int enable)
|
||||
{
|
||||
-#if !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
+#if !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__serenity__)
|
||||
static int saOrigValid = 0;
|
||||
static struct sigaction saABRTOrig;
|
||||
static struct sigaction saSEGVOrig;
|
||||
--
|
||||
2.30.1
|
||||
|
39
Ports/cmake/patches/0011-Fixed-your-code-rot-cmake.patch
Normal file
39
Ports/cmake/patches/0011-Fixed-your-code-rot-cmake.patch
Normal file
|
@ -0,0 +1,39 @@
|
|||
From fd44bfe91d4b17c20c8028d60fe73e016879e73b Mon Sep 17 00:00:00 2001
|
||||
From: AnotherTest <ali.mpfard@gmail.com>
|
||||
Date: Fri, 12 Feb 2021 13:59:50 +0330
|
||||
Subject: [PATCH 11/11] Fixed your code rot, cmake
|
||||
|
||||
---
|
||||
Source/kwsys/ProcessUNIX.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
|
||||
index cbf137b..65bf129 100644
|
||||
--- a/Source/kwsys/ProcessUNIX.c
|
||||
+++ b/Source/kwsys/ProcessUNIX.c
|
||||
@@ -2890,10 +2890,10 @@ static void kwsysProcessesSignalHandler(int signum
|
||||
/* Re-Install our handler. Repeat call until it is not interrupted. */
|
||||
{
|
||||
struct sigaction newSigAction;
|
||||
- struct sigaction& oldSigAction;
|
||||
+ struct sigaction* oldSigAction;
|
||||
memset(&newSigAction, 0, sizeof(struct sigaction));
|
||||
- newSigChldAction.sa_handler = kwsysProcessesSignalHandler;
|
||||
- newSigChldAction.sa_flags = SA_NOCLDSTOP;
|
||||
+ newSigAction.sa_handler = kwsysProcessesSignalHandler;
|
||||
+ newSigAction.sa_flags = SA_NOCLDSTOP;
|
||||
sigemptyset(&newSigAction.sa_mask);
|
||||
switch (signum) {
|
||||
case SIGCHLD:
|
||||
@@ -2908,7 +2908,7 @@ static void kwsysProcessesSignalHandler(int signum
|
||||
oldSigAction = &kwsysProcessesOldSigTermAction;
|
||||
break;
|
||||
default:
|
||||
- return 0;
|
||||
+ return;
|
||||
}
|
||||
while ((sigaction(signum, &newSigAction, oldSigAction) < 0) &&
|
||||
(errno == EINTR))
|
||||
--
|
||||
2.30.1
|
||||
|
17
Ports/cmake/patches/0012-bin-bash.patch
Normal file
17
Ports/cmake/patches/0012-bin-bash.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
diff -urp a/bootstrap b/bootstrap
|
||||
--- a/bootstrap 2021-02-12 16:01:09.075367557 +0330
|
||||
+++ b/bootstrap 2021-02-12 15:59:27.811749370 +0330
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
diff -urp a/configure b/configure
|
||||
--- a/configure 2021-02-12 16:02:00.042148704 +0330
|
||||
+++ b/configure 2021-02-12 16:02:07.035496388 +0330
|
||||
@@ -1,3 +1,3 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
|
||||
exec "${cmake_source_dir}/bootstrap" "$@"
|
29
Ports/cmake/patches/0013-platform-serenityos.patch
Normal file
29
Ports/cmake/patches/0013-platform-serenityos.patch
Normal file
|
@ -0,0 +1,29 @@
|
|||
diff -urp /dev/null a/Modules/Platform/SerenityOS.cmake
|
||||
--- /dev/null 2021-02-11 00:46:13.390326124 +0330
|
||||
+++ a/Modules/Platform/SerenityOS.cmake 2021-02-12 16:31:38.421786222 +0330
|
||||
@@ -0,0 +1,25 @@
|
||||
+set(CMAKE_DL_LIBS "")
|
||||
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
|
||||
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
|
||||
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
|
||||
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
|
||||
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
|
||||
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
|
||||
+
|
||||
+# Shared libraries with no builtin soname may not be linked safely by
|
||||
+# specifying the file path.
|
||||
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
|
||||
+
|
||||
+# Initialize C link type selection flags. These flags are used when
|
||||
+# building a shared library, shared module, or executable that links
|
||||
+# to other libraries to select whether to use the static or shared
|
||||
+# versions of the libraries.
|
||||
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
|
||||
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
|
||||
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
|
||||
+endforeach()
|
||||
+
|
||||
+# No multi-arch here (yet?)
|
||||
+unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
|
||||
+
|
||||
+include(Platform/UnixPaths)
|
10
Ports/cmake/patches/0014-cmcurl-include-unistd.patch
Normal file
10
Ports/cmake/patches/0014-cmcurl-include-unistd.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/Utilities/cmcurl/include/curl/multi.h 2021-02-12 21:03:08.726002327 +0330
|
||||
+++ b/Utilities/cmcurl/include/curl/multi.h 2021-02-12 21:03:12.015764990 +0330
|
||||
@@ -47,6 +47,7 @@
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
+#include <unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
20
Ports/cmake/patches/0015-atoll.patch
Normal file
20
Ports/cmake/patches/0015-atoll.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- a/Source/kwsys/SystemInformation.cxx 2021-02-12 21:49:51.581563656 +0330
|
||||
+++ b/Source/kwsys/SystemInformation.cxx 2021-02-12 21:49:54.454669016 +0330
|
||||
@@ -3635,7 +3635,7 @@ long long SystemInformationImplementatio
|
||||
if (hostLimitEnvVarName) {
|
||||
const char* hostLimitEnvVarValue = getenv(hostLimitEnvVarName);
|
||||
if (hostLimitEnvVarValue) {
|
||||
- long long hostLimit = std::atoll(hostLimitEnvVarValue);
|
||||
+ long long hostLimit = atoll(hostLimitEnvVarValue);
|
||||
if (hostLimit > 0) {
|
||||
memTotal = min(hostLimit, memTotal);
|
||||
}
|
||||
@@ -3659,7 +3659,7 @@ long long SystemInformationImplementatio
|
||||
if (procLimitEnvVarName) {
|
||||
const char* procLimitEnvVarValue = getenv(procLimitEnvVarName);
|
||||
if (procLimitEnvVarValue) {
|
||||
- long long procLimit = std::atoll(procLimitEnvVarValue);
|
||||
+ long long procLimit = atoll(procLimitEnvVarValue);
|
||||
if (procLimit > 0) {
|
||||
memAvail = min(procLimit, memAvail);
|
||||
}
|
12
Ports/cmake/patches/0016-conflicting-0.patch
Normal file
12
Ports/cmake/patches/0016-conflicting-0.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- a/Utilities/cmnghttp2/cmakeconfig.h.in 2021-02-12 22:10:29.813759193 +0330
|
||||
+++ b/Utilities/cmnghttp2/cmakeconfig.h.in 2021-02-12 22:10:35.577912239 +0330
|
||||
@@ -5,9 +5,6 @@
|
||||
#include <cm3p/kwiml/abi.h>
|
||||
#include <cm3p/kwiml/int.h>
|
||||
|
||||
-/* Define to `int' if <sys/types.h> does not define. */
|
||||
-#cmakedefine ssize_t @ssize_t@
|
||||
-
|
||||
/* sizeof(int *) */
|
||||
#define SIZEOF_INT_P KWIML_ABI_SIZEOF_DATA_PTR
|
||||
|
12
Ports/cmake/patches/0017-conflicting-1.patch
Normal file
12
Ports/cmake/patches/0017-conflicting-1.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- a/Utilities/cmcurl/lib/curl_config.h.cmake 2021-02-12 22:12:54.848790862 +0330
|
||||
+++ b/Utilities/cmcurl/lib/curl_config.h.cmake 2021-02-12 22:12:57.841458768 +0330
|
||||
@@ -1052,9 +1052,6 @@ ${SIZEOF_TIME_T_CODE}
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#cmakedefine const ${const}
|
||||
|
||||
-/* Type to use in place of in_addr_t when system does not provide it. */
|
||||
-#cmakedefine in_addr_t ${in_addr_t}
|
||||
-
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
13
Ports/cmake/patches/0018-isfinite.patch
Normal file
13
Ports/cmake/patches/0018-isfinite.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp 2021-02-12 22:35:57.078226288 +0330
|
||||
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp 2021-02-12 22:36:02.937764094 +0330
|
||||
@@ -41,7 +41,9 @@
|
||||
#endif
|
||||
#else
|
||||
#include <cmath>
|
||||
-#if !(defined(__QNXNTO__)) // QNX already defines isfinite
|
||||
+#if defined(__serenity__) // isfinite is already defined in math.h
|
||||
+#include <math.h>
|
||||
+#elif !(defined(__QNXNTO__)) // QNX already defines isfinite
|
||||
#define isfinite std::isfinite
|
||||
#endif
|
||||
#endif
|
22
Ports/cmake/patches/0019-libuv-so_linger.patch
Normal file
22
Ports/cmake/patches/0019-libuv-so_linger.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- a/Utilities/cmlibuv/src/unix/tcp.c 2021-02-12 22:52:26.980780866 +0330
|
||||
+++ b/Utilities/cmlibuv/src/unix/tcp.c 2021-02-12 22:54:10.670863712 +0330
|
||||
@@ -310,15 +310,19 @@ int uv_tcp_getpeername(const uv_tcp_t* h
|
||||
|
||||
int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) {
|
||||
int fd;
|
||||
+#ifndef __serenity__
|
||||
struct linger l = { 1, 0 };
|
||||
+#endif
|
||||
|
||||
/* Disallow setting SO_LINGER to zero due to some platform inconsistencies */
|
||||
if (handle->flags & UV_HANDLE_SHUTTING)
|
||||
return UV_EINVAL;
|
||||
|
||||
fd = uv__stream_fd(handle);
|
||||
+#ifndef __serenity__
|
||||
if (0 != setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)))
|
||||
return UV__ERR(errno);
|
||||
+#endif
|
||||
|
||||
uv_close((uv_handle_t*) handle, close_cb);
|
||||
return 0;
|
489
Ports/cmake/patches/0020-libuv-ipv6.patch
Normal file
489
Ports/cmake/patches/0020-libuv-ipv6.patch
Normal file
|
@ -0,0 +1,489 @@
|
|||
--- a/Utilities/cmlibuv/src/unix/udp.c 2021-02-12 22:54:39.835381661 +0330
|
||||
+++ b/Utilities/cmlibuv/src/unix/udp.c 2021-02-12 23:06:41.699978199 +0330
|
||||
@@ -585,6 +585,7 @@ static int uv__udp_maybe_deferred_bind(u
|
||||
addrlen = sizeof *addr;
|
||||
break;
|
||||
}
|
||||
+#ifndef __serenity__
|
||||
case AF_INET6:
|
||||
{
|
||||
struct sockaddr_in6* addr = &taddr.in6;
|
||||
@@ -594,6 +595,7 @@ static int uv__udp_maybe_deferred_bind(u
|
||||
addrlen = sizeof *addr;
|
||||
break;
|
||||
}
|
||||
+#endif
|
||||
default:
|
||||
assert(0 && "unsupported address family");
|
||||
abort();
|
||||
@@ -761,6 +763,9 @@ static int uv__udp_set_membership4(uv_ud
|
||||
const struct sockaddr_in* multicast_addr,
|
||||
const char* interface_addr,
|
||||
uv_membership membership) {
|
||||
+#ifdef __serenity__
|
||||
+ return UV_EINVAL;
|
||||
+#else
|
||||
struct ip_mreq mreq;
|
||||
int optname;
|
||||
int err;
|
||||
@@ -801,6 +806,7 @@ static int uv__udp_set_membership4(uv_ud
|
||||
}
|
||||
|
||||
return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -808,6 +814,9 @@ static int uv__udp_set_membership6(uv_ud
|
||||
const struct sockaddr_in6* multicast_addr,
|
||||
const char* interface_addr,
|
||||
uv_membership membership) {
|
||||
+#ifdef __serenity__
|
||||
+ return UV_EINVAL;
|
||||
+#else
|
||||
int optname;
|
||||
struct ipv6_mreq mreq;
|
||||
struct sockaddr_in6 addr6;
|
||||
@@ -848,14 +857,16 @@ static int uv__udp_set_membership6(uv_ud
|
||||
}
|
||||
|
||||
return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
#if !defined(__OpenBSD__) && \
|
||||
!defined(__NetBSD__) && \
|
||||
!defined(__ANDROID__) && \
|
||||
- !defined(__DragonFly__) & \
|
||||
- !defined(__QNX__)
|
||||
+ !defined(__DragonFly__) && \
|
||||
+ !defined(__QNX__) && \
|
||||
+ !defined(__serenity__)
|
||||
static int uv__udp_set_source_membership4(uv_udp_t* handle,
|
||||
const struct sockaddr_in* multicast_addr,
|
||||
const char* interface_addr,
|
||||
@@ -1089,11 +1100,15 @@ static int uv__setsockopt(uv_udp_t* hand
|
||||
int r;
|
||||
|
||||
if (handle->flags & UV_HANDLE_IPV6)
|
||||
+#ifndef __serenity__
|
||||
r = setsockopt(handle->io_watcher.fd,
|
||||
IPPROTO_IPV6,
|
||||
option6,
|
||||
val,
|
||||
size);
|
||||
+#else
|
||||
+ r = -1;
|
||||
+#endif
|
||||
else
|
||||
r = setsockopt(handle->io_watcher.fd,
|
||||
IPPROTO_IP,
|
||||
@@ -1162,20 +1177,24 @@ int uv_udp_set_ttl(uv_udp_t* handle, int
|
||||
&ttl,
|
||||
sizeof(ttl));
|
||||
|
||||
-#else /* !(defined(__sun) || defined(_AIX) || defined (__OpenBSD__) ||
|
||||
+#elif !defined(__serenity__) /* !(defined(__sun) || defined(_AIX) || defined (__OpenBSD__) ||
|
||||
defined(__MVS__) || defined(__QNX__)) */
|
||||
|
||||
return uv__setsockopt_maybe_char(handle,
|
||||
IP_TTL,
|
||||
IPV6_UNICAST_HOPS,
|
||||
ttl);
|
||||
-
|
||||
+#else
|
||||
+ return -1;
|
||||
#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) ||
|
||||
defined(__MVS__) || defined(__QNX__) */
|
||||
}
|
||||
|
||||
|
||||
int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) {
|
||||
+#if defined(__serenity__)
|
||||
+ return -1;
|
||||
+#else
|
||||
/*
|
||||
* On Solaris and derivatives such as SmartOS, the length of socket options
|
||||
* is sizeof(int) for IPV6_MULTICAST_HOPS and sizeof(char) for
|
||||
@@ -1197,10 +1216,14 @@ int uv_udp_set_multicast_ttl(uv_udp_t* h
|
||||
IP_MULTICAST_TTL,
|
||||
IPV6_MULTICAST_HOPS,
|
||||
ttl);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) {
|
||||
+#if defined(__serenity__)
|
||||
+ return -1;
|
||||
+#else
|
||||
/*
|
||||
* On Solaris and derivatives such as SmartOS, the length of socket options
|
||||
* is sizeof(int) for IPV6_MULTICAST_LOOP and sizeof(char) for
|
||||
@@ -1222,9 +1245,13 @@ int uv_udp_set_multicast_loop(uv_udp_t*
|
||||
IP_MULTICAST_LOOP,
|
||||
IPV6_MULTICAST_LOOP,
|
||||
on);
|
||||
+#endif
|
||||
}
|
||||
|
||||
int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr) {
|
||||
+#if defined(__serenity__)
|
||||
+ return -1;
|
||||
+#else
|
||||
struct sockaddr_storage addr_st;
|
||||
struct sockaddr_in* addr4;
|
||||
struct sockaddr_in6* addr6;
|
||||
@@ -1271,6 +1298,7 @@ int uv_udp_set_multicast_interface(uv_ud
|
||||
}
|
||||
|
||||
return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
int uv_udp_getpeername(const uv_udp_t* handle,
|
||||
diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c
|
||||
index 0b83652..77468f9 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/udp.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/udp.c
|
||||
@@ -1058,7 +1058,8 @@ int uv_udp_set_source_membership(uv_udp_t* handle,
|
||||
!defined(__NetBSD__) && \
|
||||
!defined(__ANDROID__) && \
|
||||
!defined(__DragonFly__) && \
|
||||
- !defined(__QNX__)
|
||||
+ !defined(__QNX__) \
|
||||
+ !defined(__serenity__)
|
||||
int err;
|
||||
union uv__sockaddr mcast_addr;
|
||||
union uv__sockaddr src_addr;
|
||||
diff --git a/Utilities/cmlibuv/src/inet.c b/Utilities/cmlibuv/src/inet.c
|
||||
index 58238dc..5b880b0 100644
|
||||
--- a/Utilities/cmlibuv/src/inet.c
|
||||
+++ b/Utilities/cmlibuv/src/inet.c
|
||||
@@ -41,8 +41,10 @@ int uv_inet_ntop(int af, const void* src, char* dst, size_t size) {
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_ntop4(src, dst, size));
|
||||
+#ifndef __serenity__
|
||||
case AF_INET6:
|
||||
return (inet_ntop6(src, dst, size));
|
||||
+#endif
|
||||
default:
|
||||
return UV_EAFNOSUPPORT;
|
||||
}
|
||||
@@ -154,6 +156,7 @@ int uv_inet_pton(int af, const char* src, void* dst) {
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
return (inet_pton4(src, dst));
|
||||
+#ifndef __serenity__
|
||||
case AF_INET6: {
|
||||
int len;
|
||||
char tmp[UV__INET6_ADDRSTRLEN], *s, *p;
|
||||
@@ -169,6 +172,7 @@ int uv_inet_pton(int af, const char* src, void* dst) {
|
||||
}
|
||||
return inet_pton6(s, dst);
|
||||
}
|
||||
+#endif
|
||||
default:
|
||||
return UV_EAFNOSUPPORT;
|
||||
}
|
||||
diff --git a/Utilities/cmlibuv/src/unix/getnameinfo.c b/Utilities/cmlibuv/src/unix/getnameinfo.c
|
||||
index b695081..939db31 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/getnameinfo.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/getnameinfo.c
|
||||
@@ -37,8 +37,10 @@ static void uv__getnameinfo_work(struct uv__work* w) {
|
||||
|
||||
if (req->storage.ss_family == AF_INET)
|
||||
salen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (req->storage.ss_family == AF_INET6)
|
||||
salen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
else
|
||||
abort();
|
||||
|
||||
@@ -90,10 +92,12 @@ int uv_getnameinfo(uv_loop_t* loop,
|
||||
memcpy(&req->storage,
|
||||
addr,
|
||||
sizeof(struct sockaddr_in));
|
||||
+#ifndef __serenity__
|
||||
} else if (addr->sa_family == AF_INET6) {
|
||||
memcpy(&req->storage,
|
||||
addr,
|
||||
sizeof(struct sockaddr_in6));
|
||||
+#endif
|
||||
} else {
|
||||
return UV_EINVAL;
|
||||
}
|
||||
diff --git a/Utilities/cmlibuv/src/unix/tcp.c b/Utilities/cmlibuv/src/unix/tcp.c
|
||||
index 748d6ff..ff88f3b 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/tcp.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/tcp.c
|
||||
@@ -89,8 +89,11 @@ static int maybe_new_socket(uv_tcp_t* handle, int domain, unsigned long flags) {
|
||||
if (getsockname(uv__stream_fd(handle), (struct sockaddr*) &saddr, &slen))
|
||||
return UV__ERR(errno);
|
||||
|
||||
- if ((saddr.ss_family == AF_INET6 &&
|
||||
+ if (
|
||||
+#ifndef __serenity__
|
||||
+ (saddr.ss_family == AF_INET6 &&
|
||||
((struct sockaddr_in6*) &saddr)->sin6_port != 0) ||
|
||||
+#endif
|
||||
(saddr.ss_family == AF_INET &&
|
||||
((struct sockaddr_in*) &saddr)->sin_port != 0)) {
|
||||
/* Handle is already bound to a port. */
|
||||
@@ -116,7 +119,11 @@ int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* tcp, unsigned int flags) {
|
||||
|
||||
/* Use the lower 8 bits for the domain */
|
||||
domain = flags & 0xFF;
|
||||
- if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)
|
||||
+ if (domain != AF_INET
|
||||
+#ifndef __serenity__
|
||||
+ && domain != AF_INET6
|
||||
+#endif
|
||||
+ && domain != AF_UNSPEC)
|
||||
return UV_EINVAL;
|
||||
|
||||
if (flags & ~0xFF)
|
||||
@@ -152,9 +159,11 @@ int uv__tcp_bind(uv_tcp_t* tcp,
|
||||
int err;
|
||||
int on;
|
||||
|
||||
+#ifndef __serenity__
|
||||
/* Cannot set IPv6-only mode on non-IPv6 socket. */
|
||||
if ((flags & UV_TCP_IPV6ONLY) && addr->sa_family != AF_INET6)
|
||||
return UV_EINVAL;
|
||||
+#endif
|
||||
|
||||
err = maybe_new_socket(tcp, addr->sa_family, 0);
|
||||
if (err)
|
||||
@@ -164,7 +173,7 @@ int uv__tcp_bind(uv_tcp_t* tcp,
|
||||
if (setsockopt(tcp->io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)))
|
||||
return UV__ERR(errno);
|
||||
|
||||
-#ifndef __OpenBSD__
|
||||
+#if !defined(__OpenBSD__) && !defined(__serenity__)
|
||||
#ifdef IPV6_V6ONLY
|
||||
if (addr->sa_family == AF_INET6) {
|
||||
on = (flags & UV_TCP_IPV6ONLY) != 0;
|
||||
@@ -194,8 +203,10 @@ int uv__tcp_bind(uv_tcp_t* tcp,
|
||||
tcp->delayed_error = UV__ERR(errno);
|
||||
|
||||
tcp->flags |= UV_HANDLE_BOUND;
|
||||
+#ifndef __serenity__
|
||||
if (addr->sa_family == AF_INET6)
|
||||
tcp->flags |= UV_HANDLE_IPV6;
|
||||
+#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c
|
||||
index 82cd723..1d6f7f2 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/tty.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/tty.c
|
||||
@@ -345,7 +345,11 @@ uv_handle_type uv_guess_handle(uv_file file) {
|
||||
return UV_UNKNOWN_HANDLE;
|
||||
|
||||
if (type == SOCK_DGRAM)
|
||||
- if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6)
|
||||
+ if (sa.sa_family == AF_INET
|
||||
+#ifndef __serenity__
|
||||
+ || sa.sa_family == AF_INET6
|
||||
+#endif
|
||||
+ )
|
||||
return UV_UDP;
|
||||
|
||||
if (type == SOCK_STREAM) {
|
||||
@@ -358,7 +362,11 @@ uv_handle_type uv_guess_handle(uv_file file) {
|
||||
return UV_NAMED_PIPE;
|
||||
#endif /* defined(_AIX) || defined(__DragonFly__) */
|
||||
|
||||
- if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6)
|
||||
+ if (sa.sa_family == AF_INET
|
||||
+#ifndef __serenity__
|
||||
+ || sa.sa_family == AF_INET6
|
||||
+#endif
|
||||
+ )
|
||||
return UV_TCP;
|
||||
if (sa.sa_family == AF_UNIX)
|
||||
return UV_NAMED_PIPE;
|
||||
diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c
|
||||
index 77468f9..2db3dd2 100644
|
||||
--- a/Utilities/cmlibuv/src/unix/udp.c
|
||||
+++ b/Utilities/cmlibuv/src/unix/udp.c
|
||||
@@ -340,9 +340,12 @@ write_queue_drain:
|
||||
p->msg_hdr.msg_namelen = 0;
|
||||
} else {
|
||||
p->msg_hdr.msg_name = &req->addr;
|
||||
+#ifndef __serenity__
|
||||
if (req->addr.ss_family == AF_INET6)
|
||||
p->msg_hdr.msg_namelen = sizeof(struct sockaddr_in6);
|
||||
- else if (req->addr.ss_family == AF_INET)
|
||||
+ else
|
||||
+#endif
|
||||
+ if (req->addr.ss_family == AF_INET)
|
||||
p->msg_hdr.msg_namelen = sizeof(struct sockaddr_in);
|
||||
else if (req->addr.ss_family == AF_UNIX)
|
||||
p->msg_hdr.msg_namelen = sizeof(struct sockaddr_un);
|
||||
@@ -430,9 +433,12 @@ static void uv__udp_sendmsg(uv_udp_t* handle) {
|
||||
h.msg_namelen = 0;
|
||||
} else {
|
||||
h.msg_name = &req->addr;
|
||||
+#ifndef __serenity__
|
||||
if (req->addr.ss_family == AF_INET6)
|
||||
h.msg_namelen = sizeof(struct sockaddr_in6);
|
||||
- else if (req->addr.ss_family == AF_INET)
|
||||
+ else
|
||||
+#endif
|
||||
+ if (req->addr.ss_family == AF_INET)
|
||||
h.msg_namelen = sizeof(struct sockaddr_in);
|
||||
else if (req->addr.ss_family == AF_UNIX)
|
||||
h.msg_namelen = sizeof(struct sockaddr_un);
|
||||
@@ -518,8 +524,10 @@ int uv__udp_bind(uv_udp_t* handle,
|
||||
return UV_EINVAL;
|
||||
|
||||
/* Cannot set IPv6-only mode on non-IPv6 socket. */
|
||||
+#ifndef __serenity__
|
||||
if ((flags & UV_UDP_IPV6ONLY) && addr->sa_family != AF_INET6)
|
||||
return UV_EINVAL;
|
||||
+#endif
|
||||
|
||||
fd = handle->io_watcher.fd;
|
||||
if (fd == -1) {
|
||||
@@ -558,8 +566,10 @@ int uv__udp_bind(uv_udp_t* handle,
|
||||
return err;
|
||||
}
|
||||
|
||||
+#ifndef __serenity__
|
||||
if (addr->sa_family == AF_INET6)
|
||||
handle->flags |= UV_HANDLE_IPV6;
|
||||
+#endif
|
||||
|
||||
handle->flags |= UV_HANDLE_BOUND;
|
||||
return 0;
|
||||
@@ -1038,11 +1048,13 @@ int uv_udp_set_membership(uv_udp_t* handle,
|
||||
if (err)
|
||||
return err;
|
||||
return uv__udp_set_membership4(handle, &addr4, interface_addr, membership);
|
||||
+#ifndef __serenity__
|
||||
} else if (uv_ip6_addr(multicast_addr, 0, &addr6) == 0) {
|
||||
err = uv__udp_maybe_deferred_bind(handle, AF_INET6, UV_UDP_REUSEADDR);
|
||||
if (err)
|
||||
return err;
|
||||
return uv__udp_set_membership6(handle, &addr6, interface_addr, membership);
|
||||
+#endif
|
||||
} else {
|
||||
return UV_EINVAL;
|
||||
}
|
||||
@@ -1058,7 +1070,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle,
|
||||
!defined(__NetBSD__) && \
|
||||
!defined(__ANDROID__) && \
|
||||
!defined(__DragonFly__) && \
|
||||
- !defined(__QNX__) \
|
||||
+ !defined(__QNX__) && \
|
||||
!defined(__serenity__)
|
||||
int err;
|
||||
union uv__sockaddr mcast_addr;
|
||||
diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c
|
||||
index f986d75..f73840e 100644
|
||||
--- a/Utilities/cmlibuv/src/uv-common.c
|
||||
+++ b/Utilities/cmlibuv/src/uv-common.c
|
||||
@@ -231,6 +231,9 @@ int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) {
|
||||
|
||||
|
||||
int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
|
||||
+#ifdef __serenity__
|
||||
+ return -1;
|
||||
+#else
|
||||
char address_part[40];
|
||||
size_t address_part_size;
|
||||
const char* zone_index;
|
||||
@@ -262,6 +265,7 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
|
||||
}
|
||||
|
||||
return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +275,11 @@ int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) {
|
||||
|
||||
|
||||
int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) {
|
||||
+#ifdef __serenity__
|
||||
+ return -1;
|
||||
+#else
|
||||
return uv_inet_ntop(AF_INET6, &src->sin6_addr, dst, size);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -285,8 +293,10 @@ int uv_tcp_bind(uv_tcp_t* handle,
|
||||
|
||||
if (addr->sa_family == AF_INET)
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (addr->sa_family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
else
|
||||
return UV_EINVAL;
|
||||
|
||||
@@ -301,7 +311,11 @@ int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned flags) {
|
||||
|
||||
/* Use the lower 8 bits for the domain. */
|
||||
domain = flags & 0xFF;
|
||||
- if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)
|
||||
+ if (domain != AF_INET
|
||||
+#ifndef __serenity__
|
||||
+ && domain != AF_INET6
|
||||
+#endif
|
||||
+ && domain != AF_UNSPEC)
|
||||
return UV_EINVAL;
|
||||
|
||||
/* Use the higher bits for extra flags. */
|
||||
@@ -334,8 +348,10 @@ int uv_udp_bind(uv_udp_t* handle,
|
||||
|
||||
if (addr->sa_family == AF_INET)
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (addr->sa_family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
else
|
||||
return UV_EINVAL;
|
||||
|
||||
@@ -354,8 +370,10 @@ int uv_tcp_connect(uv_connect_t* req,
|
||||
|
||||
if (addr->sa_family == AF_INET)
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (addr->sa_family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
else
|
||||
return UV_EINVAL;
|
||||
|
||||
@@ -379,8 +397,10 @@ int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr) {
|
||||
|
||||
if (addr->sa_family == AF_INET)
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (addr->sa_family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
else
|
||||
return UV_EINVAL;
|
||||
|
||||
@@ -420,8 +440,10 @@ int uv__udp_check_before_send(uv_udp_t* handle, const struct sockaddr* addr) {
|
||||
if (addr != NULL) {
|
||||
if (addr->sa_family == AF_INET)
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
+#ifndef __serenity__
|
||||
else if (addr->sa_family == AF_INET6)
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
+#endif
|
||||
#if defined(AF_UNIX) && !defined(_WIN32)
|
||||
else if (addr->sa_family == AF_UNIX)
|
||||
addrlen = sizeof(struct sockaddr_un);
|
28
Ports/cmake/patches/0021-libcurl-no-ipv6.patch
Normal file
28
Ports/cmake/patches/0021-libcurl-no-ipv6.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake
|
||||
index c321f4e..7e20d2c 100644
|
||||
--- a/Utilities/cmcurl/lib/curl_config.h.cmake
|
||||
+++ b/Utilities/cmcurl/lib/curl_config.h.cmake
|
||||
@@ -103,7 +103,7 @@
|
||||
#cmakedefine EGD_SOCKET ${EGD_SOCKET}
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
-#cmakedefine ENABLE_IPV6 1
|
||||
+/* #cmakedefine ENABLE_IPV6 1 */
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_QUAL_ARG1 ${GETNAMEINFO_QUAL_ARG1}
|
||||
diff --git a/Utilities/cmcurl/lib/connect.c b/Utilities/cmcurl/lib/connect.c
|
||||
index b000b1b..e373e02 100644
|
||||
--- a/Utilities/cmcurl/lib/connect.c
|
||||
+++ b/Utilities/cmcurl/lib/connect.c
|
||||
@@ -1336,8 +1336,10 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
conn->tempfamily[0] = conn->tempaddr[0]?
|
||||
conn->tempaddr[0]->ai_family:0;
|
||||
+#ifdef ENABLE_IPV6
|
||||
conn->tempfamily[1] = conn->tempfamily[0] == AF_INET6 ?
|
||||
AF_INET : AF_INET6;
|
||||
+#endif
|
||||
ainext(conn, 1, FALSE); /* assigns conn->tempaddr[1] accordingly */
|
||||
|
||||
DEBUGF(infof(data, "family0 == %s, family1 == %s\n",
|
370
Ports/cmake/patches/0022-remove-mutex.patch
Normal file
370
Ports/cmake/patches/0022-remove-mutex.patch
Normal file
|
@ -0,0 +1,370 @@
|
|||
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
|
||||
index ee2bc09..a1c5821 100644
|
||||
--- a/Source/cmQtAutoGenerator.cxx
|
||||
+++ b/Source/cmQtAutoGenerator.cxx
|
||||
@@ -61,7 +61,9 @@ void cmQtAutoGenerator::Logger::Info(GenT genType,
|
||||
std::string msg = cmStrCat(GeneratorName(genType), ": ", message,
|
||||
cmHasSuffix(message, '\n') ? "" : "\n");
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
+#endif
|
||||
cmSystemTools::Stdout(msg);
|
||||
}
|
||||
}
|
||||
@@ -80,7 +82,9 @@ void cmQtAutoGenerator::Logger::Warning(GenT genType,
|
||||
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
|
||||
}
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
+#endif
|
||||
cmSystemTools::Stdout(msg);
|
||||
}
|
||||
}
|
||||
@@ -92,7 +96,9 @@ void cmQtAutoGenerator::Logger::Error(GenT genType,
|
||||
cmStrCat('\n', HeadLine(cmStrCat(GeneratorName(genType), " error")),
|
||||
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
+#endif
|
||||
cmSystemTools::Stderr(msg);
|
||||
}
|
||||
}
|
||||
@@ -108,7 +114,9 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
|
||||
msg += cmStrCat(HeadLine("Output"), output,
|
||||
cmHasSuffix(output, '\n') ? "\n" : "\n\n");
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
+#endif
|
||||
cmSystemTools::Stderr(msg);
|
||||
}
|
||||
}
|
||||
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
|
||||
index b4f057d..e0970f6 100644
|
||||
--- a/Source/cmQtAutoGenerator.h
|
||||
+++ b/Source/cmQtAutoGenerator.h
|
||||
@@ -55,7 +55,9 @@ public:
|
||||
static std::string HeadLine(cm::string_view title);
|
||||
|
||||
private:
|
||||
+#ifndef __serenity__
|
||||
mutable std::mutex Mutex_;
|
||||
+#endif
|
||||
unsigned int Verbosity_ = 0;
|
||||
bool ColorOutput_ = false;
|
||||
};
|
||||
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
|
||||
index 9cb172b..a365c96 100644
|
||||
--- a/Source/cmQtAutoMocUic.cxx
|
||||
+++ b/Source/cmQtAutoMocUic.cxx
|
||||
@@ -586,8 +586,10 @@ private:
|
||||
// -- Worker thread pool
|
||||
std::atomic<bool> JobError_ = ATOMIC_VAR_INIT(false);
|
||||
cmWorkerPool WorkerPool_;
|
||||
+#ifndef __serenity__
|
||||
// -- Concurrent processing
|
||||
mutable std::mutex CMakeLibMutex_;
|
||||
+#endif
|
||||
};
|
||||
|
||||
cmQtAutoMocUicT::IncludeKeyT::IncludeKeyT(std::string const& key,
|
||||
@@ -2612,7 +2614,9 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap)
|
||||
/** Concurrently callable implementation of cmSystemTools::CollapseFullPath */
|
||||
std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> guard(CMakeLibMutex_);
|
||||
+#endif
|
||||
return cmSystemTools::CollapseFullPath(path, ProjectDirs().CurrentSource);
|
||||
}
|
||||
|
||||
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
|
||||
index df2f64e..154b816 100644
|
||||
--- a/Source/cmUVHandlePtr.cxx
|
||||
+++ b/Source/cmUVHandlePtr.cxx
|
||||
@@ -137,16 +137,22 @@ struct uv_handle_deleter<uv_async_t>
|
||||
* which is mandated by the standard for Deleter on
|
||||
* shared_ptrs.
|
||||
*/
|
||||
+#ifndef __serenity__
|
||||
std::shared_ptr<std::mutex> handleMutex;
|
||||
+#endif
|
||||
|
||||
uv_handle_deleter()
|
||||
+#ifndef __serenity__
|
||||
: handleMutex(std::make_shared<std::mutex>())
|
||||
+#endif
|
||||
{
|
||||
}
|
||||
|
||||
void operator()(uv_async_t* handle)
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(*handleMutex);
|
||||
+#endif
|
||||
handle_default_delete(handle);
|
||||
}
|
||||
};
|
||||
@@ -156,7 +162,9 @@ void uv_async_ptr::send()
|
||||
auto deleter = std::get_deleter<uv_handle_deleter<uv_async_t>>(this->handle);
|
||||
assert(deleter);
|
||||
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(*deleter->handleMutex);
|
||||
+#endif
|
||||
if (this->handle) {
|
||||
uv_async_send(*this);
|
||||
}
|
||||
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
|
||||
index 12aba4f..a3f3897 100644
|
||||
--- a/Source/cmWorkerPool.cxx
|
||||
+++ b/Source/cmWorkerPool.cxx
|
||||
@@ -382,10 +382,12 @@ public:
|
||||
cmWorkerPoolWorker(cmWorkerPoolWorker const&) = delete;
|
||||
cmWorkerPoolWorker& operator=(cmWorkerPoolWorker const&) = delete;
|
||||
|
||||
+#ifndef __serenity__
|
||||
/**
|
||||
* Set the internal thread
|
||||
*/
|
||||
void SetThread(std::thread&& aThread) { Thread_ = std::move(aThread); }
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* Run an external process
|
||||
@@ -403,13 +405,19 @@ private:
|
||||
// -- Process management
|
||||
struct
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::mutex Mutex;
|
||||
+#endif
|
||||
cm::uv_async_ptr Request;
|
||||
+#ifndef __serenity__
|
||||
std::condition_variable Condition;
|
||||
+#endif
|
||||
std::unique_ptr<cmUVReadOnlyProcess> ROP;
|
||||
} Proc_;
|
||||
// -- System thread
|
||||
+#ifndef __serenity__
|
||||
std::thread Thread_;
|
||||
+#endif
|
||||
};
|
||||
|
||||
cmWorkerPoolWorker::cmWorkerPoolWorker(uv_loop_t& uvLoop)
|
||||
@@ -419,9 +427,11 @@ cmWorkerPoolWorker::cmWorkerPoolWorker(uv_loop_t& uvLoop)
|
||||
|
||||
cmWorkerPoolWorker::~cmWorkerPoolWorker()
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
if (Thread_.joinable()) {
|
||||
Thread_.join();
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
|
||||
@@ -433,7 +443,9 @@ bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
|
||||
}
|
||||
// Create process instance
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Proc_.Mutex);
|
||||
+#endif
|
||||
Proc_.ROP = cm::make_unique<cmUVReadOnlyProcess>();
|
||||
Proc_.ROP->setup(&result, true, command, workingDirectory);
|
||||
}
|
||||
@@ -441,10 +453,12 @@ bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
|
||||
Proc_.Request.send();
|
||||
// Wait until the process has been finished and destroyed
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::unique_lock<std::mutex> ulock(Proc_.Mutex);
|
||||
while (Proc_.ROP) {
|
||||
Proc_.Condition.wait(ulock);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
return !result.error();
|
||||
}
|
||||
@@ -455,7 +469,9 @@ void cmWorkerPoolWorker::UVProcessStart(uv_async_t* handle)
|
||||
bool startFailed = false;
|
||||
{
|
||||
auto& Proc = wrk->Proc_;
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Proc.Mutex);
|
||||
+#endif
|
||||
if (Proc.ROP && !Proc.ROP->IsStarted()) {
|
||||
startFailed =
|
||||
!Proc.ROP->start(handle->loop, [wrk] { wrk->UVProcessFinished(); });
|
||||
@@ -469,12 +485,14 @@ void cmWorkerPoolWorker::UVProcessStart(uv_async_t* handle)
|
||||
|
||||
void cmWorkerPoolWorker::UVProcessFinished()
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> lock(Proc_.Mutex);
|
||||
if (Proc_.ROP && (Proc_.ROP->IsFinished() || !Proc_.ROP->IsStarted())) {
|
||||
Proc_.ROP.reset();
|
||||
}
|
||||
// Notify idling thread
|
||||
Proc_.Condition.notify_one();
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -521,7 +539,9 @@ public:
|
||||
cm::uv_async_ptr UVRequestEnd;
|
||||
|
||||
// -- Thread pool and job queue
|
||||
+#ifndef __serenity__
|
||||
std::mutex Mutex;
|
||||
+#endif
|
||||
bool Processing = false;
|
||||
bool Aborting = false;
|
||||
bool FenceProcessing = false;
|
||||
@@ -529,8 +549,10 @@ public:
|
||||
unsigned int WorkersIdle = 0;
|
||||
unsigned int JobsProcessing = 0;
|
||||
std::deque<cmWorkerPool::JobHandleT> Queue;
|
||||
+#ifndef __serenity__
|
||||
std::condition_variable Condition;
|
||||
std::condition_variable ConditionFence;
|
||||
+#endif
|
||||
std::vector<std::unique_ptr<cmWorkerPoolWorker>> Workers;
|
||||
|
||||
// -- References
|
||||
@@ -593,18 +615,24 @@ bool cmWorkerPoolInternal::Process()
|
||||
void cmWorkerPoolInternal::Abort()
|
||||
{
|
||||
// Clear all jobs and set abort flag
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> guard(Mutex);
|
||||
+#endif
|
||||
if (!Aborting) {
|
||||
// Register abort and clear queue
|
||||
Aborting = true;
|
||||
Queue.clear();
|
||||
+#ifndef __serenity__
|
||||
Condition.notify_all();
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
inline bool cmWorkerPoolInternal::PushJob(cmWorkerPool::JobHandleT&& jobHandle)
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
std::lock_guard<std::mutex> guard(Mutex);
|
||||
+#endif
|
||||
if (Aborting) {
|
||||
return false;
|
||||
}
|
||||
@@ -612,7 +640,9 @@ inline bool cmWorkerPoolInternal::PushJob(cmWorkerPool::JobHandleT&& jobHandle)
|
||||
Queue.emplace_back(std::move(jobHandle));
|
||||
// Notify an idle worker if there's one
|
||||
if (WorkersIdle != 0) {
|
||||
+#ifndef __serenity__
|
||||
Condition.notify_one();
|
||||
+#endif
|
||||
}
|
||||
// Return success
|
||||
return true;
|
||||
@@ -630,11 +660,17 @@ void cmWorkerPoolInternal::UVSlotBegin(uv_async_t* handle)
|
||||
gint.Workers.emplace_back(
|
||||
cm::make_unique<cmWorkerPoolWorker>(*gint.UVLoop));
|
||||
}
|
||||
+#ifndef __serenity__
|
||||
// Start worker threads
|
||||
for (unsigned int ii = 0; ii != num; ++ii) {
|
||||
gint.Workers[ii]->SetThread(
|
||||
std::thread(&cmWorkerPoolInternal::Work, &gint, ii));
|
||||
}
|
||||
+#else
|
||||
+ for (unsigned int ii = 0; ii != num; ++ii) {
|
||||
+ gint.Work(ii);
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
// Destroy begin request
|
||||
gint.UVRequestBegin.reset();
|
||||
@@ -652,7 +688,9 @@ void cmWorkerPoolInternal::UVSlotEnd(uv_async_t* handle)
|
||||
void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
{
|
||||
cmWorkerPool::JobHandleT jobHandle;
|
||||
+#ifndef __serenity__
|
||||
std::unique_lock<std::mutex> uLock(Mutex);
|
||||
+#endif
|
||||
// Increment running workers count
|
||||
++WorkersRunning;
|
||||
// Enter worker main loop
|
||||
@@ -664,7 +702,9 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
// Wait for new jobs on the main CV
|
||||
if (Queue.empty()) {
|
||||
++WorkersIdle;
|
||||
+#ifndef __serenity__
|
||||
Condition.wait(uLock);
|
||||
+#endif
|
||||
--WorkersIdle;
|
||||
continue;
|
||||
}
|
||||
@@ -672,7 +712,9 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
// If there is a fence currently active or waiting,
|
||||
// sleep on the main CV and try again.
|
||||
if (FenceProcessing) {
|
||||
+#ifndef __serenity__
|
||||
Condition.wait(uLock);
|
||||
+#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -687,12 +729,16 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
raisedFence = true;
|
||||
// Wait on the Fence CV until all pending jobs are done.
|
||||
while (JobsProcessing != 0 && !Aborting) {
|
||||
+#ifndef __serenity__
|
||||
ConditionFence.wait(uLock);
|
||||
+#endif
|
||||
}
|
||||
// When aborting, explicitly kick all threads alive once more.
|
||||
if (Aborting) {
|
||||
FenceProcessing = false;
|
||||
+#ifndef __serenity__
|
||||
Condition.notify_all();
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -700,10 +746,14 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
// Unlocked scope for job processing
|
||||
++JobsProcessing;
|
||||
{
|
||||
+#ifndef __serenity__
|
||||
uLock.unlock();
|
||||
+#endif
|
||||
jobHandle->Work(Pool, workerIndex); // Process job
|
||||
jobHandle.reset(); // Destroy job
|
||||
+#ifndef __serenity__
|
||||
uLock.lock();
|
||||
+#endif
|
||||
}
|
||||
--JobsProcessing;
|
||||
|
||||
@@ -712,12 +762,16 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
|
||||
// is done.
|
||||
if (raisedFence) {
|
||||
FenceProcessing = false;
|
||||
+#ifndef __serenity__
|
||||
Condition.notify_all();
|
||||
+#endif
|
||||
}
|
||||
// If fence processing is still not done, notify the
|
||||
// the fencing worker when all active jobs are done.
|
||||
if (FenceProcessing && JobsProcessing == 0) {
|
||||
+#ifndef __serenity__
|
||||
ConditionFence.notify_all();
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
26
Ports/cmake/patches/0023-lround.patch
Normal file
26
Ports/cmake/patches/0023-lround.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
|
||||
index 5e40712..972927b 100644
|
||||
--- a/Source/cmFileCommand.cxx
|
||||
+++ b/Source/cmFileCommand.cxx
|
||||
@@ -1500,7 +1500,7 @@ public:
|
||||
long OldPercentage = this->CurrentPercentage;
|
||||
|
||||
if (total > 0.0) {
|
||||
- this->CurrentPercentage = std::lround(value / total * 100.0);
|
||||
+ this->CurrentPercentage = trunc(round(value / total * 100.0));
|
||||
if (this->CurrentPercentage > 100) {
|
||||
// Avoid extra progress reports for unexpected data beyond total.
|
||||
this->CurrentPercentage = 100;
|
||||
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
|
||||
index 4d1a589..0209bec 100644
|
||||
--- a/Source/CTest/cmCTestTestHandler.cxx
|
||||
+++ b/Source/CTest/cmCTestTestHandler.cxx
|
||||
@@ -581,7 +581,7 @@ void cmCTestTestHandler::LogTestSummary(const std::vector<std::string>& passed,
|
||||
}
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT,
|
||||
std::endl
|
||||
- << passColorCode << std::lround(percent) << "% tests passed"
|
||||
+ << passColorCode << trunc(round(percent)) << "% tests passed"
|
||||
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
|
||||
<< ", " << failedColorCode << failed.size() << " tests failed"
|
||||
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
|
85
Ports/cmake/patches/0024-shared-mutex.patch
Normal file
85
Ports/cmake/patches/0024-shared-mutex.patch
Normal file
|
@ -0,0 +1,85 @@
|
|||
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
|
||||
index 7f97406..bebb100 100644
|
||||
--- a/Source/cmServer.cxx
|
||||
+++ b/Source/cmServer.cxx
|
||||
@@ -251,7 +251,9 @@ cmFileMonitor* cmServer::FileMonitor() const
|
||||
void cmServer::WriteJsonObject(const Json::Value& jsonValue,
|
||||
const DebugInfo* debug) const
|
||||
{
|
||||
+#if 0
|
||||
cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
|
||||
+#endif
|
||||
for (auto& connection : this->Connections) {
|
||||
WriteJsonObject(connection.get(), jsonValue, debug);
|
||||
}
|
||||
@@ -458,7 +460,9 @@ bool cmServerBase::Serve(std::string* errorMessage)
|
||||
OnServeStart();
|
||||
|
||||
{
|
||||
+#if 0
|
||||
cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
|
||||
+#endif
|
||||
for (auto& connection : Connections) {
|
||||
if (!connection->OnServeStart(errorMessage)) {
|
||||
return false;
|
||||
@@ -494,7 +498,9 @@ void cmServerBase::StartShutDown()
|
||||
SIGHUPHandler.reset();
|
||||
|
||||
{
|
||||
+#if 0
|
||||
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
|
||||
+#endif
|
||||
for (auto& connection : Connections) {
|
||||
connection->OnConnectionShuttingDown();
|
||||
}
|
||||
@@ -541,7 +547,9 @@ cmServerBase::~cmServerBase()
|
||||
void cmServerBase::AddNewConnection(cmConnection* ownedConnection)
|
||||
{
|
||||
{
|
||||
+#if 0
|
||||
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
|
||||
+#endif
|
||||
Connections.emplace_back(ownedConnection);
|
||||
}
|
||||
ownedConnection->SetServer(this);
|
||||
@@ -558,7 +566,9 @@ void cmServerBase::OnDisconnect(cmConnection* pConnection)
|
||||
return m.get() == pConnection;
|
||||
};
|
||||
{
|
||||
+#if 0
|
||||
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
|
||||
+#endif
|
||||
Connections.erase(
|
||||
std::remove_if(Connections.begin(), Connections.end(), pred),
|
||||
Connections.end());
|
||||
diff --git a/Source/cmServer.h b/Source/cmServer.h
|
||||
index 9543329..6a19be7 100644
|
||||
--- a/Source/cmServer.h
|
||||
+++ b/Source/cmServer.h
|
||||
@@ -65,7 +65,9 @@ public:
|
||||
void OnDisconnect(cmConnection* pConnection);
|
||||
|
||||
protected:
|
||||
+#if 0
|
||||
mutable cm::shared_mutex ConnectionsMutex;
|
||||
+#endif
|
||||
std::vector<std::unique_ptr<cmConnection>> Connections;
|
||||
|
||||
bool ServeThreadRunning = false;
|
||||
diff --git a/Utilities/std/cm/shared_mutex b/Utilities/std/cm/shared_mutex
|
||||
index a1204fa..d4812c8 100644
|
||||
--- a/Utilities/std/cm/shared_mutex
|
||||
+++ b/Utilities/std/cm/shared_mutex
|
||||
@@ -5,6 +5,7 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#pragma once
|
||||
|
||||
+#if 0
|
||||
#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
|
||||
# define CMake_HAVE_CXX_SHARED_LOCK
|
||||
#endif
|
||||
@@ -71,3 +72,4 @@ public:
|
||||
};
|
||||
#endif
|
||||
}
|
||||
+#endif
|
23
Ports/cmake/patches/0025-uv-platform.patch
Normal file
23
Ports/cmake/patches/0025-uv-platform.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
|
||||
index 92d2411..e6bf241 100644
|
||||
--- a/Utilities/cmlibuv/CMakeLists.txt
|
||||
+++ b/Utilities/cmlibuv/CMakeLists.txt
|
||||
@@ -354,6 +354,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
|
||||
)
|
||||
endif()
|
||||
|
||||
+if (CMAKE_SYSTEM_NAME STREQUAL "SerenityOS")
|
||||
+ list(APPEND uv_headers
|
||||
+ include/uv/posix.h
|
||||
+ )
|
||||
+ list(APPEND uv_sources
|
||||
+ src/unix/posix-hrtime.c
|
||||
+ src/unix/posix-poll.c
|
||||
+ src/unix/no-fsevents.c
|
||||
+ src/unix/no-proctitle.c
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
include_directories(
|
||||
${uv_includes}
|
||||
${KWSYS_HEADER_ROOT}
|
12
Ports/cmake/patches/0026-curl-struct-stat.patch
Normal file
12
Ports/cmake/patches/0026-curl-struct-stat.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff --git a/Utilities/cmcurl/lib/curl_setup.h b/Utilities/cmcurl/lib/curl_setup.h
|
||||
index 45a093f..e621db3 100644
|
||||
--- a/Utilities/cmcurl/lib/curl_setup.h
|
||||
+++ b/Utilities/cmcurl/lib/curl_setup.h
|
||||
@@ -380,6 +380,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef struct_stat
|
||||
+# include <sys/stat.h>
|
||||
# define struct_stat struct stat
|
||||
#endif
|
||||
|
13
Ports/cmake/patches/0027-libuv-platform-serenity.patch
Normal file
13
Ports/cmake/patches/0027-libuv-platform-serenity.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/Utilities/cmlibuv/include/uv/unix.h b/Utilities/cmlibuv/include/uv/unix.h
|
||||
index fb3e97d..a59192f 100644
|
||||
--- a/Utilities/cmlibuv/include/uv/unix.h
|
||||
+++ b/Utilities/cmlibuv/include/uv/unix.h
|
||||
@@ -78,6 +78,8 @@
|
||||
# include "posix.h"
|
||||
#elif defined(__QNX__)
|
||||
# include "posix.h"
|
||||
+#elif defined(__serenity__)
|
||||
+# include "posix.h"
|
||||
#endif
|
||||
|
||||
#ifndef NI_MAXHOST
|
14
Ports/cmake/patches/0028-cmake-disable-tests.patch
Normal file
14
Ports/cmake/patches/0028-cmake-disable-tests.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2d860d4..343db6e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -710,7 +710,8 @@ endif()
|
||||
include(Source/CMakeVersion.cmake)
|
||||
|
||||
# Include the standard Dart testing module
|
||||
-enable_testing()
|
||||
+# enable_testing()
|
||||
+set(BUILD_TESTING 0)
|
||||
include (${CMAKE_ROOT}/Modules/Dart.cmake)
|
||||
|
||||
# Set up test-time configuration.
|
244
Ports/cmake/patches/ReadMe.md
Normal file
244
Ports/cmake/patches/ReadMe.md
Normal file
|
@ -0,0 +1,244 @@
|
|||
# Patches for CMake (and submodules) on SerenityOS
|
||||
|
||||
## `0000-no_wide_string.patch`
|
||||
|
||||
We don't support wide strings, and our libstdc++ doesn't have `std::wstring`.
|
||||
This patch is a big hack to wipe wide strings out of the codebase; naturally, it very likely breaks unicode.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0002-stoi-atoi.patch` and `0003-stoi-atoi-2.patch`
|
||||
|
||||
For some reason, our libstdc++ does not define `std::stoi`, these two patches change different overloads of this function to the equivalent C functions.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0004-snprintf.patch`
|
||||
|
||||
Our libstdc++ does not define `std::printf` and `std::snprintf`, this patch simply removes the `std` namespace.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0005-stod.patch` and `0006-stoll.patch`
|
||||
|
||||
Our libstdc++ does not define `std::stod` and `std::stoll`, this patch swaps them with the equivalent C functions.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0007-utimes-utime.patch`
|
||||
|
||||
`utimes` is a deprecated POSIX API, and we do not support it, this patch uses the equivalent `utime` function instead.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream? (Once cleaned up)
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0008-unix-stuff.patch`
|
||||
|
||||
This patch removes the use of `{get,set}priority()` as we do not support it.
|
||||
it also removes two functions with the correct conditions (the same conditions as their dependents are removed with).
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [X] Should be merged to upstream? Partially.
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0009-purge-non-serenity-syscalls.patch`
|
||||
|
||||
This patch removes syscalls and options not defined in serenity.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0010-don-t-use-siginfo.patch`
|
||||
|
||||
We don't support SIGINFO. This patch removes uses of SIGINFO.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0011-Fixed-your-code-rot-cmake.patch`
|
||||
|
||||
This purely fixes code issues with cmake. very funny patch.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream?
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0012-bin-bash.patch`
|
||||
|
||||
This patch swaps out `/bin/sh` for `/bin/bash` in two scripts that need it.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0013-platform-serenityos.patch`
|
||||
This patch adds the SerenityOS platform config file to CMake.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream? If we want to have cmake support serenity out of the box.
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0014-cmcurl-include-unistd.patch`
|
||||
|
||||
Everyone gets this wrong. most platforms are very lax with these includes, but we're not one of them.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0015-atoll.patch`
|
||||
|
||||
Our libstdc++ does not define `std::atoll`, this patch uses the equivalent C function instead.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0016-conflicting-0.patch` and `0017-conflicting-1.patch`
|
||||
|
||||
These two defines make GCC very sad. reasons are unknown at this time.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0018-isfinite.patch`
|
||||
|
||||
Our `math.h` already defines `isfinite`.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream? If we want to have cmake support serenity out of the box.
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0019-libuv-so_linger.patch`
|
||||
|
||||
We don't have `SO_LINGER` or its associated struct. This patch removes them.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0020-libuv-ipv6.patch`
|
||||
|
||||
cmlibuv assumes the platform has definitions for (and supports) IPv6; this patch removes IPv6-specific things from libuv.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0021-libcurl-no-ipv6.patch`
|
||||
|
||||
libcurl has a IPV6 switch, but uses `AF_INET6` unconditionally in one place. this patch disables IPV6 and makes that one use conditional.
|
||||
|
||||
### Status
|
||||
- [X] Local? Partially.
|
||||
- [X] Should be merged to upstream? Partially.
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0022-remove-mutex.patch` and `0024-shared-mutex.patch`
|
||||
|
||||
We don't have mutexes, and out libstdc++ does not define `std::mutex`.
|
||||
This patch removes all uses of `std::mutex`, `std::condition_variable`, and anything that depends on them; and replaces them with single-threaded equivalents.
|
||||
This will break horribly with smp.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0023-lround.patch`
|
||||
|
||||
Our libstdc++ (and stdlib) does not have `lround`, this patch replaces that with somewhat equivalent C stdlib functions.
|
||||
|
||||
### Status
|
||||
- [X] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0025-uv-platform.patch`
|
||||
|
||||
This patch adds the definitions necessary to compile libuv on Serenity.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream? If we want to have cmake support serenity out of the box.
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0026-curl-struct-stat.patch`
|
||||
|
||||
For unknown reasons, `curl_setup_once.h` does not include `sys/stat.h`. this patch includes `sys/stat.h`.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [X] Resolves issue(s) with our side of things
|
||||
- [X] Hack
|
||||
|
||||
## `0027-libuv-platform-serenity.patch`
|
||||
|
||||
This patch adds a platform-specific conditional include to `uv/unix.h`.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [X] Should be merged to upstream?
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
||||
|
||||
## `0028-cmake-disable-tests.patch`
|
||||
|
||||
We don't care about building tests for now, and it makes the compilation much faster.
|
||||
|
||||
### Status
|
||||
- [ ] Local?
|
||||
- [ ] Should be merged to upstream?
|
||||
- [ ] Resolves issue(s) with our side of things
|
||||
- [ ] Hack
|
Loading…
Reference in a new issue