rpmbuild implicitly injects this before all stages in the rpm build: PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig" This can cause problems for us, in particular for the cross-compile builds. They can then end up looking at the native pkg-config files rather than the cross-compile ones. This variable is set in %___build_pre. Unfortunately there doesn't seem to be any good abstraction for us to override this, so it looks like we'll have to redefine %___build_pre.
I built cendio-build-utils from a repo on a revision before the fix. I downgraded my cendio-build-utils package to the one that I built. I then added echo $PKG_CONFIG_PATH to a .spec-file and ran rpmbuild on it: + echo :/usr/lib64/pkgconfig:/usr/share/pkgconfig :/usr/lib64/pkgconfig:/usr/share/pkgconfig I then updated cendio-build-utils to the latest version and then ran rpmbuild on the same spec-file: + unset PKG_CONFIG_PATH + unset PKG_CONFIG_PATH + echo Looks good!