summaryrefslogtreecommitdiffstats
path: root/patches/libffi-3.3/0002-powerpc-fix-build-failure-on-power7-and-older-532.patch
blob: aa2487c29d79555c5f5b0442d6e5ae4c0b3aace3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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>
---
 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 5ee2a7095a6a..8e2f2f0e74a3 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);