OpenEmbedded core build bitbake command fails for Apalis TK1, with bitbake -k angstrom-qt-x11-image(target) returns exit 1: libavahi-common.so.3 cannot open shared object file: No such file or directory

Hello I using Apalis TK1 and Ixora Carrier Board and my host machine is x86_64 with ubuntu 16.04. I want an angstrom-qt-x11-image for a project which streams video with an option of recording that video.
I am following this article: High performance, low power Embedded Computing Systems | Toradex Developer Center.

I have tried building OpenEmbedded core, with bitbake command but build fails for Apalis TK1, with bitbake target angstrom-qt-x11-image : libavahi-common.so.3 cannot open shared object file: No such file or directory

My commands:

cd oe-core
. export
bitbake -k angstrom-qt-x11-image

Error Message:

/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject/tmp-introspect00_sxzsc/.libs/Avahi-0.6: error while loading shared libraries: libavahi-common.so.3: cannot open shared object file: No such file or directory
| If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help.
| (typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" )
| Command '['/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/recipe-sysroot/usr/bin/g-ir-scanner-qemuwrapper', '/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject/tmp-introspectud1lt63s/.libs/Avahi-0.6', '--introspect-dump=/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject/tmp-introspectud1lt63s/functions.txt,/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject/tmp-introspectud1lt63s/dump.xml']' returned non-zero exit status 1
| /home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/recipe-sysroot/usr/share/gobject-introspection-1.0/Makefile.introspection:159: recipe for target 'Avahi-0.6.gir' failed
| make[2]: *** [Avahi-0.6.gir] Error 1
| make[2]: Leaving directory '/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject'
| Makefile:923: recipe for target 'install' failed
| make[1]: *** [install] Error 2
| make[1]: Leaving directory '/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-gobject'
| Makefile:799: recipe for target 'install-recursive' failed
| make: *** [install-recursive] Error 1
| ERROR: oe_runmake failed
| WARNING: /home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/temp/run.do_install.3724:1 exit 1 from 'exit 1'

I have a libavahi-common.so.3 symlink in following location which is pointing to libavahi-common.so.3.5.3 in the same location:

/usr/lib/x86_64-linux-gnu/libavahi-common.so.3 -> libavahi-common.so.3.5.3

I also tried export GIR_EXTRA_LIBS_PATH=/usr/lib/x86_64-linux-gnu/
But this does not work.

Maybe you installed this library recently and didn’t update the linker cache? (Doesn’t make sense tho, otherwise it wouldn’t appear in the -p). Please execute sudo ldconfig and try rebuilding again.

In order to check if it is an environment issue, could you make a quick test making a symlink to /lib/ with the same file name of the file? In a normal scenario, I would heavily not recommend playing with the libs by hand, but if there is no collision libavahi-common.so.3 in /lib/ it should be ok (just for a quick test, delete afterwards for consistency i.e. in future updates!). Remember to update the linker cache with sudo ldconfig. Also, related to this, please double check with file /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 that it is what it should be (and its origin as well: a ELF 64-bit LSB shared object, x86-64)

Dear @akshay, can you show us the output of ldconfig -p | grep "avahi"?

Thank You for your reply. Please find the output of ldconfig -p | grep "avahi":

ubuntu@ubuntu-H81M-S:~$ ldconfig -p | grep "avahi"
	libavahi-ui-gtk3.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-ui-gtk3.so.0
	libavahi-glib.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-glib.so.1
	libavahi-core.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-core.so.7
	libavahi-common.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
	libavahi-client.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3
ubuntu@ubuntu-H81M-S:~$

I executed sudo ldconfig and tried rebuilding.
I am including the output in attachment.[link text][1]
[1]: https://share.toradex.com/xdm4na4lgbwyd80?direct

The output of file command
ubuntu@ubuntu-H81M-S:~$ file /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3: symbolic link to libavahi-common.so.3.5.3

ubuntu@ubuntu-H81M-S:~$ file /usr/lib/x86_64-linux-gnu/libavahi-common.so.3.5.3
/usr/lib/x86_64-linux-gnu/libavahi-common.so.3.5.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0f9283486b17533997e6bb336974cd4131bc5633, stripped

I think I do not have libavahi-common.so.3 in /lib/ directory
The output of find command returns empty.

I am relatively new to linux os, I didn’t understand this part of your comment

In order to check if it is an environment issue, could you make a quick test making a symlink to /lib/ with the same file name of the file? In a normal scenario, I would heavily not recommend playing with the libs by hand, but if there is no collision libavahi-common.so.3 in /lib/ it should be ok (just for a quick test, delete afterwards for consistency i.e. in future updates!). Remember to update the linker cache with sudo ldconfig.<

Thank you for your efforts.

HI Akshay

Did you try the following:

If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help. (typically like this: GIR_EXTRA_LIBS_PATH=“${B}/something/.libs” )

How to set GIR_EXTRA_LIBS_PATH in the recipe, which file I have to modify or I just have to use terminal command export GIR_EXTRA_LIBS_PATH=“${B}/something/.libs” ?
Does ${B} means build path (in my case “/home/ubuntu/oe-core/build/”), am I understanding this correctly ?
Thank you.

Hello alvaro.tx, jaski.tx, I modified in oe-core/export file and inserted path of libavahi-common.so.3 using export command. It didn’t worked.
So I tried inserting this path in local.conf file. Added this as last line

GIR_EXTRA_LIBS_PATH=“/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-common/.libs”

This also failed.
What is the proper way of setting GIR_EXTRA_LIBS_PATH to this address “/home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-common/.libs”

Thank you.

@alvaro.tx @akshay OpenEmbedded provides its own build environment, and should only link against libraries within its sysroot. Checking the avahi host libraries or/and pointing GIR_EXTRA_LIBS_PATH to the host libraries is the wrong approach entirely.

Which branch of the BSP are you using, e.g. which branch did you specify in the repo init command?

Did you make sure you that you installed all prerequisites? Especially also the ones documented in the OpenEmbedded Getting Started wiki?

Dear Stefan,
I used following commands to init repo
repo init -u Index of /toradex-bsp-platform.git -b LinuxImageV2.8

Update to the HEAD Revision
repo init -b LinuxImageV2.8
repo sync

Update Version Tag
repo init -b refs/tags/Apalis-TK1_LXDE-Image_2.8b2.97-20180331

Yes I did installed all ubuntu prerequisites pointed by Getting started - Openembedded.org

I have libavahi-common.so.3.5.3 library in /home/ubuntu/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-common/.libs

    ubuntu@ubuntu-H81M-S:~/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-common/.libs$ ls -l *so*
    lrwxrwxrwx 1 ubuntu ubuntu     24 May 26 13:34 libavahi-common.so -> libavahi-common.so.3.5.3
    lrwxrwxrwx 1 ubuntu ubuntu     24 May 26 13:34 libavahi-common.so.3 -> libavahi-common.so.3.5.3
    -rwxr-xr-x 1 ubuntu ubuntu 157972 May 26 13:34 libavahi-common.so.3.5.3

ubuntu@ubuntu-H81M-S:~/oe-core/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/avahi/0.6.32-r0/build/avahi-common/.libs$ file libavahi-common.so.3.5.3 
libavahi-common.so.3.5.3: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=48819c1cdb497af6847d3588d999d8e529f801df, not stripped

In following location /home/ubuntu/oe-core/layers/openembedded-core/meta/recipes-connectivity/avahi/avahi.inc file there is a function

do_compile_prepend() {
    export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
}

I think all libraries and their symlinks are present in their respective paths, e.g libavahi-gobject.so is present in ${B}/avahi-gobject/.libs, libavahi-common.so.3.5.3 is present in ${B}/avahi-common/.libs, libavahi-client.so.3.2.9 is present in ${B}/avahi-client/.libs and libavahi-glib.so.1.0.2 is present in ${B}/avahi-glib/.libs.

If I copy libavahi-common.so.3 to ${B}/avahi-gobject/.libs then ‘libavahi-common.so.3 not found error’ disappears but a new error appears ‘libavahi-client.so.3: cannot open shared object file: No such file or directory’

How to set path GIR_EXTRA_LIBS_PATH to above mentioned locations ?

Regards akshay

Hi Akshay

Unfortunately at this point, we cannot reproduce the issue. The best will be if you start from scratch by checking out the git branch in a different folder and do the bitbake compilation again.