* Added 0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch
  - pkgconfigdeps.sh unconditionally emits /usr/bin/pkg-config as a hard
    Requires for packages shipping .pc files. In OE/Yocto cross-compilation,
    pkg-config is a host-only build tool not needed on the target rootfs,
    causing do_rootfs and do_populate_sdk failures with -dev packages.

Signed-off-by: Sumanth Gavini <[email protected]>
---
 ...-Do-not-emit-usr-bin-pkg-config-as-a.patch | 59 +++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_6.0.2.bb        |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 
meta/recipes-devtools/rpm/files/0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch

diff --git 
a/meta/recipes-devtools/rpm/files/0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch
 
b/meta/recipes-devtools/rpm/files/0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch
new file mode 100644
index 0000000000..4b9f1e1dac
--- /dev/null
+++ 
b/meta/recipes-devtools/rpm/files/0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch
@@ -0,0 +1,59 @@
+From f7d33d39e48d8b8c99af1e97bcb4740a9ba6204a Mon Sep 17 00:00:00 2001
+From: Sumanth Gavini <[email protected]>
+Date: Wed, 29 Jul 2026 09:10:47 -0700
+Subject: [PATCH] pkgconfigdeps.sh: Do not emit /usr/bin/pkg-config as a
+ Requires dependency
+
+RPM upstream commit 67b68cbeb978 ("pkgconfig dependency script fixes")
+changed the --requires output to unconditionally emit
+/usr/bin/pkg-config
+as a hard Requires for every package that ships .pc files.
+
+This is appropriate for native RPM-based distributions (e.g., Fedora,
+RHEL) where pkg-config is a target package installed alongside -devel
+packages on the same development machine. In those environments,
+requiring
+pkg-config at runtime makes sense.
+
+However, in cross-compilation environments such as OpenEmbedded/Yocto,
+pkg-config is a host-side build tool used only at compile time to locate
+libraries and their compiler/linker flags via .pc files. The target
+rootfs
+is a cross-compiled embedded image where pkg-config is not installed and
+not needed - the software is already compiled, and the .pc files in -dev
+packages are intended for SDK/sysroot use on the build host, not for
+running pkg-config on the target device.
+
+With rpm 6 using its internal dependency generator (rpm 4.x allowed
+disabling it via _use_internal_dependency_generator=0, but rpm 6 makes
+that a hard failure for v6 format packages), this file-path dependency
+ends up in every -dev package's RPM metadata, causing do_rootfs and
+do_populate_sdk failures:
+
+  Error: nothing provides /usr/bin/pkg-config needed by
+  acl-dev-2.4.0-r0.x86_64_v3 from oe-repo
+
+Remove the emission of the /usr/bin/pkg-config file path from the
+--requires output. The pkgconfig(foo) virtual provides/requires
+(e.g., pkgconfig(glib-2.0)) are not affected and continue to work
+correctly for build-time dependency resolution between recipes.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Sumanth Gavini <[email protected]>
+---
+ scripts/pkgconfigdeps.sh | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/scripts/pkgconfigdeps.sh b/scripts/pkgconfigdeps.sh
+index ef4581856..1cab58169 100755
+--- a/scripts/pkgconfigdeps.sh
++++ b/scripts/pkgconfigdeps.sh
+@@ -43,8 +43,6 @@ case $1 in
+     while read filename ; do
+     case "${filename}" in
+     *.pc)
+-      i="`expr $i + 1`"
+-      [ $i -eq 1 ] && echo "$pkgconfig"
+       DIR="`dirname ${filename}`"
+       export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+       $pkgconfig --print-requires --print-requires-private "$filename" 2> 
/dev/null | while read n r v ; do
diff --git a/meta/recipes-devtools/rpm/rpm_6.0.2.bb 
b/meta/recipes-devtools/rpm/rpm_6.0.2.bb
index e8977aa31a..32ddebe407 100644
--- a/meta/recipes-devtools/rpm/rpm_6.0.2.bb
+++ b/meta/recipes-devtools/rpm/rpm_6.0.2.bb
@@ -39,6 +39,7 @@ SRC_URI = 
"git://github.com/rpm-software-management/rpm;branch=rpm-6.0.x;protoco
            
file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \
            file://0001-tools-elfdeps.cc-Remove-format-module.patch \
            
file://0001-macros.in-Set-_pkgverify_level-to-digest-as-RCPM-4.2.patch \
+           
file://0001-pkgconfigdeps.sh-Do-not-emit-usr-bin-pkg-config-as-a.patch \
            "
 
 PE = "1"
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#242692): 
https://lists.openembedded.org/g/openembedded-core/message/242692
Mute This Topic: https://lists.openembedded.org/mt/120589449/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to