summaryrefslogtreecommitdiff
path: root/net-libs/nodejs/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
commit908778078736bd36f7a60a2d576d415cb8e000fa (patch)
treec6a4796c48b608c14dc7e9674cdbd38f905e3c15 /net-libs/nodejs/files
parent185fa19bbf68a4d4dca534d2b46729207a177f16 (diff)
gentoo resync : 22.05.2021
Diffstat (limited to 'net-libs/nodejs/files')
-rw-r--r--net-libs/nodejs/files/nodejs-12.22.1-jinja_collections_abc.patch95
-rw-r--r--net-libs/nodejs/files/nodejs-13.2.0-paxmarking.patch71
-rw-r--r--net-libs/nodejs/files/nodejs-16.1.0-ppc64-segfault.patch119
3 files changed, 214 insertions, 71 deletions
diff --git a/net-libs/nodejs/files/nodejs-12.22.1-jinja_collections_abc.patch b/net-libs/nodejs/files/nodejs-12.22.1-jinja_collections_abc.patch
new file mode 100644
index 000000000000..5f0df09b6e2e
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-12.22.1-jinja_collections_abc.patch
@@ -0,0 +1,95 @@
+--- a/deps/v8/third_party/jinja2/tests.py
++++ b/deps/v8/third_party/jinja2/tests.py
+@@ -10,7 +10,7 @@
+ """
+ import operator
+ import re
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.runtime import Undefined
+ from jinja2._compat import text_type, string_types, integer_types
+ import decimal
+--- a/deps/v8/third_party/jinja2/runtime.py
++++ b/deps/v8/third_party/jinja2/runtime.py
+@@ -315,7 +315,7 @@ class Context(with_metaclass(ContextMeta)):
+
+ # register the context as mapping if possible
+ try:
+- from collections import Mapping
++ from collections.abc import Mapping
+ Mapping.register(Context)
+ except ImportError:
+ pass
+--- a/deps/v8/third_party/jinja2/sandbox.py
++++ b/deps/v8/third_party/jinja2/sandbox.py
+@@ -14,7 +14,7 @@
+ """
+ import types
+ import operator
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.environment import Environment
+ from jinja2.exceptions import SecurityError
+ from jinja2._compat import string_types, PY2
+@@ -79,7 +79,7 @@ except ImportError:
+ pass
+
+ #: register Python 2.6 abstract base classes
+-from collections import MutableSet, MutableMapping, MutableSequence
++from collections.abc import MutableSet, MutableMapping, MutableSequence
+ _mutable_set_types += (MutableSet,)
+ _mutable_mapping_types += (MutableMapping,)
+ _mutable_sequence_types += (MutableSequence,)
+--- a/deps/v8/third_party/jinja2/utils.py
++++ b/deps/v8/third_party/jinja2/utils.py
+@@ -482,7 +482,7 @@ class LRUCache(object):
+
+ # register the LRU cache as mutable mapping if possible
+ try:
+- from collections import MutableMapping
++ from collections.abc import MutableMapping
+ MutableMapping.register(LRUCache)
+ except ImportError:
+ pass
+--- a/tools/inspector_protocol/jinja2/runtime.py
++++ b/tools/inspector_protocol/jinja2/runtime.py
+@@ -315,7 +315,7 @@ class Context(with_metaclass(ContextMeta)):
+
+ # register the context as mapping if possible
+ try:
+- from collections import Mapping
++ from collections.abc import Mapping
+ Mapping.register(Context)
+ except ImportError:
+ pass
+--- a/tools/inspector_protocol/jinja2/sandbox.py
++++ b/tools/inspector_protocol/jinja2/sandbox.py
+@@ -14,7 +14,7 @@
+ """
+ import types
+ import operator
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.environment import Environment
+ from jinja2.exceptions import SecurityError
+ from jinja2._compat import string_types, PY2
+@@ -79,7 +79,7 @@ except ImportError:
+ pass
+
+ #: register Python 2.6 abstract base classes
+-from collections import MutableSet, MutableMapping, MutableSequence
++from collections.abc import MutableSet, MutableMapping, MutableSequence
+ _mutable_set_types += (MutableSet,)
+ _mutable_mapping_types += (MutableMapping,)
+ _mutable_sequence_types += (MutableSequence,)
+--- a/tools/inspector_protocol/jinja2/tests.py
++++ b/tools/inspector_protocol/jinja2/tests.py
+@@ -10,7 +10,7 @@
+ """
+ import operator
+ import re
+-from collections import Mapping
++from collections.abc import Mapping
+ from jinja2.runtime import Undefined
+ from jinja2._compat import text_type, string_types, integer_types
+ import decimal
diff --git a/net-libs/nodejs/files/nodejs-13.2.0-paxmarking.patch b/net-libs/nodejs/files/nodejs-13.2.0-paxmarking.patch
deleted file mode 100644
index 1061255e1637..000000000000
--- a/net-libs/nodejs/files/nodejs-13.2.0-paxmarking.patch
+++ /dev/null
@@ -1,71 +0,0 @@
- Bug: 694100
- Add actions for pax marking mkcodecache and node_mksnapshot
- to disable mprotect for pax enable kernel.
- Reported-by: Attila Tóth <atoth@atoth.sote.hu>
- Co-developed-by: Attila Tóth <atoth@atoth.sote.hu>
- Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-
---- a/node.gyp 2019-10-23 11:52:41.000000000 +0200
-+++ a/node.gyp 2019-11-12 20:58:43.957881862 +0100
-@@ -233,7 +233,9 @@
- 'deps/acorn-plugins/acorn-static-class-features/index.js',
- ],
- 'node_mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_mksnapshot<(EXECUTABLE_SUFFIX)',
-+ 'node_mksnapshot_u_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_mksnapshot_u<(EXECUTABLE_SUFFIX)',
- 'mkcodecache_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkcodecache<(EXECUTABLE_SUFFIX)',
-+ 'mkcodecache_u_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkcodecache_u<(EXECUTABLE_SUFFIX)',
- 'conditions': [
- [ 'node_shared=="true"', {
- 'node_target_type%': 'shared_library',
-@@ -436,10 +438,24 @@
- ],
- 'actions': [
- {
-+ 'action_name': 'run_pax_mkcodecache',
-+ 'inputs': [
-+ '<(mkcodecache_exec)',
-+ ],
-+ 'outputs': [
-+ '<(mkcodecache_u_exec)',
-+ ],
-+ 'action': [
-+ 'bash',
-+ '-c',
-+ 'mv <(mkcodecache_exec) <(mkcodecache_u_exec) && paxmark.sh m <(mkcodecache_u_exec)',
-+ ],
-+ },
-+ {
- 'action_name': 'run_mkcodecache',
- 'process_outputs_as_sources': 1,
- 'inputs': [
-- '<(mkcodecache_exec)',
-+ '<(mkcodecache_u_exec)',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
-@@ -461,10 +477,24 @@
- ],
- 'actions': [
- {
-+ 'action_name': 'run_pax_mksnapshot',
-+ 'inputs': [
-+ '<(node_mksnapshot_exec)',
-+ ],
-+ 'outputs': [
-+ '<(node_mksnapshot_u_exec)',
-+ ],
-+ 'action': [
-+ 'bash',
-+ '-c',
-+ 'mv <(node_mksnapshot_exec) <(node_mksnapshot_u_exec) && paxmark.sh m <(node_mksnapshot_u_exec)',
-+ ],
-+ },
-+ {
- 'action_name': 'node_mksnapshot',
- 'process_outputs_as_sources': 1,
- 'inputs': [
-- '<(node_mksnapshot_exec)',
-+ '<(node_mksnapshot_u_exec)',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
diff --git a/net-libs/nodejs/files/nodejs-16.1.0-ppc64-segfault.patch b/net-libs/nodejs/files/nodejs-16.1.0-ppc64-segfault.patch
new file mode 100644
index 000000000000..5ddd1fe7d08d
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-16.1.0-ppc64-segfault.patch
@@ -0,0 +1,119 @@
+From ca4bf75504d07db5e1e66ec5c867cd76c90268af Mon Sep 17 00:00:00 2001
+From: Junliang Yan <jyan@ca.ibm.ca>
+Date: Tue, 11 May 2021 08:57:03 -0400
+Subject: [PATCH] ppc: Prevent trampoline emission on deoptimization table generation
+
+The deoptimization table needs to be continuously, so we need to block
+trampoline pool emission during the whole process.
+
+bug: v8:11759
+Change-Id: Ie5e0ffe27dc8e6cdb18985dc2cf26bdadeff318f
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2881918
+Commit-Queue: Junliang Yan <junyan@redhat.com>
+Reviewed-by: Jakob Gruber <jgruber@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#74506}
+X-Gentoo-bug: https://bugs.gentoo.org/785751
+Backported by gyakovlev@gentoo.org
+---
+
+diff --git a/src/codegen/ppc/assembler-ppc.h b/src/codegen/ppc/assembler-ppc.h
+index 794b917..ae04118 100644
+--- a/deps/v8/src/codegen/ppc/assembler-ppc.h
++++ b/deps/v8/src/codegen/ppc/assembler-ppc.h
+@@ -195,6 +195,12 @@
+
+ void MaybeEmitOutOfLineConstantPool() { EmitConstantPool(); }
+
++ inline void CheckTrampolinePoolQuick(int extra_space = 0) {
++ if (pc_offset() >= next_trampoline_check_ - extra_space) {
++ CheckTrampolinePool();
++ }
++ }
++
+ // Label operations & relative jumps (PPUM Appendix D)
+ //
+ // Takes a branch opcode (cc) and a label (L) and generates
+@@ -1334,12 +1340,6 @@
+ }
+
+ inline void UntrackBranch();
+- void CheckTrampolinePoolQuick() {
+- if (pc_offset() >= next_trampoline_check_) {
+- CheckTrampolinePool();
+- }
+- }
+-
+ // Instruction generation
+ void a_form(Instr instr, DoubleRegister frt, DoubleRegister fra,
+ DoubleRegister frb, RCBit r);
+diff --git a/src/compiler/backend/code-generator.cc b/src/compiler/backend/code-generator.cc
+index 023e697..62e57fe 100644
+--- a/deps/v8/src/compiler/backend/code-generator.cc
++++ b/deps/v8/src/compiler/backend/code-generator.cc
+@@ -416,23 +416,29 @@
+ std::sort(deoptimization_exits_.begin(), deoptimization_exits_.end(), cmp);
+ }
+
+- for (DeoptimizationExit* exit : deoptimization_exits_) {
+- if (exit->emitted()) continue;
+- if (Deoptimizer::kSupportsFixedDeoptExitSizes) {
+- exit->set_deoptimization_id(next_deoptimization_id_++);
+- }
+- result_ = AssembleDeoptimizerCall(exit);
+- if (result_ != kSuccess) return;
++ {
++#ifdef V8_TARGET_ARCH_PPC64
++ v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
++ tasm());
++#endif
++ for (DeoptimizationExit* exit : deoptimization_exits_) {
++ if (exit->emitted()) continue;
++ if (Deoptimizer::kSupportsFixedDeoptExitSizes) {
++ exit->set_deoptimization_id(next_deoptimization_id_++);
++ }
++ result_ = AssembleDeoptimizerCall(exit);
++ if (result_ != kSuccess) return;
+
+- // UpdateDeoptimizationInfo expects lazy deopts to be visited in pc_offset
+- // order, which is always the case since they are added to
+- // deoptimization_exits_ in that order, and the optional sort operation
+- // above preserves that order.
+- if (exit->kind() == DeoptimizeKind::kLazy) {
+- int trampoline_pc = exit->label()->pos();
+- last_updated = safepoints()->UpdateDeoptimizationInfo(
+- exit->pc_offset(), trampoline_pc, last_updated,
+- exit->deoptimization_id());
++ // UpdateDeoptimizationInfo expects lazy deopts to be visited in pc_offset
++ // order, which is always the case since they are added to
++ // deoptimization_exits_ in that order, and the optional sort operation
++ // above preserves that order.
++ if (exit->kind() == DeoptimizeKind::kLazy) {
++ int trampoline_pc = exit->label()->pos();
++ last_updated = safepoints()->UpdateDeoptimizationInfo(
++ exit->pc_offset(), trampoline_pc, last_updated,
++ exit->deoptimization_id());
++ }
+ }
+ }
+
+diff --git a/src/compiler/backend/ppc/code-generator-ppc.cc b/src/compiler/backend/ppc/code-generator-ppc.cc
+index 3e4e94a..0281376 100644
+--- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
++++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
+@@ -4296,7 +4296,15 @@
+
+ void CodeGenerator::PrepareForDeoptimizationExits(
+ ZoneDeque<DeoptimizationExit*>* exits) {
+- // __ EmitConstantPool();
++ int total_size = 0;
++ for (DeoptimizationExit* exit : deoptimization_exits_) {
++ total_size += (exit->kind() == DeoptimizeKind::kLazy)
++ ? Deoptimizer::kLazyDeoptExitSize
++ : Deoptimizer::kNonLazyDeoptExitSize;
++ }
++
++ __ CheckTrampolinePoolQuick(total_size);
++ DCHECK(Deoptimizer::kSupportsFixedDeoptExitSizes);
+ }
+
+ void CodeGenerator::AssembleMove(InstructionOperand* source,