I set up a build ENV with docker container based on Ubuntu 16.04 image. and configure the ENV followed the guide as https://www.yoctoproject.org/docs/1.6.1/yocto-project-qs/yocto-project-qs.html but when I build the core-image-base with bitbake, It failed. report error logs as bellow iot@c1dddc62eb15:/workspace/yocto/build$ bitbake core-image-base ERROR: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-unsigned.bb: Error running gcc --version: | ETA: 0:00:05 WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-unsigned.bb: Exception during build_dependencies for create_shar WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-unsigned.bb: Error during finalise of /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-unsigned.bb ERROR: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-core/images/core-image-tiny.bb: Error running gcc --version: | ETA: 0:00:04 WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-core/images/core-image-tiny.bb: Exception during build_dependencies for create_shar WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-core/images/core-image-tiny.bb: Error during finalise of /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-core/images/core-image-tiny.bb ERROR: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-signed.bb: Error running gcc --version: WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-signed.bb: Exception during build_dependencies for create_shar WARNING: /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-signed.bb: Error during finalise of /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-selftest/images/secureboot-selftest-image-signed.bb ERROR: ExpansionError during parsing /workspace/yocto/build/../meta-bsp/meta-intel/common/recipes-core/images/core-image-tiny.bb | ETA: 0:00:04 Traceback (most recent call last): bb.data_smart.ExpansionError: Failure expanding variable create_shar, expression was # copy in the template shar extractor script cp /workspace/yocto/meta-yp/meta/files/toolchain-shar-extract.sh /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.sh rm -f /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/pre_install_command /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/post_install_command if [ 1 -eq 1 ] ; then cp /workspace/yocto/meta-yp/meta/files/toolchain-shar-relocate.sh /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/post_install_command fi cat << "EOF" >> /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/pre_install_command EOF cat << "EOF" >> /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/post_install_command EOF sed -i -e '/@SDK_PRE_INSTALL_COMMAND@/r /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/pre_install_command' \ -e '/@SDK_POST_INSTALL_COMMAND@/r /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/temp/post_install_command' \ /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.sh # substitute variables sed -i -e 's#@SDK_ARCH@#x86_64#g' \ -e 's#@SDKPATH@#/opt/alios/1.2.0#g' \ -e 's#@SDKEXTPATH@#~/alios_sdk#g' \ -e 's#@OLDEST_KERNEL@#3.2.0#g' \ -e 's#@REAL_MULTIMACH_TARGET_SYS@#core2-64-alios-linux#g' \ -e 's#@SDK_TITLE@#${@d.getVar("SDK_TITLE").replace('&', '\&')}#g' \ -e 's#@SDK_VERSION@#1.2.0#g' \ -e '/@SDK_PRE_INSTALL_COMMAND@/d' \ -e '/@SDK_POST_INSTALL_COMMAND@/d' \ -e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d)}#g' \ /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.sh # add execution permission chmod +x /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.sh # append the SDK tarball cat /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.tar.xz >> /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.sh # delete the old tarball, we don't need it anymore rm /workspace/yocto/build/tmp/work/qemux86_64-alios-linux/core-image-tiny/1.0-r0/x86_64-deploy-core-image-tiny-populate-sdk/alios-glibc-x86_64-core-image-tiny-core2-64-toolchain-1.2.0.tar.xz which triggered exception BBHandledException:
gcc version as below: iot@c1dddc62eb15:/workspace/yocto/build$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hi, Could you tell us which version of the project you're using? You pointed at documentation for 1.6 which is quite an old release and no longer supported. To fix this you'd need to track down where gcc --version is being called from. It not quite clear exactly what the error is here...
Also, please let us know which layers you're using and how you triggered the error.
I have solved this issue, thanks
it caused by the ENV configuration