summaryrefslogtreecommitdiffstats
path: root/scripts/multilib_header_wrapper.h
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-30 14:02:21 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-31 09:10:29 (GMT)
commit8b41b5ddfe20bfc22133339597ffce2829caa229 (patch)
treef078b267fd25468b5336e8cb253b030cf8b20453 /scripts/multilib_header_wrapper.h
parent408e0b46aec572a17e72844bbce1139af7cf05c8 (diff)
downloadpoky-8b41b5ddfe20bfc22133339597ffce2829caa229.tar.gz
multilib_header: Update wrapper to handle arm 32/64 bit
Having arm 32/64 bit headers coexisting turns out to be tricky. Unfortunately our wrapper works using wordsize.h and this differs on arm so we can't use it. Therefore replicate the logic here for arm. I did look into writing our own wordsize.h but we also need to remap kernel headers on arm and since wordsize.h comes from libc, that doesn't work for kernel headers. (From OE-Core rev: 141dc7136c9c62da1d30132df4b3244fe6d8898d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/multilib_header_wrapper.h')
-rw-r--r--scripts/multilib_header_wrapper.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/multilib_header_wrapper.h b/scripts/multilib_header_wrapper.h
index 5a87540..f516673 100644
--- a/scripts/multilib_header_wrapper.h
+++ b/scripts/multilib_header_wrapper.h
@@ -21,11 +21,23 @@
21 * 21 *
22 */ 22 */
23 23
24#include <bits/wordsize.h>
25 24
26#ifdef __WORDSIZE 25#if defined (__arm__)
26#define __MHWORDSIZE 32
27#elif defined (__aarch64__) && defined ( __LP64__)
28#define __MHWORDSIZE 64
29#elif defined (__aarch64__)
30#define __MHWORDSIZE 32
31#else
32#include <bits/wordsize.h>
33#if defined (__WORDSIZE)
34#define __MHWORDSIZE __WORDSIZE
35#else
36#error "__WORDSIZE is not defined"
37#endif
38#endif
27 39
28#if __WORDSIZE == 32 40#if __MHWORDSIZE == 32
29 41
30#ifdef _MIPS_SIM 42#ifdef _MIPS_SIM
31 43
@@ -41,15 +53,9 @@
41#include <ENTER_HEADER_FILENAME_HERE-32.h> 53#include <ENTER_HEADER_FILENAME_HERE-32.h>
42#endif 54#endif
43 55
44#elif __WORDSIZE == 64 56#elif __MHWORDSIZE == 64
45#include <ENTER_HEADER_FILENAME_HERE-64.h> 57#include <ENTER_HEADER_FILENAME_HERE-64.h>
46#else 58#else
47#error "Unknown __WORDSIZE detected" 59#error "Unknown __WORDSIZE detected"
48#endif /* matches #if __WORDSIZE == 32 */ 60#endif /* matches #if __WORDSIZE == 32 */
49
50#else /* __WORDSIZE is not defined */
51
52#error "__WORDSIZE is not defined"
53
54#endif
55 61