All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] bridge-utils: fix build with musl
Date: Thu, 3 Nov 2016 22:46:56 +0100	[thread overview]
Message-ID: <20161103224656.1e6466a6@free-electrons.com> (raw)
In-Reply-To: <0b4d1e33355f00f915768a2bc3f5c4d997206731.1478152430.git.baruch@tkos.co.il>

Hello,

On Thu,  3 Nov 2016 07:53:50 +0200, Baruch Siach wrote:
> Apply a patch that removes direct include of kernel headers to avoid conflict
> of definitions.
> 
> Fixes:
> http://autobuild.buildroot.net/results/4aa/4aaeca4f1fca1794b039d7255a1828ff724f2234/
> http://autobuild.buildroot.net/results/b48/b48a70137a4a568b31337f899fd21d05552db5e2/
> http://autobuild.buildroot.net/results/bff/bff5767fc7e821a7674ee022111db84e4a9449d0/
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Applied, thanks!

> In a discussion of this issue on the musl list last year Rich Felker
> suggested[1] the following hack for fixing the widespread musl issue with
> packages using kernel headers:
> 
>  --- usr/include/linux/libc-compat.h-orig	2016-11-03 07:25:09.853807823 +0200
>  +++ usr/include/linux/libc-compat.h	2016-11-03 07:25:49.602834223 +0200
>  @@ -49,7 +49,7 @@
>   #define _LIBC_COMPAT_H
> 
>   /* We have included glibc headers... */
>  -#if defined(__GLIBC__)
>  +#if 1
> 
>   /* Coordinate with glibc net/if.h header. */
>   #if defined(_NET_IF_H) && defined(__USE_MISC)
> 
> I verified that it fixes this build failure. What do you think of that as a
> temporary measure until musl finds a better solution[2]?

Yes, we probably need to do something like that. I'm sick of all the
patches we need to fix this structure redefinition mess, so if we have
a global solution, it would be nice. I guess it needs to be applied in
both the linux-headers package and the toolchain-external package.

I'm glad to see that musl is trying to find a better solution for this
problem. So far, every time I raised this issue, the answer was that:
"the kernel headers are broken", and apparently they can't easily be
fixed without breaking the user-space exposed definitions (and
therefore potentially break the build of userspace libs/apps).

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-11-03 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03  5:53 [Buildroot] [PATCH] bridge-utils: fix build with musl Baruch Siach
2016-11-03 21:46 ` Thomas Petazzoni [this message]
2016-11-04  5:22   ` [Buildroot] musl with kernel headers (was: [PATCH] bridge-utils: fix build with musl) Baruch Siach
2016-11-04  8:16     ` Thomas Petazzoni
2016-11-05 22:49       ` Baruch Siach
2016-11-06  1:25         ` [Buildroot] musl with kernel headers Arnout Vandecappelle

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=20161103224656.1e6466a6@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.