diff options
authorQiu Tingting <>2023-04-19 09:27:59 +0800
committerRichard Purdie <>2023-04-27 14:41:00 +0100
commite8ccb880c85ec03d055f195f28ba6a838b4b93c7 (patch)
parentf430362a2bd2d40b878f09486bb42315867cdc2d (diff)
coreutils: Delete gcc sysroot parameter for ptest on target
If gcc is installed in image, ptest result has 4 ERROR. ERROR: tests/rm/ ERROR: tests/rm/ ERROR: tests/cp/ ERROR: tests/ls/ r-root.log as an example: -------------------------- k.c:1:10: fatal error: stdio.h: No such file or directory 1 | #include <stdio.h> | ^~~~~~~~~ compilation terminated. set-up failure: failed to build shared library ERROR tests/rm/ (exit status: 99) -------------------------- reason: The run-ptest calls make cmd to run test cases. In these cases, k.c file is created and compiled by gcc before run. There is a stdio.h file in /usr/include/ directory. Normally, gcc has /usr/include as part of its default search path. But in Makefile, it has the "--sysroot=recipe-sysroot" parameter which makes it does not work. solution: Delete "--sysroot=recipe-sysroot" from Makefile. other: If gcc is not installed in image, these cases will be skipped. Signed-off-by: Luca Ceresoli <>
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/ b/meta/recipes-core/coreutils/
index 4807eefd04..e12a6d6797 100644
--- a/meta/recipes-core/coreutils/
+++ b/meta/recipes-core/coreutils/
@@ -193,6 +193,7 @@ do_install_ptest () {
sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile
+ sed -i '/^CC =/s/ --sysroot=.*recipe-sysroot/ /g' ${D}${PTEST_PATH}/Makefile
chmod -R 777 ${D}${PTEST_PATH}
# Disable subcase, it will cause test framework hang