summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0018-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
blob: 789d2edf231b97d5ca04156847c8b78b1b089274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 4d6bce6b106d9d9a629aadba74d74cd8a500ccbf Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 15 May 2020 17:05:45 -0700
Subject: [PATCH 18/24] wordsize.h: Unify the header between arm and aarch64

This helps OE multilibs to not sythesize this header which causes all
kind of recursions and other issues since wordsize is fundamental header
and ends up including itself in many case e.g. clang tidy, bpf etc.

Upstream-Status: Inappropriate [ OE-Specific ]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 sysdeps/aarch64/bits/wordsize.h | 11 +++++++++--
 sysdeps/arm/bits/wordsize.h     | 16 +++++++++++++++-
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index 4635431f0e..1639bcb063 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -17,12 +17,19 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifdef __LP64__
+#if defined (__aarch64__) && defined (__LP64__)
 # define __WORDSIZE			64
-#else
+#elif defined (__aarch64__)
 # define __WORDSIZE			32
 # define __WORDSIZE32_SIZE_ULONG	1
 # define __WORDSIZE32_PTRDIFF_LONG	1
+#else
+#define __WORDSIZE			32
+#define __WORDSIZE_TIME64_COMPAT32	1
+#define __WORDSIZE32_SIZE_ULONG		0
+#define __WORDSIZE32_PTRDIFF_LONG	0
 #endif
 
+#ifdef __aarch64__
 #define __WORDSIZE_TIME64_COMPAT32	0
+#endif
diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
index 6ecbfe7c86..1639bcb063 100644
--- a/sysdeps/arm/bits/wordsize.h
+++ b/sysdeps/arm/bits/wordsize.h
@@ -1,4 +1,6 @@
-/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
+/* Determine the wordsize from the preprocessor defines.
+
+   Copyright (C) 2016-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,7 +17,19 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#if defined (__aarch64__) && defined (__LP64__)
+# define __WORDSIZE			64
+#elif defined (__aarch64__)
+# define __WORDSIZE			32
+# define __WORDSIZE32_SIZE_ULONG	1
+# define __WORDSIZE32_PTRDIFF_LONG	1
+#else
 #define __WORDSIZE			32
 #define __WORDSIZE_TIME64_COMPAT32	1
 #define __WORDSIZE32_SIZE_ULONG		0
 #define __WORDSIZE32_PTRDIFF_LONG	0
+#endif
+
+#ifdef __aarch64__
+#define __WORDSIZE_TIME64_COMPAT32	0
+#endif
-- 
2.34.1