1 |
commit: b7f0b35fe999748b088df5dd168e8b8fad7b2ff2 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 5 00:37:29 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 5 01:11:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7f0b35f |
7 |
|
8 |
dev-python/pypy3-exe: backport ppc64 patch to 3.7.2 |
9 |
|
10 |
Patches already upstream, fixes segfault on ppc64 |
11 |
https://foss.heptapod.net/pypy/pypy/-/issues/3309 |
12 |
|
13 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
14 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
15 |
|
16 |
.../files/pypy3-7.3.2-ppc64-segfault.patch | 64 ++++++++++++++++++++++ |
17 |
dev-python/pypy3-exe/pypy3-exe-7.3.2-r1.ebuild | 1 + |
18 |
dev-python/pypy3-exe/pypy3-exe-7.3.2_p37-r1.ebuild | 1 + |
19 |
3 files changed, 66 insertions(+) |
20 |
|
21 |
diff --git a/dev-python/pypy3-exe/files/pypy3-7.3.2-ppc64-segfault.patch b/dev-python/pypy3-exe/files/pypy3-7.3.2-ppc64-segfault.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..c143a3765cd |
24 |
--- /dev/null |
25 |
+++ b/dev-python/pypy3-exe/files/pypy3-7.3.2-ppc64-segfault.patch |
26 |
@@ -0,0 +1,64 @@ |
27 |
+From 913e0dae8ac7ce8219a5f31126fee8a794cc314c Mon Sep 17 00:00:00 2001 |
28 |
+From: Armin Rigo <arigo@×××××.org> |
29 |
+Date: Sat, 26 Sep 2020 09:26:24 +0200 |
30 |
+Subject: [PATCH] oops, fix for test_gc_indexed_box_plus_large_offset |
31 |
+ |
32 |
+--- |
33 |
+ rpython/jit/backend/ppc/opassembler.py | 16 +++++++++++----- |
34 |
+ rpython/jit/backend/ppc/regalloc.py | 4 ++-- |
35 |
+ 2 files changed, 13 insertions(+), 7 deletions(-) |
36 |
+ |
37 |
+diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py |
38 |
+index b79b18e530..4bbfbba93a 100644 |
39 |
+--- a/rpython/jit/backend/ppc/opassembler.py |
40 |
++++ b/rpython/jit/backend/ppc/opassembler.py |
41 |
+@@ -755,13 +755,19 @@ class FieldOpAssembler(object): |
42 |
+ def _apply_offset(self, index_loc, ofs_loc): |
43 |
+ # If offset != 0 then we have to add it here. Note that |
44 |
+ # mc.addi() would not be valid with operand r0. |
45 |
+- assert ofs_loc.is_imm() # must be an immediate... |
46 |
+- assert _check_imm_arg(ofs_loc.getint()) # ...that fits 16 bits |
47 |
+ assert index_loc.is_core_reg() |
48 |
+ assert index_loc is not r.SCRATCH2 |
49 |
+- # (simplified version of _apply_scale()) |
50 |
+- if ofs_loc.value > 0: |
51 |
+- self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value) |
52 |
++ if ofs_loc.is_imm(): |
53 |
++ # if it is an immediate, it must fit into 16 bits |
54 |
++ assert _check_imm_arg(ofs_loc.getint()) |
55 |
++ # (simplified version of _apply_scale()) |
56 |
++ if ofs_loc.value != 0: |
57 |
++ self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value) |
58 |
++ index_loc = r.SCRATCH2 |
59 |
++ else: |
60 |
++ # larger immediates are loaded into a register in regalloc.py |
61 |
++ assert ofs_loc.is_core_reg() |
62 |
++ self.mc.add(r.SCRATCH2.value, index_loc.value, ofs_loc.value) |
63 |
+ index_loc = r.SCRATCH2 |
64 |
+ return index_loc |
65 |
+ |
66 |
+diff --git a/rpython/jit/backend/ppc/regalloc.py b/rpython/jit/backend/ppc/regalloc.py |
67 |
+index f3ee1129e4..827953cf12 100644 |
68 |
+--- a/rpython/jit/backend/ppc/regalloc.py |
69 |
++++ b/rpython/jit/backend/ppc/regalloc.py |
70 |
+@@ -771,7 +771,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc): |
71 |
+ value_loc = self.ensure_reg(op.getarg(2)) |
72 |
+ assert op.getarg(3).getint() == 1 # scale |
73 |
+ ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(4)) |
74 |
+- assert ofs_loc.is_imm() # the arg(4) should always be a small constant |
75 |
++ # the arg(4) is often a small constant, but it may be too large |
76 |
+ size_loc = self.ensure_reg_or_any_imm(op.getarg(5)) |
77 |
+ return [base_loc, index_loc, value_loc, ofs_loc, size_loc] |
78 |
+ |
79 |
+@@ -780,7 +780,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc): |
80 |
+ index_loc = self.ensure_reg(op.getarg(1)) |
81 |
+ assert op.getarg(2).getint() == 1 # scale |
82 |
+ ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(3)) |
83 |
+- assert ofs_loc.is_imm() # the arg(3) should always be a small constant |
84 |
++ # the arg(3) is often a small constant, but it may be too large |
85 |
+ self.free_op_vars() |
86 |
+ res_loc = self.force_allocate_reg(op) |
87 |
+ size_box = op.getarg(4) |
88 |
+-- |
89 |
+GitLab |
90 |
+ |
91 |
|
92 |
diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.2-r1.ebuild b/dev-python/pypy3-exe/pypy3-exe-7.3.2-r1.ebuild |
93 |
index 73313264113..26077ca69aa 100644 |
94 |
--- a/dev-python/pypy3-exe/pypy3-exe-7.3.2-r1.ebuild |
95 |
+++ b/dev-python/pypy3-exe/pypy3-exe-7.3.2-r1.ebuild |
96 |
@@ -37,6 +37,7 @@ BDEPEND=" |
97 |
|
98 |
PATCHES=( |
99 |
"${FILESDIR}"/pypy3-7.3.2-sethostname-bytes.patch |
100 |
+ "${FILESDIR}"/pypy3-7.3.2-ppc64-segfault.patch |
101 |
) |
102 |
|
103 |
check_env() { |
104 |
|
105 |
diff --git a/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37-r1.ebuild b/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37-r1.ebuild |
106 |
index 592f395defc..4fe37f8704e 100644 |
107 |
--- a/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37-r1.ebuild |
108 |
+++ b/dev-python/pypy3-exe/pypy3-exe-7.3.2_p37-r1.ebuild |
109 |
@@ -38,6 +38,7 @@ BDEPEND=" |
110 |
|
111 |
PATCHES=( |
112 |
"${FILESDIR}"/pypy3-7.3.2-sethostname-bytes.patch |
113 |
+ "${FILESDIR}"/pypy3-7.3.2-ppc64-segfault.patch |
114 |
) |
115 |
|
116 |
check_env() { |