Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump nodejs #8

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions packages/nodejs/assembly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff -uNr node-v16.6.1/deps/v8/src/heap/base/asm/arm/push_registers_asm.cc node-v16.6.1.mod/deps/v8/src/heap/base/asm/arm/push_registers_asm.cc
--- node-v16.6.1/deps/v8/src/heap/base/asm/arm/push_registers_asm.cc 2021-08-03 05:54:24.000000000 +0000
+++ node-v16.6.1.mod/deps/v8/src/heap/base/asm/arm/push_registers_asm.cc 2021-08-08 05:05:06.799014090 +0000
@@ -17,6 +17,7 @@
// Calling convention source:
// https://en.wikipedia.org/wiki/Calling_convention#ARM_(A32)
// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka4127.html
+#ifndef __ANDROID__
asm(".globl PushAllRegistersAndIterateStack \n"
".type PushAllRegistersAndIterateStack, %function \n"
".hidden PushAllRegistersAndIterateStack \n"
@@ -37,3 +38,4 @@
" add sp, sp, #36 \n"
// Pop lr into pc which returns and switches mode if needed.
" pop {pc} \n");
+#endif
diff -uNr node-v16.6.1/deps/v8/src/heap/base/asm/arm64/push_registers_asm.cc node-v16.6.1.mod/deps/v8/src/heap/base/asm/arm64/push_registers_asm.cc
--- node-v16.6.1/deps/v8/src/heap/base/asm/arm64/push_registers_asm.cc 2021-08-03 05:54:24.000000000 +0000
+++ node-v16.6.1.mod/deps/v8/src/heap/base/asm/arm64/push_registers_asm.cc 2021-08-08 05:03:48.607570595 +0000
@@ -31,12 +31,14 @@
".p2align 2 \n"
"PushAllRegistersAndIterateStack: \n"
#endif // !defined(__APPLE__)
+#ifndef __ANDROID__
// x19-x29 are callee-saved.
" stp x19, x20, [sp, #-16]! \n"
" stp x21, x22, [sp, #-16]! \n"
" stp x23, x24, [sp, #-16]! \n"
" stp x25, x26, [sp, #-16]! \n"
" stp x27, x28, [sp, #-16]! \n"
+
#ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY
// Sign return address.
" paciasp \n"
@@ -60,3 +62,4 @@
// Drop all callee-saved registers.
" add sp, sp, #80 \n"
" ret \n");
+#endif
diff -uNr node-v16.6.1/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc node-v16.6.1.mod/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc
--- node-v16.6.1/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc 2021-08-03 05:54:24.000000000 +0000
+++ node-v16.6.1.mod/deps/v8/src/heap/base/asm/x64/push_registers_asm.cc 2021-08-08 03:01:21.030263715 +0000
@@ -16,6 +16,7 @@
// GN toolchain (e.g. ChromeOS) and not provide them.
// _WIN64 Defined as 1 when the compilation target is 64-bit ARM or x64.
// Otherwise, undefined.
+#ifndef __ANDROID__
#ifdef _WIN64

// We maintain 16-byte alignment at calls. There is an 8-byte return address
@@ -104,3 +105,4 @@
" ret \n");

#endif // !_WIN64
+#endif
16 changes: 8 additions & 8 deletions packages/nodejs/avoid-ficlone-ioctl.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
diff -uNr node-v13.0.0/deps/uv/src/unix/fs.c node-v13.0.0.mod/deps/uv/src/unix/fs.c
--- node-v13.0.0/deps/uv/src/unix/fs.c 2019-10-22 17:23:28.000000000 +0300
+++ node-v13.0.0.mod/deps/uv/src/unix/fs.c 2020-01-16 02:27:44.944603915 +0200
@@ -1048,6 +1048,7 @@
goto out;

diff -uNr ./deps/uv/src/unix/fs.c ./deps/uv/src/unix/fs.c.mod
--- ./deps/uv/src/unix/fs.c 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/uv/src/unix/fs.c.mod 2021-06-18 20:05:49.675642773 +0530
@@ -1247,6 +1247,7 @@
#endif /* !__linux__ */
}

+#ifndef __ANDROID__
#ifdef FICLONE
if (req->flags & UV_FS_COPYFILE_FICLONE ||
req->flags & UV_FS_COPYFILE_FICLONE_FORCE) {
@@ -1072,7 +1073,7 @@
@@ -1267,6 +1268,7 @@
goto out;
}
#endif
-
+#endif

