0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From f9d8f11d60cdc656a801e0d8116101beb22e117b Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 24 Nov 2019 09:52:01 +0100
  4. Subject: [PATCH] ffi_powerpc.h: fix build failure with powerpc7
  5. Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7
  6. fails on:
  7. In file included from ../src/powerpc/ffi.c:33:0:
  8. ../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target
  9. typedef _Float128 float128;
  10. ^~~~~~~~~
  11. Fix this build failure by checking for __HAVE_FLOAT128 before using
  12. _Float128, as _Float128 is enabled only on specific conditions, see
  13. output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h:
  14. /* Defined to 1 if the current compiler invocation provides a
  15. floating-point type with the IEEE 754 binary128 format, and this glibc
  16. includes corresponding *f128 interfaces for it. */
  17. #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
  18. && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
  19. # define __HAVE_FLOAT128 1
  20. #else
  21. # define __HAVE_FLOAT128 0
  22. #endif
  23. Fixes:
  24. - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53
  25. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  26. ---
  27. src/powerpc/ffi_powerpc.h | 2 +-
  28. 1 file changed, 1 insertion(+), 1 deletion(-)
  29. diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
  30. index 5ee2a70..a5a786b 100644
  31. --- a/src/powerpc/ffi_powerpc.h
  32. +++ b/src/powerpc/ffi_powerpc.h
  33. @@ -57,7 +57,7 @@ typedef union
  34. double d;
  35. } ffi_dblfl;
  36. -#if defined(__FLOAT128_TYPE__)
  37. +#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128)
  38. typedef _Float128 float128;
  39. #elif defined(__FLOAT128__)
  40. typedef __float128 float128;
  41. --
  42. 2.24.0