Bug 15007

Summary: nativesdk-pkgconfig doesn't work
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Richard Purdie <richard.purdie>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 0.0.0   
Target Milestone: 4.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2023-01-13 14:32:17 UTC
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.
Comment 1 Ross Burton 2023-01-19 15:51:47 UTC
Note that when this is resolved we should be able to revert "selftest/virgl: use pkg-config from the host".
Comment 2 Ross Burton 2023-01-19 17:06:52 UTC
Reproducer: install buildtools tarball, source the env, run "pkg-config --cflags drm".  The search path is "suboptimal".
Comment 3 Ross Burton 2023-01-20 12:49:57 UTC
buildtools-tarball-extended, that is.  Normal buildtools has no pkgconfig.
Comment 4 Ross Burton 2023-01-26 14:36:49 UTC
Patch on the list to add PKG_CONFIG_LIBDIR to the buildtools environment script.
Comment 5 Ross Burton 2023-02-09 16:02:15 UTC
Fixed in 8f768a3f4c7ff477e994d60800e5a1b83891615a.