Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Rongqing Li <rongqing.li@windriver.com>
To: <openembedded-devel@lists.openembedded.org>
Subject: Re: [PATCH][meta-networking][V2] ebtables: make it be able to work on 64bit kernel with 32 bit userspace
Date: Wed, 19 Nov 2014 10:10:11 +0800	[thread overview]
Message-ID: <546BFC03.5010805@windriver.com> (raw)
In-Reply-To: <1415757715-26213-1-git-send-email-rongqing.li@windriver.com>

Please drop it, it make x86 unable to work

-Roy

On 2014年11月12日 10:01, rongqing.li@windriver.com wrote:
> From: "Roy.Li" <rongqing.li@windriver.com>
>
> 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))));
> };
>
> To make it work on 64bit kernel and 32bit userspace, KERNEL_64_USERSPACE_32
> is needed to be enabled.
>
> If the MLPREFIX of package matchs "lib.?32", the 32bit multilib  package on
> 64bit kernel is being built.
>
> Signed-off-by: Roy.Li <rongqing.li@windriver.com>
> ---
>   meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | 11 +++++++++++
>   1 file changed, 11 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 32cfc75..ca084e3 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,17 @@ S = "${WORKDIR}/ebtables-v${PV}"
>
>   inherit update-rc.d systemd
>
> +python __anonymous () {
> +    import re
> +
> +    multilib = d.getVar('MLPREFIX', True)
> +    if multilib:
> +        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} \
>

-- 
Best Reagrds,
Roy | RongQing Li


      reply	other threads:[~2014-11-19  2:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  2:01 [PATCH][meta-networking][V2] ebtables: make it be able to work on 64bit kernel with 32 bit userspace rongqing.li
2014-11-19  2:10 ` Rongqing Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546BFC03.5010805@windriver.com \
    --to=rongqing.li@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox