0001-no-fenv-on-uclibc.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 1d309b81a6fdac33dfb5148f618bafe6ebdff958 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Fri, 15 Sep 2017 12:51:36 +0300
  4. Subject: [PATCH] Don't use <fenv.h> on uClibc
  5. The python-numpy code already has provisions to not use <fenv.h> when
  6. not available. However, it uses __GLIBC__ to know whether fenv.h is
  7. available or not, but uClibc defines __GLIBC__, so python-numpy thinks
  8. fenv.h is available.
  9. This patch fixes that by changing all defined(__GLIBC__) occurences by
  10. (defined(__GLIBC__) && !defined(__UCLIBC__)).
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
  13. ---
  14. numpy/core/include/numpy/ufuncobject.h | 2 +-
  15. numpy/core/src/npymath/ieee754.c.src | 2 +-
  16. 2 files changed, 2 insertions(+), 2 deletions(-)
  17. diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
  18. index d0ac1fd7d732..65e49fcd5b7a 100644
  19. --- a/numpy/core/include/numpy/ufuncobject.h
  20. +++ b/numpy/core/include/numpy/ufuncobject.h
  21. @@ -319,7 +319,7 @@ typedef struct _loop1d_info {
  22. #if defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || \
  23. (defined(__FreeBSD__) && (__FreeBSD_version < 502114)) || \
  24. defined(__NetBSD__) || \
  25. - defined(__GLIBC__) || defined(__APPLE__) || \
  26. + (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
  27. defined(__CYGWIN__) || defined(__MINGW32__) || \
  28. (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) || \
  29. defined(_AIX) || \
  30. diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
  31. index 0370ea6c77aa..e63e409b6604 100644
  32. --- a/numpy/core/src/npymath/ieee754.c.src
  33. +++ b/numpy/core/src/npymath/ieee754.c.src
  34. @@ -612,7 +612,7 @@ void npy_set_floatstatus_invalid(void)
  35. }
  36. -#elif defined(__GLIBC__) || defined(__APPLE__) || \
  37. +#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
  38. defined(__CYGWIN__) || defined(__MINGW32__) || \
  39. (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
  40. # include <fenv.h>
  41. --
  42. 2.7.5