Skip to contentSkip to conversation

depoly-ipks are missing the lib**.so file for shared library yocto recipe #kirkstone #yocto

DISCUSSION Altous, Salahaldeen 2 participants 3 messages Jun 10, 2024 – Jun 11, 2024

lore
Share & tools
lore
#0 lore raw

Hi All,

I have one yocto recipe which inherit meson as build system and generate the right libs in the image folder

├── liblc_core.so -> liblc_core.so.0
├── liblc_core.so.0 -> liblc_core.so.0.4.7
└── liblc_core.so.0.4.7

but in the deploy-ipks the .so symbolic link is missing
drwxr-xr-x root/root         0 2024-05-08 14:29 ./usr/
drwxr-xr-x root/root         0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root         0 2024-05-08 14:29 ./usr/lib/liblc_core.so.0 -> liblc_core.so.0.4.7 -rwxr-xr-x root/root     26536 2024-05-08 14:29 ./usr/lib/liblc_core.so.0.4.7

and in the dev-ipk package the missing *.so exist

drwxr-xr-x root/root         0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root         0 2024-05-08 14:29 ./usr/lib/liblc_core.so -> liblc_core.so.0

I need to have all in on files/symbolic-link in the release ipk, and the rootfs wihtout the need to install the dev-ipk later on, any idea what I need to add in the yocto recipe or the meson file?

Regards,

Salahaldeen

#1 lore raw
Quoted 12 lines · Salahaldeen via lists.yoctoproject.org

Hi All,

I have one yocto recipe which inherit meson as build system and generate the right libs in the image folder

├── liblc_core.so -> liblc_core.so.0
├── liblc_core.so.0 -> liblc_core.so.0.4.7
└── liblc_core.so.0.4.7
but in the deploy-ipks the .so symbolic link is missing 
drwxr-xr-x root/root         0 2024-05-08 14:29 ./usr/
drwxr-xr-x root/root         0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root         0 2024-05-08 14:29 ./usr/lib/liblc_core.so.0 -> liblc_core.so.0.4.7
Quoted 5 lines

-rwxr-xr-x root/root 26536 2024-05-08 14:29 ./usr/lib/liblc_core.so.0.4.7
and in the dev-ipk package the missing *.so exist
drwxr-xr-x root/root 0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root 0 2024-05-08 14:29 ./usr/lib/liblc_core.so -> liblc_core.so.0
I need to have all in on files/symbolic-link in the release ipk, and the rootfs wihtout the need to install the dev-ipk later on, any idea what I need to add in the yocto recipe or the meson file

This is intended behaviour. Conventionally, libraries are versioned (eg liblc_core.so <http://liblc_core.so/>.0.4.7) so that specific binaries link against specific ABIs at runtime, and there are convenience symlinks (liblc_core.so <http://liblc_core.so/>) that are used at link time so you can just link to liblc_core.so <http://liblc_core.so/> and that is resolved to a specific ABI version.

This means that at _runtime_ you need the real library, and not the symlink. The symlinks are packaged into the -dev package alongside the headers because they’re only needed if you’re compiling code.

This is convention, and there are exceptions. There are two possibilities here:

1) The versioned shared library shouldn’t be versioned, because other binaries use dlopen(“liblc_core.so <http://liblc_core.so/>”) at runtime instead of linking to it at build time. If this is the case then if it’s sensible remove the versioning entirely (as it’s pointless) and read https://docs.yoctoproject.org/next/dev-manual/prebuilt-libraries.html#non-versioned-libraries.

2) You don’t actually need the .so at runtime.

Ross

#2 lore raw

Hi Ross,

Quoted 40 lines · Ross Burton
Quoted 8 lines · Salahaldeen via lists.yoctoproject.org

Hi All,

I have one yocto recipe which inherit meson as build system and generate the right libs in the image folder

├── liblc_core.so -> liblc_core.so.0
├── liblc_core.so.0 -> liblc_core.so.0.4.7
└── liblc_core.so.0.4.7
Quoted 13 lines

but in the deploy-ipks the .so symbolic link is missing drwxr-xr-x root/root 0 2024-05-08 14:29 ./usr/
drwxr-xr-x root/root 0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root 0 2024-05-08 14:29 ./usr/lib/liblc_core.so.0 -> liblc_core.so.0.4.7
-rwxr-xr-x root/root 26536 2024-05-08 14:29 ./usr/lib/liblc_core.so.0.4.7 and in the dev-ipk package the missing *.so exist
drwxr-xr-x root/root 0 2024-05-08 14:29 ./usr/lib/
lrwxrwxrwx root/root 0 2024-05-08 14:29 ./usr/lib/liblc_core.so -> liblc_core.so.0
I need to have all in on files/symbolic-link in the release ipk, and the rootfs wihtout the need to install the dev-ipk later on, any idea what I need to add in the yocto recipe or the meson file

This is intended behaviour. Conventionally, libraries are versioned (eg liblc_core.so < http://liblc_core.so/>.0.4.7 ) so that specific binaries link against specific ABIs at runtime, and there are convenience symlinks (liblc_core.so < http://liblc_core.so/ >) that are used at link time so you can just link to liblc_core.so < http://liblc_core.so/ > and that is resolved to a specific ABI version.

This means that at _runtime_ you need the real library, and not the symlink. The symlinks are packaged into the -dev package alongside the headers because they’re only needed if you’re compiling code.

This is convention, and there are exceptions. There are two possibilities here:

Quoted 7 lines

1) The versioned shared library shouldn’t be versioned, because other
binaries use dlopen(“liblc_core.so < http://liblc_core.so/ >”) at runtime
instead of linking to it at build time. If this is the case then if it’s
sensible remove the versioning entirely (as it’s pointless) and read https://docs.yoctoproject.org/next/dev-manual/prebuilt-libraries.html#non-versioned-libraries
.

2) You don’t actually need the .so at runtime.

thanks for the explanation, I will remove the versioning and add these variables to my recipes

SOLIBS = ".so"
FILES_SOLIBSDEV = ""

"The symlinks are packaged into the -dev package alongside the headers because they’re only needed if you’re compiling code"

Can I use the -dev package to cross compile?

similar to the sysroot in the yocto-SDK

Regards,

Salah

Quoted 3 lines

Ross