2
1

0001-configure.ac-fix-build-on-powerpc.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 84e62d57b90b41a0c96bb9fb6ec61ecaac76a1ab Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 5 Nov 2022 21:31:36 +0100
  4. Subject: [PATCH] configure.ac: fix build on powerpc and m68k
  5. Fix the following powerpc and m68k build failures on:
  6. - musl raised because fpu_control.h is not available:
  7. In file included from fp.c:8:
  8. fp-gnuppc.c:21:10: fatal error: fpu_control.h: No such file or directory
  9. 21 | #include <fpu_control.h>
  10. | ^~~~~~~~~~~~~~~
  11. - glibc raised because _FPU_RC_NEAREST is undefined if _SOFT_FLOAT is
  12. set:
  13. In file included from fp.c:8:
  14. fp-gnuppc.c: In function 'gsl_ieee_set_mode':
  15. fp-gnuppc.c:53:15: error: '_FPU_RC_NEAREST' undeclared (first use in this function)
  16. 53 | mode |= _FPU_RC_NEAREST ;
  17. | ^~~~~~~~~~~~~~~
  18. Fixes:
  19. - http://autobuild.buildroot.org/results/d73e116c81bf16d2e55fced215d6bd3b382fef10
  20. - http://autobuild.buildroot.org/results/48403946bb4cda9013e51db59c1b2ffdcf4e2854
  21. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  22. Upstream: https://lists.gnu.org/archive/html/bug-gsl/2022-11/msg00000.html
  23. ---
  24. configure.ac | 8 ++++++++
  25. 1 file changed, 8 insertions(+)
  26. diff --git a/configure.ac b/configure.ac
  27. index bfd9ca30..1ee6dca0 100644
  28. --- a/configure.ac
  29. +++ b/configure.ac
  30. @@ -389,6 +389,14 @@ if test "$ac_cv_c_ieee_interface" = "gnux86" ; then
  31. fi
  32. fi
  33. +if test "$ac_cv_c_ieee_interface" = "gnuppc" -o "$ac_cv_c_ieee_interface" = "gnum68k" ; then
  34. + AC_CACHE_CHECK([for _FPU_RC_NEAREST], ac_cv_c__fpu_rc_nearest,
  35. + [ac_cv_c__fpu_rc_nearest=no
  36. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fpu_control.h>
  37. +]], [[ unsigned short mode = _FPU_RC_NEAREST ; ]])],[ac_cv_c__fpu_rc_nearest="yes"],[ac_cv_c_ieee_interface=unknown])
  38. + ])
  39. +fi
  40. +
  41. ac_tr_ieee_interface=HAVE_`echo $ac_cv_c_ieee_interface | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_IEEE_INTERFACE
  42. AC_DEFINE_UNQUOTED($ac_tr_ieee_interface,1,[IEEE Interface Type])
  43. --
  44. 2.35.1