Fredrik Fornwall
5 years ago
16 changed files with 171 additions and 213 deletions
@ -0,0 +1,12 @@ |
|||||
|
diff -u -r ../node-v12.1.0/configure.py ./configure.py
|
||||
|
--- ../node-v12.1.0/configure.py 2019-04-29 12:57:51.000000000 +0000
|
||||
|
+++ ./configure.py 2019-05-05 21:21:04.289245037 +0000
|
||||
|
@@ -931,7 +931,7 @@
|
||||
|
else target_arch != host_arch) |
||||
|
want_snapshots = not options.without_snapshot |
||||
|
o['variables']['want_separate_host_toolset'] = int( |
||||
|
- cross_compiling and want_snapshots)
|
||||
|
+ cross_compiling)
|
||||
|
|
||||
|
if options.with_node_snapshot: |
||||
|
o['variables']['node_use_node_snapshot'] = 'true' |
@ -0,0 +1,14 @@ |
|||||
|
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 @@
|
||||
|
|
||||
|
/* 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"; |
||||
|
#endif |
@ -1,20 +0,0 @@ |
|||||
--- ../linux-syscalls.c.orig 2019-04-01 12:59:57.770124746 +0000
|
|
||||
+++ ./deps/uv/src/unix/linux-syscalls.c 2019-04-01 13:00:38.703457159 +0000
|
|
||||
@@ -187,7 +187,7 @@
|
|
||||
# endif |
|
||||
#endif /* __NR_pwritev */ |
|
||||
|
|
||||
-#ifndef __NR_statx
|
|
||||
+#if !defined(__NR_statx) && !defined(__ANDROID__)
|
|
||||
# if defined(__x86_64__) |
|
||||
# define __NR_statx 332 |
|
||||
# elif defined(__i386__) |
|
||||
@@ -358,7 +358,7 @@
|
|
||||
int flags, |
|
||||
unsigned int mask, |
|
||||
struct uv__statx* statxbuf) { |
|
||||
-#if defined(__NR_statx)
|
|
||||
+#if defined(__NR_statx) && !defined(__ANDROID__)
|
|
||||
return syscall(__NR_statx, dirfd, path, flags, mask, statxbuf); |
|
||||
#else |
|
||||
return errno = ENOSYS, -1; |
|
@ -1,31 +0,0 @@ |
|||||
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 @@
|
|
||||
_exit(127); |
|
||||
} |
|
||||
|
|
||||
- if (options->flags & (UV_PROCESS_SETUID | UV_PROCESS_SETGID)) {
|
|
||||
- /* When dropping privileges from root, the `setgroups` call will
|
|
||||
- * remove any extraneous groups. If we don't call this, then
|
|
||||
- * even though our uid has dropped, we may still have groups
|
|
||||
- * that enable us to do super-user things. This will fail if we
|
|
||||
- * aren't root, so don't bother checking the return value, this
|
|
||||
- * is just done as an optimistic privilege dropping function.
|
|
||||
- */
|
|
||||
- SAVE_ERRNO(setgroups(0, NULL));
|
|
||||
- }
|
|
||||
-
|
|
||||
- if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid)) {
|
|
||||
- uv__write_int(error_fd, UV__ERR(errno));
|
|
||||
- _exit(127);
|
|
||||
- }
|
|
||||
-
|
|
||||
- if ((options->flags & UV_PROCESS_SETUID) && setuid(options->uid)) {
|
|
||||
- uv__write_int(error_fd, UV__ERR(errno));
|
|
||||
- _exit(127);
|
|
||||
- }
|
|
||||
-
|
|
||||
if (options->env != NULL) { |
|
||||
environ = options->env; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
diff -u -r ../node-v10.9.0/deps/v8/gypfiles/v8.gyp ./deps/v8/gypfiles/v8.gyp
|
|
||||
--- ../node-v10.9.0/deps/v8/gypfiles/v8.gyp 2018-08-15 13:53:24.000000000 +0000
|
|
||||
+++ ./deps/v8/gypfiles/v8.gyp 2018-08-23 21:43:30.588264328 +0000
|
|
||||
@@ -2053,8 +2053,7 @@
|
|
||||
# library order and break (see crbug.com/469973). |
|
||||
# These libraries do not exist on Mac hosted builds. |
|
||||
'libraries': [ |
|
||||
- '-ldl',
|
|
||||
- '-lrt'
|
|
||||
+ '-ldl'
|
|
||||
] |
|
||||
}] |
|
||||
] |
|
@ -0,0 +1,12 @@ |
|||||
|
diff -u -r ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h
|
||||
|
--- ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h 2019-08-20 17:14:50.000000000 +0000
|
||||
|
+++ ./deps/v8/src/flags/flag-definitions.h 2019-08-24 22:38:43.754905700 +0000
|
||||
|
@@ -1373,7 +1373,7 @@
|
||||
|
DEFINE_BOOL(perf_prof_unwinding_info, false, |
||||
|
"Enable unwinding info for perf linux profiler (experimental).") |
||||
|
DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info) |
||||
|
-DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
|
||||
|
+DEFINE_STRING(gc_fake_mmap, "/@TERMUX_PREFIX@/tmp/__v8_gc__",
|
||||
|
"Specify the name of the file for fake gc mmap used in ll_prof") |
||||
|
DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") |
||||
|
DEFINE_IMPLICATION(log_internal_timer_events, prof) |
@ -0,0 +1,12 @@ |
|||||
|
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 @@
|
||||
|
FILE* perf_output_handle_; |
||||
|
}; |
||||
|
|
||||
|
-const char PerfBasicLogger::kFilenameFormatString[] = "/tmp/perf-%d.map";
|
||||
|
+const char PerfBasicLogger::kFilenameFormatString[] = "@TERMUX_PREFIX@/tmp/perf-%d.map";
|
||||
|
// Extra space for the PID in the filename |
||||
|
const int PerfBasicLogger::kFilenameBufferPadding = 16; |
||||
|
|
@ -1,38 +0,0 @@ |
|||||
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 @@
|
|
||||
|
|
||||
/* 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"; |
|
||||
#endif |
|
||||
diff -uNr node-v8.4.0/deps/v8/src/flag-definitions.h node-v8.4.0.mod/deps/v8/src/flag-definitions.h
|
|
||||
--- node-v8.4.0/deps/v8/src/flag-definitions.h 2017-08-15 19:42:30.000000000 +0300
|
|
||||
+++ node-v8.4.0.mod/deps/v8/src/flag-definitions.h 2017-09-14 16:12:34.462856137 +0300
|
|
||||
@@ -1203,7 +1203,7 @@
|
|
||||
DEFINE_BOOL(perf_prof_unwinding_info, false, |
|
||||
"Enable unwinding info for perf linux profiler (experimental).") |
|
||||
DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info) |
|
||||
-DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
|
|
||||
+DEFINE_STRING(gc_fake_mmap, "@TERMUX_PREFIX@/tmp/__v8_gc__",
|
|
||||
"Specify the name of the file for fake gc mmap used in ll_prof") |
|
||||
DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") |
|
||||
DEFINE_BOOL(log_timer_events, false, |
|
||||
diff -uNr node-v8.4.0/deps/v8/src/log.cc node-v8.4.0.mod/deps/v8/src/log.cc
|
|
||||
--- node-v8.4.0/deps/v8/src/log.cc 2017-08-15 19:42:31.000000000 +0300
|
|
||||
+++ node-v8.4.0.mod/deps/v8/src/log.cc 2017-09-14 16:11:05.192856201 +0300
|
|
||||
@@ -233,7 +233,7 @@
|
|
||||
FILE* perf_output_handle_; |
|
||||
}; |
|
||||
|
|
||||
-const char PerfBasicLogger::kFilenameFormatString[] = "/tmp/perf-%d.map";
|
|
||||
+const char PerfBasicLogger::kFilenameFormatString[] = "@TERMUX_PREFIX@/tmp/perf-%d.map";
|
|
||||
// Extra space for the PID in the filename |
|
||||
const int PerfBasicLogger::kFilenameBufferPadding = 16; |
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
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
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
#include <stdint.h> |
||||
|
#include <sys/sysinfo.h> |
||||
|
|
||||
|
+#ifndef __ANDROID__
|
||||
|
uint64_t uv_get_free_memory(void) { |
||||
|
struct sysinfo info; |
||||
|
|
||||
|
@@ -40,3 +41,4 @@
|
||||
|
return (uint64_t) info.totalram * info.mem_unit; |
||||
|
return 0; |
||||
|
} |
||||
|
+#endif
|
@ -1,37 +0,0 @@ |
|||||
diff -u -r ../node-v10.9.0/src/node.cc ./src/node.cc
|
|
||||
--- ../node-v10.9.0/src/node.cc 2018-08-15 13:53:34.000000000 +0000
|
|
||||
+++ ./src/node.cc 2018-08-23 20:49:59.353995878 +0000
|
|
||||
@@ -106,7 +106,7 @@
|
|
||||
#include <unistd.h> // setuid, getuid |
|
||||
#endif |
|
||||
|
|
||||
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
|
||||
#include <pwd.h> // getpwnam() |
|
||||
#include <grp.h> // getgrnam() |
|
||||
#endif |
|
||||
@@ -690,7 +690,7 @@
|
|
||||
|
|
||||
// Look up environment variable unless running as setuid root. |
|
||||
bool SafeGetenv(const char* key, std::string* text) { |
|
||||
-#if !defined(__CloudABI__) && !defined(_WIN32)
|
|
||||
+#if !defined(__CloudABI__) && !defined(_WIN32) && !defined(__ANDROID__)
|
|
||||
if (linux_at_secure || getuid() != geteuid() || getgid() != getegid()) |
|
||||
goto fail; |
|
||||
#endif |
|
||||
@@ -2402,13 +2402,13 @@
|
|
||||
env->SetMethod(process, "reallyExit", Exit); |
|
||||
env->SetMethodNoSideEffect(process, "uptime", Uptime); |
|
||||
|
|
||||
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
|
||||
env->SetMethodNoSideEffect(process, "getuid", GetUid); |
|
||||
env->SetMethodNoSideEffect(process, "geteuid", GetEUid); |
|
||||
env->SetMethodNoSideEffect(process, "getgid", GetGid); |
|
||||
env->SetMethodNoSideEffect(process, "getegid", GetEGid); |
|
||||
env->SetMethodNoSideEffect(process, "getgroups", GetGroups); |
|
||||
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#endif // __POSIX__ && !defined(__CloudABI__)
|
|
||||
} |
|
||||
|
|
||||
|
|
@ -1,21 +1,12 @@ |
|||||
diff -u -r ../node-v8.12.0/src/node_internals.h ./src/node_internals.h
|
diff -u -r ../node-v11.7.0/src/node_internals.h ./src/node_internals.h
|
||||
--- ../node-v8.12.0/src/node_internals.h 2018-09-10 18:47:03.000000000 +0000
|
--- ../node-v11.7.0/src/node_internals.h 2019-01-17 21:27:16.000000000 +0000
|
||||
+++ ./src/node_internals.h 2018-09-18 03:11:24.361303054 +0000
|
+++ ./src/node_internals.h 2019-01-18 22:44:06.207542176 +0000
|
||||
@@ -433,7 +433,7 @@
|
@@ -358,7 +358,7 @@
|
||||
void Umask(const v8::FunctionCallbackInfo<v8::Value>& args); |
|
||||
void Uptime(const v8::FunctionCallbackInfo<v8::Value>& args); |
// Functions defined in node.cc that are exposed via the bootstrapper object |
||||
|
|
||||
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
||||
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
||||
void SetGid(const v8::FunctionCallbackInfo<v8::Value>& args); |
#define NODE_IMPLEMENTS_POSIX_CREDENTIALS 1 |
||||
void SetEGid(const v8::FunctionCallbackInfo<v8::Value>& args); |
#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__) |
||||
void SetUid(const v8::FunctionCallbackInfo<v8::Value>& args); |
|
||||
@@ -445,7 +445,7 @@
|
|
||||
void GetEUid(const v8::FunctionCallbackInfo<v8::Value>& args); |
|
||||
void GetEGid(const v8::FunctionCallbackInfo<v8::Value>& args); |
|
||||
void GetGroups(const v8::FunctionCallbackInfo<v8::Value>& args); |
|
||||
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#endif // __POSIX__ && !defined(__CloudABI__)
|
|
||||
|
|
||||
} // namespace node |
|
||||
|
|
||||
|
@ -1,29 +0,0 @@ |
|||||
diff -u -r ../node-v10.9.0/src/node_process.cc ./src/node_process.cc
|
|
||||
--- ../node-v10.9.0/src/node_process.cc 2018-08-15 13:53:35.000000000 +0000
|
|
||||
+++ ./src/node_process.cc 2018-08-23 23:40:53.046488108 +0000
|
|
||||
@@ -20,7 +20,7 @@
|
|
||||
#include <unistd.h> // setuid, getuid |
|
||||
#endif |
|
||||
|
|
||||
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
|
||||
#include <pwd.h> // getpwnam() |
|
||||
#include <grp.h> // getgrnam() |
|
||||
#endif |
|
||||
@@ -247,7 +247,7 @@
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
|
||||
|
|
||||
static const uid_t uid_not_found = static_cast<uid_t>(-1); |
|
||||
static const gid_t gid_not_found = static_cast<gid_t>(-1); |
|
||||
@@ -546,6 +546,6 @@
|
|
||||
return env->ThrowErrnoException(errno, "initgroups"); |
|
||||
} |
|
||||
|
|
||||
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
||||
+#endif // __POSIX__ && !defined(__CloudABI__)
|
|
||||
|
|
||||
} // namespace node |
|
@ -0,0 +1,11 @@ |
|||||
|
diff -u -r ../node-v12.9.0/tools/v8_gypfiles/v8.gyp ./tools/v8_gypfiles/v8.gyp
|
||||
|
--- ../node-v12.9.0/tools/v8_gypfiles/v8.gyp 2019-08-20 17:14:53.000000000 +0000
|
||||
|
+++ ./tools/v8_gypfiles/v8.gyp 2019-08-24 22:02:57.943558855 +0000
|
||||
|
@@ -1010,6 +1010,7 @@
|
||||
|
'<(V8_ROOT)/src/base/platform/platform-posix.h', |
||||
|
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc', |
||||
|
'<(V8_ROOT)/src/base/platform/platform-posix-time.h', |
||||
|
+ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
|
||||
|
], |
||||
|
'conditions': [ |
||||
|
['_toolset=="host"', { |
Loading…
Reference in new issue