Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: Ming Liu <liu.ming50@gmail.com>,
	openembedded-core@lists.openembedded.org
Cc: yue.tao@windriver.com, Ming Liu <peter.x.liu@external.atlascopco.com>
Subject: Re: [PATCH] libnl: Fix build with musl
Date: Wed, 21 Sep 2016 09:46:24 +0100	[thread overview]
Message-ID: <1474447584.16320.9.camel@andred.net> (raw)
In-Reply-To: <1474443443-10872-1-git-send-email-liu.ming50@gmail.com>

On Mi, 2016-09-21 at 09:37 +0200, Ming Liu wrote:
> From: Ming Liu <peter.x.liu@external.atlascopco.com>
> 
> [YOCTO #10313]
> 
> Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
> ---
>  .../libnl/libnl/0001-Fix-build-with-musl.patch     | 43
> ++++++++++++++++++++++
>  meta/recipes-support/libnl/libnl_3.2.28.bb         |  1 +
>  2 files changed, 44 insertions(+)
>  create mode 100644 meta/recipes-support/libnl/libnl/0001-Fix-build-with-
> musl.patch
> 
> diff --git a/meta/recipes-support/libnl/libnl/0001-Fix-build-with-
> musl.patch b/meta/recipes-support/libnl/libnl/0001-Fix-build-with-
> musl.patch
> new file mode 100644
> index 0000000..8a2dad5
> --- /dev/null
> +++ b/meta/recipes-support/libnl/libnl/0001-Fix-build-with-musl.patch
> @@ -0,0 +1,43 @@
> +From 963d9818d13a025b857380c84d53b11c3aceff54 Mon Sep 17 00:00:00 2001
> +From: Peter Liu <peter.x.liu@external.atlascopco.com>
> +Date: Wed, 21 Sep 2016 09:07:12 +0200
> +Subject: [PATCH] Fix build with musl
> +
> +Upstream-Status: Pending
> +
> +Due to both <netinet/in.h> and <linux/in6.h> being included, the
> +in6_addr is being redefined: once from the C library headers and once
> +from the kernel headers. This causes some build failures with for
> +example the musl C library:
> +| In file included from ../../libnl-3.2.28/include/linux-
> private/linux/if_bridge.h:18:0,
> +|                  from ../../libnl-3.2.28/lib/route/link/bridge.c:26:
> +| /mnt/ale-build/tmp/musl/sysroots/itmk2/usr/include/linux/in6.h:32:8:
> error: redefinition of 'struct in6_addr'
> +|  struct in6_addr {
> +|         ^~~~~~~~
> +| In file included from /mnt/ale-
> build/tmp/musl/sysroots/itmk2/usr/include/arpa/inet.h:9:0,
> +|                  from ../../libnl-3.2.28/include/netlink-
> private/netlink.h:33,
> +|                  from ../../libnl-3.2.28/lib/route/link/bridge.c:20:
> +| /mnt/ale-build/tmp/musl/sysroots/itmk2/usr/include/netinet/in.h:23:8:
> note: originally defined here
> +
> +In order to fix this, use just the C library header <netinet/in.h>.


This doesn't look right, as this error shouldn't happen (and I don't see it
myself).
As per linux kernel commit cfd280c91253cc28e4919e349fa7a813b63e71e8,
sysroot/usr/include/linux/in6.h guards definition of struct in6_addr
with __UAPI_DEF_IN6_ADDR wich is set appropriately as per
sysroot/usr/include/linux/libc-compat.h. Same for all the other structs. You
can double check when compiling bridge.c manually using gcc's -E option.

Are you using a very old kernel or very old kernel headers? Older than 3.12?

Cheers,
Andre'

> +
> +Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com>
> +---
> + include/linux-private/linux/if_bridge.h | 1 -
> + 1 file changed, 1 deletion(-)
> +
> +diff --git a/include/linux-private/linux/if_bridge.h b/include/linux-
> private/linux/if_bridge.h
> +index f24050b..8f7490c 100644
> +--- a/include/linux-private/linux/if_bridge.h
> ++++ b/include/linux-private/linux/if_bridge.h
> +@@ -15,7 +15,6 @@
> + 
> + #include <linux/types.h>
> + #include <linux/if_ether.h>
> +-#include <linux/in6.h>
> + 
> + #define SYSFS_BRIDGE_ATTR	"bridge"
> + #define SYSFS_BRIDGE_FDB	"brforward"
> +-- 
> +1.9.1
> +
> diff --git a/meta/recipes-support/libnl/libnl_3.2.28.bb b/meta/recipes-
> support/libnl/libnl_3.2.28.bb
> index 26982f3..f8f3e53 100644
> --- a/meta/recipes-support/libnl/libnl_3.2.28.bb
> +++ b/meta/recipes-support/libnl/libnl_3.2.28.bb
> @@ -15,6 +15,7 @@ SRC_URI = "https://github.com/thom311/${BPN}/releases/do
> wnload/${BPN}${@d.getVar
>             file://0001-lib-add-utility-function-nl_strerror_l.patch \
>             file://0002-lib-switch-to-using-strerror_l-instead-of-
> strerror_r.patch \
>             file://0003-src-switch-to-using-strerror_l-instead-of-
> strerror_r.patch \
> +           file://0001-Fix-build-with-musl.patch \
>  "
>  UPSTREAM_CHECK_URI = "https://github.com/thom311/${BPN}/releases"
>  
> -- 
> 1.9.1
> 


      reply	other threads:[~2016-09-21  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  7:37 [PATCH] libnl: Fix build with musl Ming Liu
2016-09-21  8:46 ` André Draszik [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=1474447584.16320.9.camel@andred.net \
    --to=git@andred.net \
    --cc=liu.ming50@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=peter.x.liu@external.atlascopco.com \
    --cc=yue.tao@windriver.com \
    /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