when I compile the program with ‘-fsanitize=address’ flag, link error occurred。It seems like ‘libasan.so’ could not be found.
You can try the procedure below on WP76 R13.3 to get the library:
-
download the yocto source code
https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-13,-d-,1-components/#sthash.YCBCjRWU.dpbs -
open ./meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc and add the following line:
IMAGE_INSTALL_append = " libasan"
- make the yocto image by “make”
owner@CNHKG-EX-001367:~/Yocto/WP76/R13.3/yocto$ find ./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/gcc-sanitizers/7.3.0-r0/image/usr/ -name “libasan*”
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/gcc-sanitizers/7.3.0-r0/image/usr/lib/libasan.so.4
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/gcc-sanitizers/7.3.0-r0/image/usr/lib/libasan.so.4.0.0
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/gcc-sanitizers/7.3.0-r0/image/usr/lib/libasan_preinit.o
./build_bin/tmp/work/armv7a-neon-poky-linux-gnueabi/gcc-sanitizers/7.3.0-r0/image/usr/lib/libasan.so
Hi jyijyi
It works!Thank you very much
Hi, jyijyi
There is another question to ask you. After compile the package with the configuration IMAGE_INSTALL_append = " libasan", I got “libasan.so” and “libubsan.so” in the lib folder. But “libtsan.so” and " liblsan.so" can not be found in the same folder.
I tried to add IMAGE_INSTALL_append = " libtsan" and make it, the compilation ended with an error of which shows "Couldn’t find anything to satisfy ‘libtsan’ ".
Could you give me some advice. Thanks