LoongArch: Fix soft-float builds of libffi

Message ID 20240127070945.413362-2-yangyujie@loongson.cn
State New
Headers
Series LoongArch: Fix soft-float builds of libffi |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed

Commit Message

Yang Yujie Jan. 27, 2024, 7:09 a.m. UTC
  This patch correspond to the upstream PR:
https://github.com/libffi/libffi/pull/817

libffi/ChangeLog:

	* src/loongarch64/ffi.c: Avoid defining floats
	in struct call_context if the ABI is soft-float.
---
 libffi/src/loongarch64/ffi.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Xi Ruoyao Jan. 31, 2024, 11:44 a.m. UTC | #1
On Sat, 2024-01-27 at 15:09 +0800, Yang Yujie wrote:
> This patch correspond to the upstream PR:
> https://github.com/libffi/libffi/pull/817
> 
> libffi/ChangeLog:
> 
> 	* src/loongarch64/ffi.c: Avoid defining floats
> 	in struct call_context if the ABI is soft-float.

You need to wait until the PR is accepted by the libffi maintainers. 
Frankly I don't know what libffi maintainers are busy on and I'm
frustrated as well (having a MIPS patch unreviewed there for a month)
but this is the procedure :(.
  

Patch

diff --git a/libffi/src/loongarch64/ffi.c b/libffi/src/loongarch64/ffi.c
index 140be3bc3dc..01c2e18a395 100644
--- a/libffi/src/loongarch64/ffi.c
+++ b/libffi/src/loongarch64/ffi.c
@@ -58,7 +58,9 @@ 
 */
 typedef struct call_context
 {
+#if !defined(__loongarch_soft_float)
   ABI_FLOAT fa[8];
+#endif
   size_t a[10];
 } call_context;