From b7bb69be0233e5becdb28dcbd1244fb589f9efc2 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 11 Sep 2026 01:58:09 +0700 Subject: [PATCH] Patch libuv and nodejs for compiling with clang --- recipes/libs/libuv/redox.patch | 11 +++++++++++ recipes/wip/dev/lang/nodejs-21/recipe.toml | 4 ++++ recipes/wip/dev/lang/nodejs-21/redox.patch | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/recipes/libs/libuv/redox.patch b/recipes/libs/libuv/redox.patch index 7de642842..ba8cd5e62 100644 --- a/recipes/libs/libuv/redox.patch +++ b/recipes/libs/libuv/redox.patch @@ -128,6 +128,17 @@ diff -ruwN source/src/unix/fs.c source-new/src/unix/fs.c stat_fs->f_type = 0; /* f_type is not supported. */ #else stat_fs->f_type = buf.f_type; +diff -ruwN source/src/unix/process.c source-new/src/unix/process.c +--- source/src/unix/process.c 2025-04-25 09:50:27.000000000 +0000 ++++ source-new/src/unix/process.c 2026-09-10 14:04:01.547065156 +0000 +@@ -22,6 +22,7 @@ + #include "uv.h" + #include "internal.h" + ++#include + #include + #include + #include diff -ruwN source/src/unix/proctitle.c source-new/src/unix/proctitle.c --- source/src/unix/proctitle.c 2025-04-25 16:50:27.000000000 +0700 +++ source-new/src/unix/proctitle.c 2025-10-10 11:18:29.025229760 +0700 diff --git a/recipes/wip/dev/lang/nodejs-21/recipe.toml b/recipes/wip/dev/lang/nodejs-21/recipe.toml index 0ba9d4c0a..b28a29c3c 100644 --- a/recipes/wip/dev/lang/nodejs-21/recipe.toml +++ b/recipes/wip/dev/lang/nodejs-21/recipe.toml @@ -26,7 +26,11 @@ dev-dependencies = [ script = """ DYNAMIC_INIT export PYTHONDONTWRITEBYTECODE=1 COOKBOOK_NOSTRIP=true +if [[ "$REDOXER_USE_CLANG" != "1" && "$REDOXER_USE_CLANG" != "true" ]]; then export CC_host="$CC_WRAPPER gcc" CXX_host="$CC_WRAPPER g++" +else +export CC_host="$CC_WRAPPER clang" CXX_host="$CC_WRAPPER clang++" LDFLAGS_host="-fuse-ld=lld" +fi rsync -av "${COOKBOOK_SOURCE}/" ./ diff --git a/recipes/wip/dev/lang/nodejs-21/redox.patch b/recipes/wip/dev/lang/nodejs-21/redox.patch index 8a96055f2..b8cac9d47 100644 --- a/recipes/wip/dev/lang/nodejs-21/redox.patch +++ b/recipes/wip/dev/lang/nodejs-21/redox.patch @@ -30,6 +30,28 @@ diff -ruwN source/configure.py source-new/configure.py valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', 'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64') valid_arm_float_abi = ('soft', 'softfp', 'hard') +diff -ruwN source/deps/simdjson/simdjson.h source-new/deps/simdjson/simdjson.h +--- source/deps/simdjson/simdjson.h 2024-04-10 12:46:12.000000000 +0000 ++++ source-new/deps/simdjson/simdjson.h 2026-09-10 23:01:55.280881826 +0000 +@@ -6257,15 +6257,15 @@ + simdjson_inline void one_char(char c); + + simdjson_inline void call_print_newline() { +- this->print_newline(); ++ static_cast(this)->print_newline(); + } + + simdjson_inline void call_print_indents(size_t depth) { +- this->print_indents(depth); ++ static_cast(this)->print_indents(depth); + } + + simdjson_inline void call_print_space() { +- this->print_space(); ++ static_cast(this)->print_space(); + } + + protected: diff -ruwN source/deps/v8/bazel/config/BUILD.bazel source-new/deps/v8/bazel/config/BUILD.bazel --- source/deps/v8/bazel/config/BUILD.bazel 2024-04-10 19:46:12.000000000 +0700 +++ source-new/deps/v8/bazel/config/BUILD.bazel 2025-10-10 15:52:40.317126983 +0700