bytes_to_send = src_statsbuf.st_size;
in_offset = 0;
while (bytes_to_send != 0) {
12 changes: 9 additions & 3 deletions packages/nodejs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
# Note: package build may fail on Github Actions CI due to out-of-memory
# condition. It should be built locally instead.
TERMUX_PKG_VERSION=14.15.4
TERMUX_PKG_REVISION=2
TERMUX_PKG_VERSION=16.6.1
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=adb7ecf66c74b52a14a08cc22bb0f9aedc157cac1ac93240f7f455e8c8edec9c
TERMUX_PKG_SHA256=79b1ea058cc67f2a69462cd5f2467a1efe08c64299c053da70384ce1a0e3e557
# Note that we do not use a shared libuv to avoid an issue with the Android
# linker, which does not use symbols of linked shared libraries when resolving
# symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.
Expand Down Expand Up @@ -74,6 +73,13 @@ termux_step_configure() {
termux_error_exit "Unsupported arch '$TERMUX_ARCH'"
fi

if [ "$TERMUX_ARCH" != i686 ]; then
suhan-paradkar marked this conversation as resolved.
Show resolved Hide resolved
rm -rf $TERMUX_PKG_SRCDIR/deps/v8/src/heap/base/asm/x64
mv $TERMUX_PKG_SRCDIR/deps/v8/src/heap/base/asm/$DEST_CPU $TERMUX_PKG_SRCDIR/deps/v8/src/heap/base/asm/x64
fi

LDFLAGS+=" -ldl"

export GYP_DEFINES="host_os=linux"
export CC_host=gcc
export CXX_host=g++
Expand Down
10 changes: 4 additions & 6 deletions packages/nodejs/deps-uv-src-unix-core.c.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
diff -uNr node-v8.4.0/deps/uv/src/unix/core.c node-v8.4.0.mod/deps/uv/src/unix/core.c
--- node-v8.4.0/deps/uv/src/unix/core.c 2017-08-15 19:42:28.000000000 +0300
+++ node-v8.4.0.mod/deps/uv/src/unix/core.c 2017-09-14 16:13:27.292856099 +0300
@@ -1112,7 +1112,9 @@
diff -uNr ./deps/uv/src/unix/core.c ./deps/uv/src/unix/core.c.mod
--- ./deps/uv/src/unix/core.c 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/uv/src/unix/core.c.mod 2021-06-18 20:10:13.705642672 +0530
@@ -1116,7 +1116,7 @@

/* No temp environment variables defined */
#if defined(__ANDROID__)
- buf = "/data/local/tmp";
+ // Don't use '/data/local/tmp' in Termux
+ //buf = "/data/local/tmp";
+ buf = "@TERMUX_PREFIX@/tmp";
#else
buf = "/tmp";
Expand Down
7 changes: 3 additions & 4 deletions packages/nodejs/deps-uv-src-unix-process.c.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -uNr node-v12.10.0/deps/uv/src/unix/process.c node-v12.10.0.mod/deps/uv/src/unix/process.c
--- node-v12.10.0/deps/uv/src/unix/process.c 2019-09-04 18:36:23.000000000 +0300
+++ node-v12.10.0.mod/deps/uv/src/unix/process.c 2019-09-23 01:39:39.069030779 +0300
@@ -351,27 +351,6 @@
--- ./deps/uv/src/unix/process.c 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/uv/src/unix/process.c.mod 2021-06-18 20:15:54.095642543 +0530
@@ -281,27 +281,6 @@
_exit(127);
}

Expand Down
9 changes: 4 additions & 5 deletions packages/nodejs/deps-uv-uv.gyp.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -u -r ../node-v9.7.1/deps/uv/uv.gyp ./deps/uv/uv.gyp
--- ../node-v9.7.1/deps/uv/uv.gyp 2018-03-02 01:58:02.000000000 +0000
+++ ./deps/uv/uv.gyp 2018-03-05 10:51:15.530165566 +0000
@@ -39,7 +39,7 @@
--- ./deps/uv/uv.gyp 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/uv/uv.gyp.mod 2021-06-18 20:21:23.955642417 +0530
@@ -40,7 +40,7 @@
{
'target_name': 'libuv',
'type': '<(uv_library)',
Expand All @@ -10,7 +9,7 @@ diff -u -r ../node-v9.7.1/deps/uv/uv.gyp ./deps/uv/uv.gyp
'include',
'src/',
],
@@ -54,7 +54,7 @@
@@ -55,7 +55,7 @@
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],
Expand Down
13 changes: 13 additions & 0 deletions packages/nodejs/deps-v8-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -uNr node-v16.6.1/deps/v8/BUILD.gn node-v16.6.1.mod/deps/v8/BUILD.gn
--- node-v16.6.1/deps/v8/BUILD.gn 2021-08-03 05:54:24.000000000 +0000
+++ node-v16.6.1.mod/deps/v8/BUILD.gn 2021-08-07 15:26:13.212360709 +0000
@@ -10,6 +10,9 @@
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")

