From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/3] toolchain: workaround musl/kernel headers conflict
Date: Wed, 16 Nov 2016 23:30:01 +0100 [thread overview]
Message-ID: <20161116233001.79b36069@free-electrons.com> (raw)
In-Reply-To: <b2085612a223f59a2f7ef18a9bd97603226aa03d.1478784433.git.baruch@tkos.co.il>
Hello,
On Thu, 10 Nov 2016 15:27:11 +0200, Baruch Siach wrote:
> Rick Felker suggested[1] this hack as a workaround to musl libc conflict with
> kernel headers:
>
> The problem is linux/libc-compat.h, which should fix this, only works
> on glibc, by design. See:
>
> #ifndef _LIBC_COMPAT_H
> #define _LIBC_COMPAT_H
>
> /* We have included glibc headers... */
> #if defined(__GLIBC__)
>
> /* Coordinate with glibc netinet/in.h header. */
> #if defined(_NETINET_IN_H)
>
> If you patch it like this:
>
> -#if defined(__GLIBC__)
> +#if 1
>
> then it should mostly work but it's still all a big hack. I think
> that's what distros are doing. The problem is that the same header is
> trying to do two different things:
>
> 1. Provide extra linux-kernel-API stuff that's not in the
> libc/userspace headers.
>
> 2. Provide definitions of the standard types and constants for uClibc
> and klibc, which don't have complete libc headers and rely on the
> kernel headers for definitions.
>
> These two uses really should be separated out into separate headers so
> that the latter only get included explicitly by uClibc and klibc and
> otherwise remain completely unused. But that would require coordinated
> changes/upgrades which are unlikely to happen. :(
>
> Upstream musl still evaluates[2][3] a permanent solution.
>
> With this in place we can revert (at least) commits a167081c5d (bridge-utils:
> fix build with musl) and e74d4fc4932 (norm: add patch to fix musl build).
>
> [1] http://www.openwall.com/lists/musl/2015/10/08/2
> [2] http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
> [3] http://www.openwall.com/lists/musl/2016/11/09/2
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2:
> * Add Rick's explanation in the commit log (Arnout)
> * Link to more recent upstream changes
> ---
> toolchain/toolchain/toolchain.mk | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
Series applied to the next branch. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-11-16 22:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 13:27 [Buildroot] [PATCH v2 1/3] toolchain: workaround musl/kernel headers conflict Baruch Siach
2016-11-10 13:27 ` [Buildroot] [PATCH v2 2/3] Revert "bridge-utils: fix build with musl" Baruch Siach
2016-11-10 13:27 ` [Buildroot] [PATCH v2 3/3] Revert "norm: add patch to fix musl build" Baruch Siach
2016-11-13 21:33 ` [Buildroot] [PATCH v2 1/3] toolchain: workaround musl/kernel headers conflict Arnout Vandecappelle
2016-11-15 22:33 ` Thomas Petazzoni
2016-11-16 15:45 ` Baruch Siach
2016-11-16 15:55 ` Thomas Petazzoni
2016-11-16 16:25 ` Baruch Siach
2016-11-16 16:36 ` Thomas Petazzoni
2016-11-16 20:43 ` Baruch Siach
2016-11-16 22:30 ` Thomas Petazzoni [this message]
2017-05-17 13:33 ` Thomas Petazzoni
2017-05-18 4:57 ` Baruch Siach
2017-05-18 7:10 ` Thomas Petazzoni
2017-05-18 11:17 ` Baruch Siach
2017-05-18 11:24 ` Thomas Petazzoni
2017-05-18 11:37 ` Baruch Siach
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=20161116233001.79b36069@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox