All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 1/3] toolchain: workaround musl/kernel headers conflict
Date: Wed, 9 Nov 2016 21:28:23 +0200	[thread overview]
Message-ID: <20161109192823.tasqlj4dgrs6zswt@tarshish> (raw)
In-Reply-To: <e321884b-e3ff-bfc2-ceb8-71cbbd2524d3@mind.be>

Hi Arnout,

On Wed, Nov 09, 2016 at 12:04:37AM +0100, Arnout Vandecappelle wrote:
> On 06-11-16 19:43, Baruch Siach wrote:
> > Rick Felker suggested[1] this hack as a workaround to musl libc conflict with
> > kernel headers. Upstream musl still evaluates[2] a permanent solution.
> 
>  Add an explanation of what the hack does. Actually, quoting Rick's fully
> explanation is probably the best thing to do.

Will do.

[...]

> > diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk
> > index c22713bfe349..d317e917d032 100644
> > --- a/toolchain/toolchain/toolchain.mk
> > +++ b/toolchain/toolchain/toolchain.mk
> > @@ -12,6 +12,20 @@ endif
> >  
> >  TOOLCHAIN_ADD_TOOLCHAIN_DEPENDENCY = NO
> >  
> > +# Apply a hack that Rick Felker suggested[1] to avoid conflicts between libc
> > +# headers and kernel headers. This is a temporary measure until musl finds a
> > +# better solution.
> > +#
> > +# [1] http://www.openwall.com/lists/musl/2015/10/08/2
> > +ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
> > +define TOOLCHAIN_MUSL_KERNEL_HEADERS_COMPATIBILITY_HACK
> > +	$(SED) 's/^#if defined(__GLIBC__)$$/#if 1/' \
> > +		$(STAGING_DIR)/usr/include/linux/libc-compat.h
> > +endef
> > +TOOLCHAIN_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_MUSL_KERNEL_HEADERS_COMPATIBILITY_HACK
> > +TOOLCHAIN_INSTALL_STAGING = YES
> 
>  TOOLCHAIN_POST_INSTALL_STAGING is not ideal because it normally doesn't install
> to staging. Can it be moved to musl-compat-headers? It's a bit of work, because
> it requires first to move the musl-compat-headers dependency from musl and
> toolchain-external to toolchain itself, and then to add dependencies in
> musl-compat-headers on linux-headers resp. toolchain-external depending on which
> of the two is selected. But I think it's cleaner in the end.

I think your suggestion is way too complex for this ugly hack. It spreads the 
ugliness all over the place instead of keeping it in its corner.

>  OTOH this is a hack which can hopefully removed at some point so maybe it
> doesn't have to be so clean.

I agree.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

      reply	other threads:[~2016-11-09 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-06 18:43 [Buildroot] [RFC 1/3] toolchain: workaround musl/kernel headers conflict Baruch Siach
2016-11-06 18:43 ` [Buildroot] [RFC 2/3] Revert "bridge-utils: fix build with musl" Baruch Siach
2016-11-06 18:43 ` [Buildroot] [RFC 3/3] Revert "norm: add patch to fix musl build" Baruch Siach
2016-11-08 23:04 ` [Buildroot] [RFC 1/3] toolchain: workaround musl/kernel headers conflict Arnout Vandecappelle
2016-11-09 19:28   ` Baruch Siach [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=20161109192823.tasqlj4dgrs6zswt@tarshish \
    --to=baruch@tkos.co.il \
    --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.