]> code.ossystems Code Review - openembedded-core.git/commitdiff
multilib_header: Update wrapper to handle arm 32/64 bit
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Mar 2017 14:02:21 +0000 (15:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Mar 2017 15:27:02 +0000 (16:27 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/multilib_header.bbclass
scripts/multilib_header_wrapper.h

index 304c28e7713d21e6709eeeeb8c9373484d53d64d..e03f5b13b2f2b4fe3d34d47fd4cdd0aa7135a932 100644 (file)
@@ -13,13 +13,9 @@ oe_multilib_header() {
                ;;
        *)
        esac
-        # We use
-        # For ARM: We don't support multilib builds.
         # For MIPS: "n32" is a special case, which needs to be
         # distinct from both 64-bit and 32-bit.
         case ${TARGET_ARCH} in
-        arm*)   return
-                ;;
         mips*)  case "${MIPSPKGSFX_ABI}" in
                 "-n32")
                        ident=n32   
@@ -31,9 +27,6 @@ oe_multilib_header() {
                 ;;
         *)      ident=${SITEINFO_BITS}
         esac
-       if echo ${TARGET_ARCH} | grep -q arm; then
-           return
-       fi
        for each_header in "$@" ; do
           if [ ! -f "${D}/${includedir}/$each_header" ]; then
              bberror "oe_multilib_header: Unable to find header $each_header."
index 5a87540884505c94f281c01128ea0a4f75a25b27..f516673b63a55843743efa52c1d1d5a10c744ba2 100644 (file)
  * 
  */
 
-#include <bits/wordsize.h>
 
-#ifdef __WORDSIZE
+#if defined (__arm__)
+#define __MHWORDSIZE                   32
+#elif defined (__aarch64__) && defined ( __LP64__)
+#define __MHWORDSIZE                   64
+#elif defined (__aarch64__)
+#define __MHWORDSIZE                   32
+#else
+#include <bits/wordsize.h>
+#if defined (__WORDSIZE)
+#define __MHWORDSIZE                   __WORDSIZE
+#else
+#error "__WORDSIZE is not defined"
+#endif
+#endif
 
-#if __WORDSIZE == 32
+#if __MHWORDSIZE == 32
 
 #ifdef _MIPS_SIM
 
 #include <ENTER_HEADER_FILENAME_HERE-32.h>
 #endif
 
-#elif __WORDSIZE == 64
+#elif __MHWORDSIZE == 64
 #include <ENTER_HEADER_FILENAME_HERE-64.h>
 #else
 #error "Unknown __WORDSIZE detected"
 #endif /* matches #if __WORDSIZE == 32 */
-
-#else /* __WORDSIZE is not defined */
-
-#error "__WORDSIZE is not defined"
-
-#endif