+v8_target_cpu = getenv("DEST_CPU")
suhan-paradkar marked this conversation as resolved.
Show resolved Hide resolved
+target_cpu = getenv("DEST_CPU")
+
if (is_android) {
import("//build/config/android/rules.gni")
}
7 changes: 3 additions & 4 deletions packages/nodejs/deps-v8-src-flags-flag-definitions.h.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -u -r ../node-v14.0.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h
--- ../node-v14.0.0/deps/v8/src/flags/flag-definitions.h 2020-04-21 11:38:50.000000000 +0000
+++ ./deps/v8/src/flags/flag-definitions.h 2020-04-28 23:22:24.894254000 +0000
@@ -1555,7 +1555,7 @@
--- ./deps/v8/src/flags/flag-definitions.h 2021-06-03 07:15:31.000000000 +0530
+++ ./deps/v8/src/flags/flag-definitions.h.mod 2021-06-18 20:24:38.915642342 +0530
@@ -1842,7 +1842,7 @@
#undef DEFINE_PERF_PROF_BOOL
#undef DEFINE_PERF_PROF_IMPLICATION

Expand Down
7 changes: 3 additions & 4 deletions packages/nodejs/deps-v8-src-logging-log.cc.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -u -r ../node-v12.9.0/deps/v8/src/logging/log.cc ./deps/v8/src/logging/log.cc
--- ../node-v12.9.0/deps/v8/src/logging/log.cc 2019-08-20 17:14:50.000000000 +0000
+++ ./deps/v8/src/logging/log.cc 2019-08-24 22:39:52.426124955 +0000
@@ -280,7 +280,7 @@
--- ./deps/v8/src/logging/log.cc 2021-06-03 07:15:31.000000000 +0530
+++ ./deps/v8/src/logging/log.cc.mod 2021-06-18 20:27:34.605642275 +0530
@@ -291,7 +291,7 @@
FILE* perf_output_handle_;
};

Expand Down
12 changes: 7 additions & 5 deletions packages/nodejs/fix_multiple_definitions.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c
--- node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c 2019-05-22 15:21:52.000000000 +0300
+++ node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c 2019-05-28 15:37:28.698418026 +0300
--- ./deps/uv/src/unix/sysinfo-memory.c 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/uv/src/unix/sysinfo-memory.c.mod 2021-06-18 20:31:00.255642197 +0530
@@ -25,6 +25,7 @@
#include <stdint.h>
#include <sys/sysinfo.h>
Expand All @@ -9,8 +8,11 @@ diff -uNr node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c node-v12.3.1.mod/deps/u
uint64_t uv_get_free_memory(void) {
struct sysinfo info;

@@ -40,3 +41,4 @@
return (uint64_t) info.totalram * info.mem_unit;
@@ -32,6 +33,7 @@
return (uint64_t) info.freeram * info.mem_unit;
return 0;
}
+#endif

uint64_t uv_get_total_memory(void) {
struct sysinfo info;
7 changes: 3 additions & 4 deletions packages/nodejs/lib-child_process.js.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
diff -u -r ../node-v6.2.0/lib/child_process.js ./lib/child_process.js
--- ../node-v6.2.0/lib/child_process.js 2016-05-17 15:53:06.000000000 -0400
+++ ./lib/child_process.js 2016-05-18 16:31:45.574685443 -0400
@@ -335,7 +335,7 @@
--- ./lib/child_process.js 2021-06-03 07:15:32.000000000 +0530
+++ ./lib/child_process.js.mod 2021-06-18 20:32:47.215642156 +0530
@@ -520,7 +520,7 @@
if (typeof options.shell === 'string')
file = options.shell;
else if (process.platform === 'android')
Expand Down
11 changes: 5 additions & 6 deletions packages/nodejs/lib-os.js.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
diff -u -r ../node-v10.9.0/lib/os.js ./lib/os.js
--- ../node-v10.9.0/lib/os.js 2018-08-15 13:53:34.000000000 +0000
+++ ./lib/os.js 2018-08-23 20:42:39.611186774 +0000
@@ -130,7 +130,7 @@
--- ./lib/os.js 2021-06-03 07:15:32.000000000 +0530
+++ ./lib/os.js.mod 2021-06-18 20:34:28.215642118 +0530
@@ -183,7 +183,7 @@
path = safeGetenv('TMPDIR') ||
safeGetenv('TMP') ||
safeGetenv('TEMP') ||
- '/tmp';
+ '@TERMUX_PREFIX@/tmp';
if (path.length > 1 && path.endsWith('/'))
path = path.slice(0, -1);
if (path.length > 1 && StringPrototypeEndsWith(path, '/'))
path = StringPrototypeSlice(path, 0, -1);
}
29 changes: 2 additions & 27 deletions packages/nodejs/no-android-log.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr node-v14.0.0/deps/v8/BUILD.gn node-v14.0.0.mod/deps/v8/BUILD.gn
--- node-v14.0.0/deps/v8/BUILD.gn 2020-04-21 11:38:50.000000000 +0000
+++ node-v14.0.0.mod/deps/v8/BUILD.gn 2020-05-07 14:11:12.247429516 +0000
--- ./deps/v8/BUILD.gn 2021-06-03 07:15:30.000000000 +0530
+++ ./deps/v8/BUILD.gn.mod 2021-06-18 20:42:14.845641940 +0530
@@ -28,7 +28,7 @@

