1 |
commit: 84408e5274c751b6c52d06850449821acf355e87 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 29 14:06:02 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 29 14:06:10 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84408e52 |
7 |
|
8 |
dev-libs/libffi: fix ppc64 build, bug 713596 |
9 |
|
10 |
Backport fixes for older power targets without explicit __int128 support. |
11 |
|
12 |
Reported-by: Agostino Sarubbo |
13 |
Closes: https://bugs.gentoo.org/713596 |
14 |
Package-Manager: Portage-2.3.96, Repoman-2.3.22 |
15 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
16 |
|
17 |
.../libffi/files/libffi-3.3-power7-memcpy-2.patch | 28 +++++++++++++++ |
18 |
.../libffi/files/libffi-3.3-power7-memcpy.patch | 42 ++++++++++++++++++++++ |
19 |
dev-libs/libffi/libffi-3.3-r1.ebuild | 2 ++ |
20 |
3 files changed, 72 insertions(+) |
21 |
|
22 |
diff --git a/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch b/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..d9d47acb618 |
25 |
--- /dev/null |
26 |
+++ b/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch |
27 |
@@ -0,0 +1,28 @@ |
28 |
+From 6663047f56c2932a6b10a790f4ac6666dd181326 Mon Sep 17 00:00:00 2001 |
29 |
+From: Anthony Green <green@××××××××××.com> |
30 |
+Date: Fri, 29 Nov 2019 07:00:35 -0500 |
31 |
+Subject: [PATCH] Address platforms with no __int128. |
32 |
+ |
33 |
+--- |
34 |
+ src/powerpc/ffi_linux64.c | 4 ++-- |
35 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
36 |
+ |
37 |
+diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c |
38 |
+index de0d033..7364770 100644 |
39 |
+--- a/src/powerpc/ffi_linux64.c |
40 |
++++ b/src/powerpc/ffi_linux64.c |
41 |
+@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) |
42 |
+ if (next_arg.ul == gpr_end.ul) |
43 |
+ next_arg.ul = rest.ul; |
44 |
+ if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) |
45 |
+- *vec_base.f128++ = **p_argv.f128; |
46 |
++ memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); |
47 |
+ else |
48 |
+- *next_arg.f128 = **p_argv.f128; |
49 |
++ memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); |
50 |
+ if (++next_arg.f128 == gpr_end.f128) |
51 |
+ next_arg.f128 = rest.f128; |
52 |
+ vecarg_count++; |
53 |
+-- |
54 |
+2.26.0 |
55 |
+ |
56 |
|
57 |
diff --git a/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch b/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch |
58 |
new file mode 100644 |
59 |
index 00000000000..91f9a6f60fa |
60 |
--- /dev/null |
61 |
+++ b/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch |
62 |
@@ -0,0 +1,42 @@ |
63 |
+From e50b9ef8b910fa642ef158f6642e60d54d7ad740 Mon Sep 17 00:00:00 2001 |
64 |
+From: Khem Raj <raj.khem@×××××.com> |
65 |
+Date: Sat, 7 Dec 2019 02:34:14 -0800 |
66 |
+Subject: [PATCH] powerpc64: Use memcpy to help platforms with no __int128. |
67 |
+ (#534) |
68 |
+ |
69 |
+Signed-off-by: Khem Raj <raj.khem@×××××.com> |
70 |
+--- |
71 |
+ src/powerpc/ffi_linux64.c | 8 ++++---- |
72 |
+ 1 file changed, 4 insertions(+), 4 deletions(-) |
73 |
+ |
74 |
+diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c |
75 |
+index 7364770..4d50878 100644 |
76 |
+--- a/src/powerpc/ffi_linux64.c |
77 |
++++ b/src/powerpc/ffi_linux64.c |
78 |
+@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) |
79 |
+ { |
80 |
+ if (vecarg_count < NUM_VEC_ARG_REGISTERS64 |
81 |
+ && i < nfixedargs) |
82 |
+- *vec_base.f128++ = *arg.f128++; |
83 |
++ memcpy (vec_base.f128++, arg.f128, sizeof (float128)); |
84 |
+ else |
85 |
+- *next_arg.f128 = *arg.f128++; |
86 |
++ memcpy (next_arg.f128, arg.f128++, sizeof (float128)); |
87 |
+ if (++next_arg.f128 == gpr_end.f128) |
88 |
+ next_arg.f128 = rest.f128; |
89 |
+ vecarg_count++; |
90 |
+@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif, |
91 |
+ do |
92 |
+ { |
93 |
+ if (pvec < end_pvec && i < nfixedargs) |
94 |
+- *to.f128 = *pvec++; |
95 |
++ memcpy (to.f128, pvec++, sizeof (float128)); |
96 |
+ else |
97 |
+- *to.f128 = *from.f128; |
98 |
++ memcpy (to.f128, from.f128, sizeof (float128)); |
99 |
+ to.f128++; |
100 |
+ from.f128++; |
101 |
+ } |
102 |
+-- |
103 |
+2.26.0 |
104 |
+ |
105 |
|
106 |
diff --git a/dev-libs/libffi/libffi-3.3-r1.ebuild b/dev-libs/libffi/libffi-3.3-r1.ebuild |
107 |
index cbc8682f8c1..79f1d5d690e 100644 |
108 |
--- a/dev-libs/libffi/libffi-3.3-r1.ebuild |
109 |
+++ b/dev-libs/libffi/libffi-3.3-r1.ebuild |
110 |
@@ -28,6 +28,8 @@ PATCHES=( |
111 |
"${FILESDIR}"/${PN}-3.2.1-o-tmpfile-eacces.patch #529044 |
112 |
"${FILESDIR}"/${PN}-3.3_rc0-ppc-macos-go.patch |
113 |
"${FILESDIR}"/${PN}-3.3-power7.patch |
114 |
+ "${FILESDIR}"/${PN}-3.3-power7-memcpy.patch |
115 |
+ "${FILESDIR}"/${PN}-3.3-power7-memcpy-2.patch |
116 |
) |
117 |
|
118 |
S=${WORKDIR}/${MY_P} |