Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org,
	randy.macleod@windriver.com, Harish.Sadineni@windriver.com
Subject: Re: [OE-core] [PATCH 2/2] toolchain-scripts, oeqa/sdk: build the kernel's host tools with a host pkg-config
Date: Sat, 22 Aug 2026 10:45:56 -0400	[thread overview]
Message-ID: <aom2JAFEPijstuHB@localhost.localdomain> (raw)
In-Reply-To: <50d7d13a895765f87612109f737f012d43ecceb6.camel@linuxfoundation.org>

On Thu 2026-08-13 @ 03:04:04 PM, Richard Purdie wrote:
> On Wed, 2026-08-05 at 02:57 -0400, Trevor Woerner via lists.openembedded.org wrote:
> > The SDK environment sets PKG_CONFIG_SYSROOT_DIR, PKG_CONFIG_PATH and
> > PKG_CONFIG_LIBDIR so that pkg-config answers for the target. That is
> > right for everything built to run there and wrong for a program built to
> > run on the SDK host.
> > 
> > The kernel build compiles host tools of its own, and objtool asks
> > pkg-config where libelf is. It gets the target's include directory,
> > compiles a host tool against the target's C library headers, and stops
> > on warnings that -Wno-system-headers would otherwise have covered:
> > 
> >   usr/include/sys/cdefs.h:486: error: "__attribute_const__" redefined
> > 
> > Export a HOSTPKG_CONFIG that undoes those three variables, and pass the
> > same value on the make command line when the test builds an external
> > module. Both halves are needed: the kernel assigns HOSTPKG_CONFIG with
> > '=', so only a command line assignment takes effect today, and the
> > export is there for kernels that assign it with '?=', which is proposed
> > in
> > 
> >   https://lore.kernel.org/linux-kbuild/20260805055438.3482019-1-twoerner@gmail.com/
> > 
> > OE-Core already does the command line half for its own kernel builds, in
> > kernel.bbclass.
> > 
> > Fixes [YOCTO #16239].
> > 
> > AI-Generated: codex/claude-opus 5 (xhigh)
> > Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> > ---
> >  meta/classes-recipe/toolchain-scripts.bbclass | 3 +++
> >  meta/lib/oeqa/sdk/cases/kmod.py               | 7 +++++--
> >  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> The kmod test piece of this is probably ok, as you say, we do that in
> the kernel classes. I do note that the kernel class redirects to a pkg-
> config wrapper and perhaps the kmod class should match, rather than
> doing something different though?

Agreed. I just sent a v3 that does that, so the test now passes the same
wrapper rather than spelling it out.

> The toolchain piece is a but more of a concern since we're encoding
> kernel specific variables into the generic toolchain environment file
> and in general we don't want to do recipe specific things there...

Yes, and it is dropped. My v2 crossed with this email and already does
this.

> Cheers,
> 
> Richard


      reply	other threads:[~2026-08-22 14:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05  6:57 [PATCH 0/2] fix the SDK kernel module test Trevor Woerner
2026-08-05  6:57 ` [PATCH 1/2] oeqa/sdk: update cryptodev to a revision that builds on kernel 6.18 Trevor Woerner
2026-08-05  6:57 ` [PATCH 2/2] toolchain-scripts, oeqa/sdk: build the kernel's host tools with a host pkg-config Trevor Woerner
2026-08-13 14:04   ` [OE-core] " Richard Purdie
2026-08-22 14:45     ` Trevor Woerner [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=aom2JAFEPijstuHB@localhost.localdomain \
    --to=twoerner@gmail.com \
    --cc=Harish.Sadineni@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=randy.macleod@windriver.com \
    --cc=richard.purdie@linuxfoundation.org \
    /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