patches: bump to 12.22.6, 14.17.6 and 16.8.0

This commit is contained in:
Jesse Chan 2021-09-05 14:24:02 +08:00
parent 0e2cdcd76d
commit 980c8a21aa
4 changed files with 75 additions and 80 deletions

View File

@ -401,6 +401,26 @@ index 0000000000..fb2d47f52b
'lib/internal/bootstrap/pre_execution.js',
'lib/internal/bootstrap/switches/does_own_process_state.js',
'lib/internal/bootstrap/switches/does_not_own_process_state.js',
@@ -430,6 +431,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
--- node/src/inspector_agent.cc
+++ node/src/inspector_agent.cc
@@ -760,8 +760,6 @@ bool Agent::Start(const std::string& path,
@ -551,10 +571,9 @@ index 0000000000..fb2d47f52b
// calls elsewhere in the program (e.g., any logging from V8.)
setvbuf(stdout, nullptr, _IONBF, 0);
setvbuf(stderr, nullptr, _IONBF, 0);
- return node::Start(argc, argv);
+ return reorder(argc, argv);
}
#endif
+}
+#endif
+
+#include <string.h>
+
@ -594,8 +613,8 @@ index 0000000000..fb2d47f52b
+ argv[i] = &args[pos];
+ pos += strlen(argv[i]) + 1;
+ }
+ return node::Start(argc, argv);
+}
return node::Start(argc, argv);
}
+
+volatile char* BAKERY = (volatile char*) "\0// BAKERY // BAKERY " \
+ "// BAKERY // BAKERY // BAKERY // BAKERY // BAKERY // BAKERY " \
@ -604,7 +623,7 @@ index 0000000000..fb2d47f52b
+
+#ifdef __clang__
+__attribute__((optnone))
+#endif
#endif
+int reorder(int argc, char** argv) {
+ int i;
+ char** nargv = new char*[argc + 64];
@ -646,25 +665,3 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',

View File

@ -290,6 +290,26 @@ index 0000000000..fb2d47f52b
'lib/internal/bootstrap/pre_execution.js',
'lib/internal/bootstrap/switches/does_own_process_state.js',
'lib/internal/bootstrap/switches/does_not_own_process_state.js',
@@ -446,6 +447,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
--- node/src/inspector_agent.cc
+++ node/src/inspector_agent.cc
@@ -684,8 +684,6 @@ bool Agent::Start(const std::string& path,
@ -534,25 +554,3 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',

View File

@ -253,6 +253,28 @@ index 0000000000..fb2d47f52b
} catch (e) {
throw e; /* node-do-not-add-exception-line */
}
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',
--- node/src/inspector_agent.cc
+++ node/src/inspector_agent.cc
@@ -681,8 +681,6 @@ bool Agent::Start(const std::string& path,
@ -310,7 +332,7 @@ index 0000000000..fb2d47f52b
using v8::Value;
using v8::WeakCallbackInfo;
using v8::WeakCallbackType;
@@ -707,11 +708,12 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -709,11 +710,12 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
Local<ArrayBufferView> cached_data_buf;
bool produce_cached_data = false;
Local<Context> parsing_context = context;
@ -324,7 +346,7 @@ index 0000000000..fb2d47f52b
CHECK(args[2]->IsNumber());
line_offset = args[2].As<Int32>()->Value();
CHECK(args[3]->IsNumber());
@@ -730,6 +732,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -732,6 +734,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
CHECK_NOT_NULL(sandbox);
parsing_context = sandbox->context();
}
@ -332,7 +354,7 @@ index 0000000000..fb2d47f52b
}
ContextifyScript* contextify_script =
@@ -782,6 +785,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -784,6 +787,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
ShouldNotAbortOnUncaughtScope no_abort_scope(env);
Context::Scope scope(parsing_context);
@ -343,7 +365,7 @@ index 0000000000..fb2d47f52b
MaybeLocal<UnboundScript> v8_script = ScriptCompiler::CompileUnboundScript(
isolate,
&source,
@@ -798,6 +805,13 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -800,6 +807,13 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
contextify_script);
return;
}
@ -357,7 +379,7 @@ index 0000000000..fb2d47f52b
contextify_script->script_.Reset(isolate, v8_script.ToLocalChecked());
Local<Context> env_context = env->context();
@@ -824,6 +838,11 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
@@ -826,6 +840,11 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
env->cached_data_produced_string(),
Boolean::New(isolate, cached_data_produced)).Check();
}
@ -487,25 +509,3 @@ index 0000000000..fb2d47f52b
'cflags_cc!': [ '-fno-rtti' ],
}],
[ 'OS == "mac" or OS == "ios"', {
--- node/node.gyp
+++ node/node.gyp
@@ -236,6 +236,19 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
+ [ 'enable_lto=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ # man ld -export_dynamic:
+ # Preserves all global symbols in main executables during LTO.
+ # Without this option, Link Time Optimization is allowed to
+ # inline and remove global functions. This option is used when
+ # a main executable may load a plug-in which requires certain
+ # symbols from the main executable.
+ '-Wl,-export_dynamic',
+ ],
+ },
+ }],
['OS=="win"', {
'libraries': [
'Dbghelp.lib',

View File

@ -1,7 +1,7 @@
{
"v16.7.0": ["node.v16.7.0.cpp.patch"],
"v14.17.5": ["node.v14.17.5.cpp.patch"],
"v12.22.5": ["node.v12.22.5.cpp.patch"],
"v16.8.0": ["node.v16.8.0.cpp.patch"],
"v14.17.6": ["node.v14.17.6.cpp.patch"],
"v12.22.6": ["node.v12.22.6.cpp.patch"],
"v10.24.1": ["node.v10.24.1.cpp.patch"],
"v8.17.0": ["node.v8.17.0.cpp.patch"]
}