If you try and use pkg-config from buildtools-tarball, you find it is searching host paths: pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build> source buildtools/environment-setup-x86_64-pokysdk-linux pokybuild@opensuse154-ty-2:~/yocto-worker/oe-selftest/build> strace -f pkg-config --variable=dridriverdir dri will show it searched: /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/pkgconfig /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/share/pkgconfig We'll need to set PKG_CONFIG_PATH to search the sysroot, then the host locations within the SDK environment.
Note that when this is resolved we should be able to revert "selftest/virgl: use pkg-config from the host".
Reproducer: install buildtools tarball, source the env, run "pkg-config --cflags drm". The search path is "suboptimal".
buildtools-tarball-extended, that is. Normal buildtools has no pkgconfig.
Patch on the list to add PKG_CONFIG_LIBDIR to the buildtools environment script.
Fixed in 8f768a3f4c7ff477e994d60800e5a1b83891615a.