Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Khem Raj <raj.khem@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] external-toolchain: Detect linux/version.h via cross compiler
Date: Sun, 9 Jan 2022 00:03:12 +0100	[thread overview]
Message-ID: <20220109000312.6b307c17@windsurf> (raw)
In-Reply-To: <20201023093641.619746-1-raj.khem@gmail.com>

Hello Khem,

On Fri, 23 Oct 2020 02:36:41 -0700
Khem Raj <raj.khem@gmail.com> wrote:

> Using linux/version.h is assumed to be hardcoded inside sysroot but this
> does not consider the case where toolchains might be built with
> --with-native-system-header-dir which means the header directories will
> not be under <sysroot>/usr/include but customized, archlinux, debian
> built cross toolchains use these install settings ( due to multiarch )
> they have the headers installed like /usr/aarch64-linux-gnu/include and
> not /usr/aarch64-linux-gnu/usr/include
> 
> This patch adds logic to use cross compiler to compute the path to
> linux/version.h on the fly, it means we do not really need to assume the
> install structure
> 
> Fixes built when using external toolchains provided by archlinux e.g.
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  support/scripts/check-kernel-headers.sh           | 15 ++++++++++++++-
>  toolchain/helpers.mk                              |  2 +-
>  .../toolchain-external/pkg-toolchain-external.mk  |  3 ++-
>  3 files changed, 17 insertions(+), 3 deletions(-)

We finally took some time to review and discuss this patch. As you can
probably imagine due to the delay, we are (at least in its current
form) not going to apply it.

While it would be nice to not hardcode /usr/include/linux/version.h, we
would need:

 - To account for CFLAGS, as they can affect which sysroot is used by
   the toolchain in case of multilib toolchains.

 - A solution that also uses the cross-compiler to detect where
   <linux/version.h> is in the case of the internal toolchain backend.

However, overall, the motivation of using distribution toolchains is
dubious. We still believe that it cannot work, because distribution
toolchains can contain any number of random libraries. The sysroot of
those toolchains (including the random set of libraries that have been
installed) will be copied to Buildroot STAGING_DIR, causing confusion
with the packages that Buildroot will build.

So overall, we feel that the benefit of the patch is not sufficient
compared to the extra effort to fix the remaining comments that we have
on it. If you're still interested in pursuing this, we would welcome a
new patch that addresses the above two issues.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-01-08 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  9:36 [Buildroot] [PATCH] external-toolchain: Detect linux/version.h via cross compiler Khem Raj
2020-11-03 20:00 ` Thomas Petazzoni
2020-11-03 20:19   ` Khem Raj
2020-11-03 20:16 ` Yann E. MORIN
2020-11-03 20:25   ` Khem Raj
2020-11-03 20:43     ` Thomas Petazzoni
2020-11-04  3:24       ` Khem Raj
2022-01-08 23:03 ` Thomas Petazzoni [this message]
2022-01-13 17:02   ` Khem Raj

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=20220109000312.6b307c17@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@buildroot.org \
    --cc=raj.khem@gmail.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