Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From 4dc6cc961300b9deffb648b1237390a5bea1c6d6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Sergei Trofimovich <slyfox@gentoo.org> |
| 3 | Date: Thu, 28 Nov 2019 12:42:41 +0000 |
| 4 | Subject: [PATCH] powerpc: fix build failure on power7 and older (#532) |
| 5 | |
| 6 | Build failure looks as: |
| 7 | ``` |
| 8 | libtool: compile: powerpc-unknown-linux-gnu-gcc \ |
| 9 | -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ... |
| 10 | In file included from src/powerpc/ffi.c:33: |
| 11 | src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target |
| 12 | 65 | typedef __int128 float128; |
| 13 | | ^~~~~~~~ |
| 14 | ``` |
| 15 | |
| 16 | The fix avoids using __int128 in favour of aligned char[16]. |
| 17 | |
| 18 | Closes: https://github.com/libffi/libffi/issues/531 |
| 19 | Upstream-Status: Backport [https://github.com/libffi/libffi/commit/01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd] |
| 20 | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> |
| 21 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 22 | --- |
| 23 | src/powerpc/ffi_powerpc.h | 2 +- |
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | |
| 26 | diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h |
| 27 | index 5ee2a70..8e2f2f0 100644 |
| 28 | --- a/src/powerpc/ffi_powerpc.h |
| 29 | +++ b/src/powerpc/ffi_powerpc.h |
| 30 | @@ -62,7 +62,7 @@ typedef _Float128 float128; |
| 31 | #elif defined(__FLOAT128__) |
| 32 | typedef __float128 float128; |
| 33 | #else |
| 34 | -typedef __int128 float128; |
| 35 | +typedef char float128[16] __attribute__((aligned(16))); |
| 36 | #endif |
| 37 | |
| 38 | void FFI_HIDDEN ffi_closure_SYSV (void); |