Getting Error while cross compiling iotivity stack for yocto with debug enable " cannot find -lgcov"

242 views Asked by At

These logs i'm getting after running "scons TARGET_OS=yocto TARGET_ARCH=i586 TARGET_TRANSPORT=BLE TC_PREFIX=i586-poky-linux- TC_PATH=/opt/poky-edison/1.6/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux RELEASE=0"

scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: out/yocto/i586/debug
Linking out/yocto/i586/debug/service/resource-encapsulation/src/common/librcs_common.so
/opt/poky-edison/1.6/sysroots/x86_64-pokysdk-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/4.8.2/ld: cannot find -lgcov
collect2: error: ld returned 1 exit status
scons: *** [out/yocto/i586/debug/service/resource-encapsulation/src/common/librcs_common.so] Error 1
scons: building terminated because of errors.

--> this seems a linking error so i tried installing gcovr and lcov. still i'm getting same error, so anyone hav faced or resolved this issue please help me into this.

2

There are 2 answers

0
Mats Wichmann On

Linking with gcov in debug mode (RELEASE=0) is new, maybe there's an error in the way it makes it into the yocto build. There are holes in the cross-building story, filing a bug would help track things (https://jira.iotivity.org). The two pkgs you installed have no effect on this, they are tools and the complaint is about missing the library - do you have libgcov in the cross-build environment (sysroot)? On my system I'm seeing it two places:

/usr/lib/gcc/x86_64-redhat-linux/7/libgcov.a
/usr/lib/gcc/arm-none-eabi/7.1.0/libgcov.a  + target-specific variants

the latter is not in use for iotivity, but shows an installation in what would be a cross toolchain if it were being used. The former comes from pkg gcc-7.1.1-3.fc26.x86_64 and the latter comes from pkg arm-none-eabi-gcc-cs-7.1.0-2.fc26.x86_64.

0
RzR On

Are you building along bitbake ? If yes it should work on poky, unless you use clang where a couple of patches related gcov are needed.

https://gerrit.iotivity.org/gerrit/#/c/18437/

Anyway report bug with yocto label I will have a look