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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From e2dba281429384cc22a73a58eaf79459e64be266 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 | 8 ++++++--
  13. 2 files changed, 12 insertions(+), 4 deletions(-)
  14. copy sysdeps/{aarch64 => arm}/bits/wordsize.h (85%)
  15. diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
  16. index 4635431f0e..5ef0ed21f3 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 85%
  38. copy from sysdeps/aarch64/bits/wordsize.h
  39. copy to sysdeps/arm/bits/wordsize.h
  40. index 4635431f0e..5ef0ed21f3 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