Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1 | From 2ae3ff3ae28abb1d0d100b4722da7ff188de9a30 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 15 May 2020 17:05:45 -0700 |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 4 | Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64 |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 5 | |
| 6 | This helps OE multilibs to not sythesize this header which causes all |
| 7 | kind of recursions and other issues since wordsize is fundamental header |
| 8 | and ends up including itself in many case e.g. clang tidy, bpf etc. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [ OE-Specific ] |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 14 | sysdeps/aarch64/bits/wordsize.h | 8 ++++++-- |
| 15 | sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++--- |
| 16 | 2 files changed, 13 insertions(+), 5 deletions(-) |
| 17 | copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%) |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 18 | |
| 19 | diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 20 | index 91da566b74..9a754514b3 100644 |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 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 |
| 42 | diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 43 | similarity index 80% |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 44 | copy from sysdeps/aarch64/bits/wordsize.h |
| 45 | copy to sysdeps/arm/bits/wordsize.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 46 | index 91da566b74..34fcdef1f1 100644 |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 47 | --- a/sysdeps/aarch64/bits/wordsize.h |
| 48 | +++ b/sysdeps/arm/bits/wordsize.h |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 49 | @@ -1,6 +1,6 @@ |
| 50 | /* Determine the wordsize from the preprocessor defines. |
| 51 | |
| 52 | - Copyright (C) 2016-2021 Free Software Foundation, Inc. |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame^] | 53 | + Copyright (C) 2016-2021 Free Software Foundation, Inc. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 54 | This file is part of the GNU C Library. |
| 55 | |
| 56 | The GNU C Library is free software; you can redistribute it and/or |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 57 | @@ -17,12 +17,16 @@ |
| 58 | License along with the GNU C Library; if not, see |
| 59 | <https://www.gnu.org/licenses/>. */ |
| 60 | |
| 61 | -#ifdef __LP64__ |
| 62 | +#if defined (__aarch64__) && defined (__LP64__) |
| 63 | # define __WORDSIZE 64 |
| 64 | -#else |
| 65 | +#elif defined (__aarch64__) |
| 66 | # define __WORDSIZE 32 |
| 67 | # define __WORDSIZE32_SIZE_ULONG 1 |
| 68 | # define __WORDSIZE32_PTRDIFF_LONG 1 |
| 69 | +#else |
| 70 | +# define __WORDSIZE 32 |
| 71 | +# define __WORDSIZE32_SIZE_ULONG 0 |
| 72 | +# define __WORDSIZE32_PTRDIFF_LONG 0 |
| 73 | #endif |
| 74 | |
| 75 | #define __WORDSIZE_TIME64_COMPAT32 0 |