blob: 9ed89c93dae4a56a66c74ae6f94fce26d935e040 [file] [log] [blame]
From 80dbf6f21c12b1c60bfab9a64798d4f1ea242efb 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] 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 | 8 ++++++--
sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%)
diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index 04d4be9519..63876a7830 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -17,12 +17,16 @@
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 __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
#define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
similarity index 80%
copy from sysdeps/aarch64/bits/wordsize.h
copy to sysdeps/arm/bits/wordsize.h
index 04d4be9519..5ef0ed21f3 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/arm/bits/wordsize.h
@@ -1,6 +1,6 @@
/* Determine the wordsize from the preprocessor defines.
- Copyright (C) 2016-2023 Free Software Foundation, Inc.
+ 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
@@ -17,12 +17,16 @@
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 __WORDSIZE32_SIZE_ULONG 0
+# define __WORDSIZE32_PTRDIFF_LONG 0
#endif
#define __WORDSIZE_TIME64_COMPAT32 0