blob: 996471a5202496ce2442d2135b330eeb876b1863 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From e2dba281429384cc22a73a58eaf79459e64be266 Mon Sep 17 00:00:00 2001
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00002From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2020 17:05:45 -0700
Patrick Williams92b42cb2022-09-03 06:53:57 -05004Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00005
6This helps OE multilibs to not sythesize this header which causes all
7kind of recursions and other issues since wordsize is fundamental header
8and ends up including itself in many case e.g. clang tidy, bpf etc.
9
10Upstream-Status: Inappropriate [ OE-Specific ]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
Patrick Williams92b42cb2022-09-03 06:53:57 -050014 sysdeps/aarch64/bits/wordsize.h | 8 ++++++--
15 sysdeps/{aarch64 => arm}/bits/wordsize.h | 8 ++++++--
16 2 files changed, 12 insertions(+), 4 deletions(-)
17 copy sysdeps/{aarch64 => arm}/bits/wordsize.h (85%)
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000018
19diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
20index 4635431f0e..5ef0ed21f3 100644
21--- a/sysdeps/aarch64/bits/wordsize.h
22+++ b/sysdeps/aarch64/bits/wordsize.h
23@@ -17,12 +17,16 @@
24 License along with the GNU C Library; if not, see
25 <https://www.gnu.org/licenses/>. */
26
27-#ifdef __LP64__
28+#if defined (__aarch64__) && defined (__LP64__)
29 # define __WORDSIZE 64
30-#else
31+#elif defined (__aarch64__)
32 # define __WORDSIZE 32
33 # define __WORDSIZE32_SIZE_ULONG 1
34 # define __WORDSIZE32_PTRDIFF_LONG 1
35+#else
36+# define __WORDSIZE 32
37+# define __WORDSIZE32_SIZE_ULONG 0
38+# define __WORDSIZE32_PTRDIFF_LONG 0
39 #endif
40
41 #define __WORDSIZE_TIME64_COMPAT32 0
42diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
Patrick Williams92b42cb2022-09-03 06:53:57 -050043similarity index 85%
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000044copy from sysdeps/aarch64/bits/wordsize.h
45copy to sysdeps/arm/bits/wordsize.h
Patrick Williams92b42cb2022-09-03 06:53:57 -050046index 4635431f0e..5ef0ed21f3 100644
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000047--- a/sysdeps/aarch64/bits/wordsize.h
48+++ b/sysdeps/arm/bits/wordsize.h
49@@ -17,12 +17,16 @@
50 License along with the GNU C Library; if not, see
51 <https://www.gnu.org/licenses/>. */
52
53-#ifdef __LP64__
54+#if defined (__aarch64__) && defined (__LP64__)
55 # define __WORDSIZE 64
56-#else
57+#elif defined (__aarch64__)
58 # define __WORDSIZE 32
59 # define __WORDSIZE32_SIZE_ULONG 1
60 # define __WORDSIZE32_PTRDIFF_LONG 1
61+#else
62+# define __WORDSIZE 32
63+# define __WORDSIZE32_SIZE_ULONG 0
64+# define __WORDSIZE32_PTRDIFF_LONG 0
65 #endif
66
67 #define __WORDSIZE_TIME64_COMPAT32 0