diff mbox series

[1/1] package/libffi: fix build failure on power7 and older

Message ID 20191223213610.142006-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/libffi: fix build failure on power7 and older | expand

Commit Message

Fabrice Fontaine Dec. 23, 2019, 9:36 p.m. UTC
Fixes:
 - http://autobuild.buildroot.org/results/3ab73995b8393592c0b147670d8ff7f8ebc8c79c

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ix-build-failure-on-power7-and-older.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/libffi/0005-powerpc-fix-build-failure-on-power7-and-older.patch

Comments

Thomas Petazzoni Dec. 23, 2019, 9:44 p.m. UTC | #1
On Mon, 23 Dec 2019 22:36:10 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fixes:
>  - http://autobuild.buildroot.org/results/3ab73995b8393592c0b147670d8ff7f8ebc8c79c
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

I just applied your previous patch tonight, so I guess this one needs
to replace the previous one, no ?

Thanks,

Thomas
Fabrice Fontaine Dec. 23, 2019, 9:49 p.m. UTC | #2
Hi Thomas,

Le lun. 23 déc. 2019 à 22:44, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a écrit :
>
> On Mon, 23 Dec 2019 22:36:10 +0100
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > Fixes:
> >  - http://autobuild.buildroot.org/results/3ab73995b8393592c0b147670d8ff7f8ebc8c79c
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
> I just applied your previous patch tonight, so I guess this one needs
> to replace the previous one, no ?
Nope, both patches are needed.
The previous one for _Float128 (not sent yet upstream) and this one
for __int128 (from upstream).
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice
Thomas Petazzoni Dec. 23, 2019, 10:17 p.m. UTC | #3
On Mon, 23 Dec 2019 22:49:28 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> > I just applied your previous patch tonight, so I guess this one needs
> > to replace the previous one, no ?  
> Nope, both patches are needed.
> The previous one for _Float128 (not sent yet upstream) and this one
> for __int128 (from upstream).

OK, thanks for the clarification. This float128/int128 stuff is quite
confusing.

Thomas
Thomas Petazzoni Dec. 26, 2019, 8:46 p.m. UTC | #4
Hello Fabrice,

On Mon, 23 Dec 2019 22:36:10 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fixes:
>  - http://autobuild.buildroot.org/results/3ab73995b8393592c0b147670d8ff7f8ebc8c79c
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...ix-build-failure-on-power7-and-older.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 package/libffi/0005-powerpc-fix-build-failure-on-power7-and-older.patch

Despite your recent PowerPC fixes for libffi, we still have failures:

http://autobuild.buildroot.net/?reason=libffi-3.3

../src/powerpc/ffi_linux64.c: In function 'ffi_prep_args64':
../src/powerpc/ffi_linux64.c:550:34: error: assignment to expression with array type
                 *vec_base.f128++ = **p_argv.f128;
                                  ^

Do you have any idea ?

Thanks,

Thomas
diff mbox series

Patch

diff --git a/package/libffi/0005-powerpc-fix-build-failure-on-power7-and-older.patch b/package/libffi/0005-powerpc-fix-build-failure-on-power7-and-older.patch
new file mode 100644
index 0000000000..d0b91dda68
--- /dev/null
+++ b/package/libffi/0005-powerpc-fix-build-failure-on-power7-and-older.patch
@@ -0,0 +1,39 @@ 
+From 01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Thu, 28 Nov 2019 12:42:41 +0000
+Subject: [PATCH] powerpc: fix build failure on power7 and older (#532)
+
+Build failure looks as:
+```
+libtool: compile:  powerpc-unknown-linux-gnu-gcc \
+    -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ...
+In file included from src/powerpc/ffi.c:33:
+src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target
+   65 | typedef __int128 float128;
+      |         ^~~~~~~~
+```
+
+The fix avoids using __int128 in favour of aligned char[16].
+
+Closes: https://github.com/libffi/libffi/issues/531
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+[Retrieved from:
+https://github.com/libffi/libffi/commit/01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/powerpc/ffi_powerpc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
+index 5ee2a709..8e2f2f0e 100644
+--- a/src/powerpc/ffi_powerpc.h
++++ b/src/powerpc/ffi_powerpc.h
+@@ -62,7 +62,7 @@ typedef _Float128 float128;
+ #elif defined(__FLOAT128__)
+ typedef __float128 float128;
+ #else
+-typedef __int128 float128;
++typedef char float128[16] __attribute__((aligned(16)));
+ #endif
+ 
+ void FFI_HIDDEN ffi_closure_SYSV (void);