[oe-commits] [meta-openembedded] 10/15: ebtables: enable KERNEL_64_USERSPACE_32 for powerpc

git at git.openembedded.org git at git.openembedded.org
Tue Mar 1 13:48:46 UTC 2016


joe_macdonald pushed a commit to branch master
in repository meta-openembedded.

commit e4dee444c07d01f99d85d9419bd31be08a35f805
Author: Roy Li <rongqing.li at windriver.com>
AuthorDate: Wed Jan 20 14:12:17 2016 +0800

    ebtables: enable KERNEL_64_USERSPACE_32 for powerpc
    
    Enable KERNEL_64_USERSPACE_32 when powerpc is using 64bit kernel and 32bit
    userspace.
    
    Some structs, which is used to communicate between user space and kernel,
    have the alignment issue on 64bit kernel with 32 bit userspace. To fix
    this issue, ebtables redefines these struct, not use the kernel(sysroot)
    include/uapi/linux/netfilter_bridge/ebtables.h, like ebt_entry_target:
    
    The kernel's:
    struct ebt_entry_target {
           union {
                   char name[EBT_FUNCTION_MAXNAMELEN];
                   struct xt_target *target;
           } u;
           /* size of data */
           unsigned int target_size;
           unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
    };
    
    The ebtables:
    struct ebt_entry_target
    {
            union {
                    char name[EBT_FUNCTION_MAXNAMELEN];
                    struct ebt_target *target;
            } u;
            /* size of data */
            unsigned int target_size;
    |#ifdef KERNEL_64_USERSPACE_32
            unsigned int pad;
    |#endif
            unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
    };
    
    If the MLPREFIX of package matchs "lib.?32", the 32bit multilib package on
    64bit kernel is being built, then enable KERNEL_64_USERSPACE_32.
    
    Signed-off-by: Roy Li <rongqing.li at windriver.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
    Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
---
 .../recipes-filter/ebtables/ebtables_2.0.10-4.bb            | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
index 2e49dab..e9b726c 100644
--- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
+++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -27,6 +27,19 @@ S = "${WORKDIR}/ebtables-v${PV}"
 
 inherit update-rc.d systemd
 
+python __anonymous () {
+    import re
+
+    karch = d.getVar('KARCH', True)
+    multilib = d.getVar('MLPREFIX', True)
+
+    if multilib and karch == 'powerpc64':
+        searchstr = "lib.?32"
+        reg = re.compile(searchstr)
+        if reg.search(multilib):
+            d.appendVar('CFLAGS' ,' -DKERNEL_64_USERSPACE_32 -DEBT_MIN_ALIGN=8')
+}
+
 EXTRA_OEMAKE = " \
         BINDIR=${base_sbindir} \
         MANDIR=${mandir} \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list