Include upstream v8 fix for ppc64[le]

Disable debug build on ppc64[le] and s390x

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2018-05-10 09:56:20 -04:00
parent f94eb9eb75
commit 200f9491aa
No known key found for this signature in database
GPG Key ID: 7A25556236BAA3A3
2 changed files with 143 additions and 1 deletions

View File

@ -0,0 +1,128 @@
From a0048de40ceb91e0bf7b0ffd6eb5054c41b3a4a6 Mon Sep 17 00:00:00 2001
From: Junliang Yan <jyan@ca.ibm.com>
Date: Wed, 9 May 2018 18:39:49 -0400
Subject: [PATCH 3/3] [PATCH] PPC: use pc-relative address to init constpool
reg
R=joransiu@ca.ibm.com
Change-Id: I67364f29d494b09786a14b13743f73bef4b64582
Reviewed-on: https://chromium-review.googlesource.com/950242
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51750}
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
deps/v8/src/ppc/macro-assembler-ppc.cc | 14 ++++++++++----
deps/v8/src/ppc/macro-assembler-ppc.h | 9 +++++----
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/deps/v8/src/ppc/macro-assembler-ppc.cc b/deps/v8/src/ppc/macro-assembler-ppc.cc
index 68efa84c72c7f6d781d508183b53ea83024944d1..3192e9cefb1c1b116c5e12b5c52e7971b92a111a 100644
--- a/deps/v8/src/ppc/macro-assembler-ppc.cc
+++ b/deps/v8/src/ppc/macro-assembler-ppc.cc
@@ -166,11 +166,11 @@ void TurboAssembler::Call(Register target) {
DCHECK_EQ(CallSize(target), SizeOfCodeGeneratedSince(&start));
}
void MacroAssembler::CallJSEntry(Register target) {
- DCHECK(target == ip);
+ CHECK(target == r5);
Call(target);
}
int TurboAssembler::CallSize(Address target, RelocInfo::Mode rmode,
Condition cond) {
@@ -823,20 +823,27 @@ void TurboAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
srawi(dst_high, src_high, shift);
}
}
#endif
-void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
+void TurboAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress(
Register code_target_address) {
lwz(kConstantPoolRegister,
MemOperand(code_target_address,
Code::kConstantPoolOffset - Code::kHeaderSize));
add(kConstantPoolRegister, kConstantPoolRegister, code_target_address);
}
+void TurboAssembler::LoadPC(Register dst) {
+ b(4, SetLK);
+ mflr(dst);
+}
+
void TurboAssembler::LoadConstantPoolPointerRegister() {
- mov_label_addr(kConstantPoolRegister, ConstantPoolPosition());
+ LoadPC(kConstantPoolRegister);
+ add_label_offset(kConstantPoolRegister, kConstantPoolRegister,
+ ConstantPoolPosition(), -pc_offset() + 4);
}
void TurboAssembler::StubPrologue(StackFrame::Type type) {
{
ConstantPoolUnavailableScope constant_pool_unavailable(this);
@@ -848,11 +855,10 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) {
set_constant_pool_available(true);
}
}
void TurboAssembler::Prologue() {
- DCHECK(base != no_reg);
PushStandardFrame(r4);
if (FLAG_enable_embedded_constant_pool) {
// base contains prologue address
LoadConstantPoolPointerRegister();
set_constant_pool_available(true);
diff --git a/deps/v8/src/ppc/macro-assembler-ppc.h b/deps/v8/src/ppc/macro-assembler-ppc.h
index f4d9afd47f150f9cd2e840c20a61e965a5d8f5f5..32e6219c41bbbfe8427e05f2f9a02ff800efcffb 100644
--- a/deps/v8/src/ppc/macro-assembler-ppc.h
+++ b/deps/v8/src/ppc/macro-assembler-ppc.h
@@ -214,10 +214,11 @@ class TurboAssembler : public Assembler {
void LoadSingle(DoubleRegister dst, const MemOperand& mem,
Register scratch = no_reg);
void LoadSingleU(DoubleRegister dst, const MemOperand& mem,
Register scratch = no_reg);
+ void LoadPC(Register dst);
void StoreDouble(DoubleRegister src, const MemOperand& mem,
Register scratch = no_reg);
void StoreDoubleU(DoubleRegister src, const MemOperand& mem,
Register scratch = no_reg);
@@ -639,10 +640,14 @@ class TurboAssembler : public Assembler {
// Call a code stub.
void CallStubDelayed(CodeStub* stub);
void LoadConstantPoolPointerRegister();
+
+ // Loads the constant pool pointer (kConstantPoolRegister).
+ void LoadConstantPoolPointerRegisterFromCodeTargetAddress(
+ Register code_target_address);
void AbortConstantPoolBuilding() {
#ifdef DEBUG
// Avoid DCHECK(!is_linked()) failure in ~Label()
bind(ConstantPoolPosition());
#endif
@@ -733,14 +738,10 @@ class MacroAssembler : public TurboAssembler {
// Push and pop the registers that can hold pointers, as defined by the
// RegList constant kSafepointSavedRegisters.
void PushSafepointRegisters();
void PopSafepointRegisters();
- // Loads the constant pool pointer (kConstantPoolRegister).
- void LoadConstantPoolPointerRegisterFromCodeTargetAddress(
- Register code_target_address);
-
// Flush the I-cache from asm code. You should use CpuFeatures::FlushICache
// from C.
// Does not handle errors.
void FlushICache(Register address, size_t size, Register scratch);
--
2.17.0

View File

@ -1,5 +1,11 @@
%global with_debug 1 %global with_debug 1
# PowerPC and s390x segfault during Debug builds
# https://github.com/nodejs/node/issues/20642
%ifarch %{ppc} s390x
%global with_debug 0
%endif
# bundle dependencies that are not available as Fedora modules # bundle dependencies that are not available as Fedora modules
# %%{!?_with_bootstrap: %%global bootstrap 1} # %%{!?_with_bootstrap: %%global bootstrap 1}
# use bcond for building modules # use bcond for building modules
@ -18,7 +24,7 @@
%global nodejs_patch 0 %global nodejs_patch 0
%global nodejs_abi %{nodejs_major}.%{nodejs_minor} %global nodejs_abi %{nodejs_major}.%{nodejs_minor}
%global nodejs_version %{nodejs_major}.%{nodejs_minor}.%{nodejs_patch} %global nodejs_version %{nodejs_major}.%{nodejs_minor}.%{nodejs_patch}
%global nodejs_release 1 %global nodejs_release 2
# == Bundled Dependency Versions == # == Bundled Dependency Versions ==
# v8 - from deps/v8/include/v8-version.h # v8 - from deps/v8/include/v8-version.h
@ -115,6 +121,9 @@ Patch1: 0001-Disable-running-gyp-files-for-bundled-deps.patch
# This does bad things on an RPM-managed npm. # This does bad things on an RPM-managed npm.
Patch3: no-npm-update-msg.patch Patch3: no-npm-update-msg.patch
# Fix PowerPC builds
Patch4: 0003-PATCH-PPC-use-pc-relative-address-to-init-constpool-.patch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: gcc >= 4.9.4 BuildRequires: gcc >= 4.9.4
@ -265,6 +274,7 @@ rm -rf deps/zlib
%patch3 -p1 %patch3 -p1
%patch4 -p1
%build %build
# build with debugging symbols and add defines from libuv (#892601) # build with debugging symbols and add defines from libuv (#892601)
@ -476,6 +486,10 @@ NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/nod
%{_pkgdocdir}/npm/doc %{_pkgdocdir}/npm/doc
%changelog %changelog
* Thu May 10 2018 Stephen Gallagher <sgallagh@redhat.com> - 1:10.1.0-2
- Include upstream v8 fix for ppc64[le]
- Disable debug build on ppc64[le] and s390x
* Wed May 09 2018 Stephen Gallagher <sgallagh@redhat.com> - 1:10.1.0-1 * Wed May 09 2018 Stephen Gallagher <sgallagh@redhat.com> - 1:10.1.0-1
- Update to 10.1.0 - Update to 10.1.0
- https://nodejs.org/en/blog/release/v10.1.0/ - https://nodejs.org/en/blog/release/v10.1.0/