mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-23 21:34:18 +08:00
Add necessary C code for libuv
This commit is contained in:
parent
6d5c2a0be7
commit
5df0844448
@ -6,19 +6,10 @@ patches = ["redox.patch"]
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
COOKBOOK_CONFIGURE="cmake"
|
||||
COOKBOOK_CONFIGURE_FLAGS=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_CROSSCOMPILING=True
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-static"
|
||||
-DCMAKE_INSTALL_PREFIX="/"
|
||||
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_SYSTEM_PROCESSOR="$(echo "${TARGET}" | cut -d - -f1)"
|
||||
-DCMAKE_VERBOSE_MAKEFILE=On
|
||||
-DCMAKE_C_STANDARD=99
|
||||
-DBUILD_TESTING=OFF
|
||||
"${COOKBOOK_SOURCE}"
|
||||
DYNAMIC_INIT
|
||||
|
||||
COOKBOOK_CMAKE_FLAGS=(
|
||||
-DBUILD_TESTING=Off
|
||||
)
|
||||
cookbook_configure
|
||||
cookbook_cmake
|
||||
"""
|
||||
|
||||
@ -1,14 +1,43 @@
|
||||
diff -ruwN a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt 2023-05-19 13:21:01.000000000 +0200
|
||||
+++ b/CMakeLists.txt 2024-10-23 18:01:06.574850622 +0200
|
||||
diff -ruwN source/CMakeLists.txt source-new/CMakeLists.txt
|
||||
--- source/CMakeLists.txt 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/CMakeLists.txt 2025-07-22 01:48:56.591286953 +0700
|
||||
@@ -1,3 +1,4 @@
|
||||
+set (CMAKE_CXX_STANDARD 99)
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
|
||||
if(POLICY CMP0091)
|
||||
diff -ruwN a/src/unix/core.c b/src/unix/core.c
|
||||
--- a/src/unix/core.c 2023-05-19 13:21:01.000000000 +0200
|
||||
+++ b/src/unix/core.c 2024-10-23 18:01:06.575850644 +0200
|
||||
@@ -312,6 +313,17 @@
|
||||
src/unix/hurd.c)
|
||||
endif()
|
||||
|
||||
+
|
||||
+if(CMAKE_SYSTEM_NAME STREQUAL "UnixPaths") # Redox
|
||||
+ list(APPEND uv_libraries dl)
|
||||
+ list(APPEND uv_sources
|
||||
+ src/unix/no-fsevents.c
|
||||
+ src/unix/proctitle.c
|
||||
+ src/unix/posix-hrtime.c
|
||||
+ src/unix/posix-poll.c
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
list(APPEND uv_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
|
||||
list(APPEND uv_libraries dl rt)
|
||||
diff -ruwN source/include/uv/unix.h source-new/include/uv/unix.h
|
||||
--- source/include/uv/unix.h 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/include/uv/unix.h 2025-07-22 01:53:54.941276543 +0700
|
||||
@@ -66,6 +66,7 @@
|
||||
defined(__MSYS__) || \
|
||||
defined(__HAIKU__) || \
|
||||
defined(__QNX__) || \
|
||||
+ defined(__redox__) || \
|
||||
defined(__GNU__)
|
||||
# include "uv/posix.h"
|
||||
#endif
|
||||
diff -ruwN source/src/unix/core.c source-new/src/unix/core.c
|
||||
--- source/src/unix/core.c 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/src/unix/core.c 2025-07-21 22:55:16.826444959 +0700
|
||||
@@ -97,6 +97,10 @@
|
||||
# include <sanitizer/linux_syscall_hooks.h>
|
||||
#endif
|
||||
@ -30,9 +59,9 @@ diff -ruwN a/src/unix/core.c b/src/unix/core.c
|
||||
ssize_t rc;
|
||||
rc = recvmsg(fd, msg, flags | MSG_CMSG_CLOEXEC);
|
||||
if (rc == -1)
|
||||
diff -ruwN a/src/unix/fs.c b/src/unix/fs.c
|
||||
--- a/src/unix/fs.c 2023-05-19 13:21:01.000000000 +0200
|
||||
+++ b/src/unix/fs.c 2024-10-23 18:01:06.579850732 +0200
|
||||
diff -ruwN source/src/unix/fs.c source-new/src/unix/fs.c
|
||||
--- source/src/unix/fs.c 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/src/unix/fs.c 2025-07-21 22:55:16.826444959 +0700
|
||||
@@ -87,7 +87,8 @@
|
||||
defined(__MVS__) || \
|
||||
defined(__NetBSD__) || \
|
||||
@ -69,9 +98,26 @@ diff -ruwN a/src/unix/fs.c b/src/unix/fs.c
|
||||
stat_fs->f_type = 0; /* f_type is not supported. */
|
||||
#else
|
||||
stat_fs->f_type = buf.f_type;
|
||||
diff -ruwN a/src/unix/stream.c b/src/unix/stream.c
|
||||
--- a/src/unix/stream.c 2023-05-19 13:21:01.000000000 +0200
|
||||
+++ b/src/unix/stream.c 2024-10-23 18:01:06.580850754 +0200
|
||||
diff -ruwN source/src/unix/proctitle.c source-new/src/unix/proctitle.c
|
||||
--- source/src/unix/proctitle.c 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/src/unix/proctitle.c 2025-07-22 02:10:12.760625178 +0700
|
||||
@@ -30,7 +30,13 @@
|
||||
size_t cap; /* Maximum capacity. Computed once in uv_setup_args(). */
|
||||
};
|
||||
|
||||
+#if defined(__redox__)
|
||||
+void uv__set_process_title(const char* title) {
|
||||
+ // requires sys/prctl
|
||||
+}
|
||||
+#else
|
||||
extern void uv__set_process_title(const char* title);
|
||||
+#endif
|
||||
|
||||
static uv_mutex_t process_title_mutex;
|
||||
static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
|
||||
diff -ruwN source/src/unix/stream.c source-new/src/unix/stream.c
|
||||
--- source/src/unix/stream.c 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/src/unix/stream.c 2025-07-21 22:55:16.826444959 +0700
|
||||
@@ -29,7 +29,14 @@
|
||||
#include <errno.h>
|
||||
|
||||
@ -103,9 +149,9 @@ diff -ruwN a/src/unix/stream.c b/src/unix/stream.c
|
||||
|
||||
union uv__cmsg {
|
||||
struct cmsghdr hdr;
|
||||
diff -ruwN a/src/unix/udp.c b/src/unix/udp.c
|
||||
--- a/src/unix/udp.c 2023-05-19 13:21:01.000000000 +0200
|
||||
+++ b/src/unix/udp.c 2024-10-23 18:08:23.796492449 +0200
|
||||
diff -ruwN source/src/unix/udp.c source-new/src/unix/udp.c
|
||||
--- source/src/unix/udp.c 2023-05-19 18:21:01.000000000 +0700
|
||||
+++ source-new/src/unix/udp.c 2025-07-21 22:55:16.826444959 +0700
|
||||
@@ -31,6 +31,12 @@
|
||||
#include <xti.h>
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user