0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From baba3c6021340a9070b734f931a15cea4cfe6c31 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Fri, 15 May 2020 17:05:45 -0700
  4. Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
  5. This helps OE multilibs to not sythesize this header which causes all
  6. kind of recursions and other issues since wordsize is fundamental header
  7. and ends up including itself in many case e.g. clang tidy, bpf etc.
  8. Upstream-Status: Inappropriate [ OE-Specific ]
  9. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  10. ---
  11. sysdeps/aarch64/bits/wordsize.h | 8 ++++++--
  12. sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++---
  13. 2 files changed, 13 insertions(+), 5 deletions(-)
  14. copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%)
  15. diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
  16. index 91da566b74..9a754514b3 100644
  17. --- a/sysdeps/aarch64/bits/wordsize.h
  18. +++ b/sysdeps/aarch64/bits/wordsize.h
  19. @@ -17,12 +17,16 @@
  20. License along with the GNU C Library; if not, see
  21. <https://www.gnu.org/licenses/>. */
  22. -#ifdef __LP64__
  23. +#if defined (__aarch64__) && defined (__LP64__)
  24. # define __WORDSIZE 64
  25. -#else
  26. +#elif defined (__aarch64__)
  27. # define __WORDSIZE 32
  28. # define __WORDSIZE32_SIZE_ULONG 1
  29. # define __WORDSIZE32_PTRDIFF_LONG 1
  30. +#else
  31. +# define __WORDSIZE 32
  32. +# define __WORDSIZE32_SIZE_ULONG 0
  33. +# define __WORDSIZE32_PTRDIFF_LONG 0
  34. #endif
  35. #define __WORDSIZE_TIME64_COMPAT32 0
  36. diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
  37. similarity index 80%
  38. copy from sysdeps/aarch64/bits/wordsize.h
  39. copy to sysdeps/arm/bits/wordsize.h
  40. index 91da566b74..34fcdef1f1 100644
  41. --- a/sysdeps/aarch64/bits/wordsize.h
  42. +++ b/sysdeps/arm/bits/wordsize.h
  43. @@ -17,12 +17,16 @@
  44. License along with the GNU C Library; if not, see
  45. <https://www.gnu.org/licenses/>. */
  46. -#ifdef __LP64__
  47. +#if defined (__aarch64__) && defined (__LP64__)
  48. # define __WORDSIZE 64
  49. -#else
  50. +#elif defined (__aarch64__)
  51. # define __WORDSIZE 32
  52. # define __WORDSIZE32_SIZE_ULONG 1
  53. # define __WORDSIZE32_PTRDIFF_LONG 1
  54. +#else
  55. +# define __WORDSIZE 32
  56. +# define __WORDSIZE32_SIZE_ULONG 0
  57. +# define __WORDSIZE32_PTRDIFF_LONG 0
  58. #endif
  59. #define __WORDSIZE_TIME64_COMPAT32 0