public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 8/8] kernel: remove pkg-config variables for old (<5.15) kernels
Date: Fri, 23 Jan 2026 18:04:48 +0000	[thread overview]
Message-ID: <20260123180448.2997378-9-ross.burton@arm.com> (raw)
In-Reply-To: <20260123180448.2997378-1-ross.burton@arm.com>

The kernel has supported setting an alternative binary for pkg-config
with a variable since 5.19 (in 2022[1]) and we set that to
pkg-config-native, so there is no longer any need to also manually set
the PKG_CONFIG_* variables.

The relevant commit was backported and is present in 5.15.91 onwards,
but is not yet in 5.10.x.

[1] linux d5ea4fece450 ("kbuild: Allow kernel installation packaging to override pkg-config")

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/kernel.bbclass        | 9 ---------
 meta/recipes-kernel/linux/linux-yocto.inc | 7 ++-----
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index b43b4ff4fb..1ebf027281 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -251,7 +251,6 @@ KERNEL_EXTRA_ARGS ?= ""
 EXTRA_OEMAKE += ' CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}"'
 EXTRA_OEMAKE += ' HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"'
 EXTRA_OEMAKE += ' HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"'
-# Only for newer kernels (5.19+), native pkg-config variables are set for older kernels when building kernel and modules
 EXTRA_OEMAKE += ' HOSTPKG_CONFIG="pkg-config-native"'
 
 KERNEL_ALT_IMAGETYPE ??= ""
@@ -364,10 +363,6 @@ KERNEL_DEBUG_TIMESTAMPS ??= "0"
 kernel_do_compile() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 
-	# setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
-	export PKG_CONFIG_LIBDIR="${STAGING_LIBDIR_NATIVE}/pkgconfig:${STAGING_DATADIR_NATIVE}/pkgconfig"
-	export PKG_CONFIG_SYSROOT_DIR=""
-
 	if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then
 		# kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
 		# be set....
@@ -418,10 +413,6 @@ addtask transform_kernel after do_compile before do_install
 do_compile_kernelmodules() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 
-	# setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
-	export PKG_CONFIG_LIBDIR="${STAGING_LIBDIR_NATIVE}/pkgconfig:${STAGING_DATADIR_NATIVE}/pkgconfig"
-	export PKG_CONFIG_SYSROOT_DIR=""
-
 	if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then
 		# kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
 		# be set....
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index d57c1aae25..4e230d405a 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -88,9 +88,6 @@ do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pa
 EXTRA_OEMAKE += '${@bb.utils.contains("KERNEL_DEBUG", "True", "", "PAHOLE=false", d)}'
 
 do_devshell:prepend() {
-    # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
-    d.setVar("PKG_CONFIG_PATH", "")
-    d.setVar("PKG_CONFIG_LIBDIR", "${STAGING_LIBDIR_NATIVE}/pkgconfig:${STAGING_DATADIR_NATIVE}/pkgconfig")
-    d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
-    d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
+    d.setVar("HOSTPKG_CONFIG", "pkg-config-native")
+    d.appendVar("OE_TERMINAL_EXPORTS", " HOSTPKG_CONFIG")
 }
-- 
2.43.0



  parent reply	other threads:[~2026-01-23 18:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 18:04 [PATCH 0/8] Rationalise the pkg-config variables Ross Burton
2026-01-23 18:04 ` [PATCH 1/8] pkgconfig: inherit the pkgconfig class Ross Burton
2026-01-23 18:04 ` [PATCH 2/8] perf: " Ross Burton
2026-01-23 18:04 ` [PATCH 3/8] python3-numpy: backport a Meson patch to fix pkg-config lookups Ross Burton
2026-01-23 18:04 ` [PATCH 4/8] classes/pkgconfig: move variable exports to the class Ross Burton
2026-01-23 18:04 ` [PATCH 5/8] classes/pkgconfig: rationalise variable usage Ross Burton
2026-01-28 13:30   ` [OE-core] " Mathieu Dubois-Briand
2026-01-29  6:17     ` Mathieu Dubois-Briand
2026-02-06 10:29       ` Ross Burton
2026-01-23 18:04 ` [PATCH 6/8] pkgconf: small cleanups Ross Burton
2026-01-23 18:04 ` [PATCH 7/8] pkgconf: add pkg-config-native to the nativesdk package Ross Burton
2026-01-23 18:04 ` Ross Burton [this message]
2026-01-23 18:07 ` [OE-core] [PATCH 0/8] Rationalise the pkg-config variables Ross Burton

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=20260123180448.2997378-9-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.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