declare_args() {
Expand All @@ -10,27 +9,3 @@ diff -uNr node-v14.0.0/deps/v8/BUILD.gn node-v14.0.0.mod/deps/v8/BUILD.gn

# Dynamically set an additional dependency from v8/custom_deps.
v8_custom_deps = ""
diff -uNr node-v14.0.0/deps/v8/infra/mb/mb_config.pyl node-v14.0.0.mod/deps/v8/infra/mb/mb_config.pyl
--- node-v14.0.0/deps/v8/infra/mb/mb_config.pyl 2020-04-21 11:38:50.000000000 +0000
+++ node-v14.0.0.mod/deps/v8/infra/mb/mb_config.pyl 2020-05-07 14:12:44.653746359 +0000
@@ -565,7 +565,7 @@

'mixins': {
'android': {
- 'gn_args': 'target_os="android" v8_android_log_stdout=true',
+ 'gn_args': 'target_os="android" v8_android_log_stdout=false',
},

'android_strip_outputs': {
diff -uNr node-v14.0.0/src/debug_utils.cc node-v14.0.0.mod/src/debug_utils.cc
--- node-v14.0.0/src/debug_utils.cc 2020-04-21 11:38:51.000000000 +0000
+++ node-v14.0.0.mod/src/debug_utils.cc 2020-05-07 14:12:00.694741330 +0000
@@ -500,7 +500,7 @@

WriteConsoleW(handle, wbuf.data(), n, nullptr, nullptr);
return;
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) && !defined(__TERMUX__)
if (file == stderr) {
__android_log_print(ANDROID_LOG_ERROR, "nodejs", "%s", str.data());
return;
25 changes: 16 additions & 9 deletions packages/nodejs/node.gyp.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
--- ./node.gyp.orig 2020-10-17 18:07:04.114992036 +0000
+++ ./node.gyp 2020-10-17 18:30:04.575629963 +0000
@@ -1201,101 +1201,6 @@
}],
diff -uNr node-v16.6.1/node.gyp node-v16.6.1.mod/node.gyp
--- node-v16.6.1/node.gyp 2021-08-03 05:54:26.000000000 +0000
+++ node-v16.6.1.mod/node.gyp 2021-08-07 05:43:34.342341704 +0000
@@ -1062,107 +1062,6 @@
],
}, # fuzz_env
- {
{
- 'target_name': 'cctest',
- 'type': 'executable',
-
- 'dependencies': [
- '<(node_lib_target_name)',
- 'deps/googletest/googletest.gyp:gtest',
- 'deps/googletest/googletest.gyp:gtest_main',
- 'deps/histogram/histogram.gyp:histogram',
- 'deps/uvwasi/uvwasi.gyp:uvwasi',
- 'node_dtrace_header',
Expand Down Expand Up @@ -40,16 +42,16 @@
- 'sources': [
- 'src/node_snapshot_stub.cc',
- 'src/node_code_cache_stub.cc',
- 'test/cctest/gtest/gtest-all.cc',
- 'test/cctest/gtest/gtest_main.cc',
- 'test/cctest/node_test_fixture.cc',
- 'test/cctest/node_test_fixture.h',
- 'test/cctest/test_aliased_buffer.cc',
- 'test/cctest/test_base64.cc',
- 'test/cctest/test_base_object_ptr.cc',
- 'test/cctest/test_node_postmortem_metadata.cc',
- 'test/cctest/test_environment.cc',
- 'test/cctest/test_js_native_api_v8.cc',
- 'test/cctest/test_linked_binding.cc',
- 'test/cctest/test_node_api.cc',
- 'test/cctest/test_per_process.cc',
- 'test/cctest/test_platform.cc',
- 'test/cctest/test_json_utils.cc',
Expand All @@ -64,6 +66,9 @@
- 'defines': [
- 'HAVE_OPENSSL=1',
- ],
- 'sources': [
- 'test/cctest/test_node_crypto.cc',
- ]
- }],
- ['v8_enable_inspector==1', {
- 'sources': [
Expand Down Expand Up @@ -99,6 +104,8 @@
- }],
- ],
- }, # cctest
{
-
- {
'target_name': 'embedtest',
'type': 'executable',

29 changes: 0 additions & 29 deletions packages/nodejs/npm-link-patch.patch

This file was deleted.

12 changes: 0 additions & 12 deletions packages/nodejs/src-cares_wrap.cc.patch

This file was deleted.

Loading