@@ -136,6 +136,14 @@ python () {
if not(d.getVar('PTEST_ENABLED') == "1"):
for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
bb.build.deltask(i, d)
+
+ # On-target compile tests need the clang driver when built with clang
+ if d.getVar('TCOVERRIDE') == 'toolchain-clang':
+ var = 'RDEPENDS:%s-ptest' % d.getVar('PN')
+ rdeps = bb.utils.explode_deps(d.getVar(var) or '')
+ if any(p in rdeps for p in ('gcc', 'gcc-symlinks', 'g++', 'g++-symlinks',
+ 'packagegroup-core-buildessential')):
+ d.appendVar(var, ' clang')
}
QARECIPETEST[missing-ptest] = "package_qa_check_missing_ptest"
@@ -29,3 +29,4 @@ RDEPENDS:packagegroup-core-buildessential = "\
pkgconfig \
"
+RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = " clang"
When the target is built with the clang toolchain, python's sysconfig and perl's Config record ${TARGET_PREFIX}clang as the C compiler, so anything compiling on the target through them fails when only gcc is installed: FileNotFoundError: [Errno 2] No such file or directory: 'x86_64-yoe-linux-clang' The target clang package installs the ${TARGET_PREFIX}clang symlinks. Add it to packagegroup-core-buildessential, and in ptest.bbclass append it to the ptest RDEPENDS of any recipe built with clang whose ptest already pulls in gcc, g++, their -symlinks packages or packagegroup-core-buildessential. This covers python3, python3-cffi, elfutils and others without per-recipe appends. Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- meta/classes-recipe/ptest.bbclass | 8 ++++++++ .../packagegroups/packagegroup-core-buildessential.bb | 1 + 2 files changed, 9 insertions(+)