Skip to contentSkip to conversation

Shared library packaging

DISCUSSION Gary Thomas 3 participants 5 messages Mar 16, 2011 – Mar 17, 2011

lore
Share & tools
lore
#0 lore raw

I'm working on a recipe which has a number of shared libraries (actually this is just an import from OE (mozilla/nss) which has the same problem as listed below) The package creates a number of libraries (from the work tree):

    image/usr/lib/libsmime3.so -> libsmime3.so.1oe
    image/usr/lib/libsmime3.so.1oe
    image/usr/lib/libsoftokn3.so
    image/usr/lib/libfreebl3.so
    image/usr/lib/libnssutil3.so -> libnssutil3.so.1oe
    image/usr/lib/libnssutil3.so.1oe
    image/usr/lib/libnss3.so -> libnss3.so.1oe
    image/usr/lib/libnss3.so.1oe
    image/usr/lib/libssl3.so -> libssl3.so.1oe
    image/usr/lib/libssl3.so.1oe

The .so.1oe files are packaged in nss_XXX.ipk and the .so files are put into nss-dev_XXX.ipk. The problem is that there is code out there that only wants to look for the .so files (no -dev packages installed) and fail to find libsoftokn3.so and libfreebl3.so

Is there a way to [easily?] force these two libraries to be packaged into nss-XXX.ipk?

My current workaround is to use a post-install script to create the .so files from the .so.1oe files for these two libraries. It gets my code (chromium-11 browser!) to work, but it's not very satisfying.

Any ideas? Thanks

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 14 lines · Gary Thomas

I'm working on a recipe which has a number of shared libraries (actually this is just an import from OE (mozilla/nss) which has the same problem as listed below) The package creates a number of libraries (from the work tree):

     image/usr/lib/libsmime3.so -> libsmime3.so.1oe
     image/usr/lib/libsmime3.so.1oe
     image/usr/lib/libsoftokn3.so
     image/usr/lib/libfreebl3.so
     image/usr/lib/libnssutil3.so -> libnssutil3.so.1oe
     image/usr/lib/libnssutil3.so.1oe
     image/usr/lib/libnss3.so -> libnss3.so.1oe
     image/usr/lib/libnss3.so.1oe
     image/usr/lib/libssl3.so -> libssl3.so.1oe
     image/usr/lib/libssl3.so.1oe
Quoted 4 lines

The .so.1oe files are packaged in nss_XXX.ipk and the .so files are put into nss-dev_XXX.ipk. The problem is that there is code out there that only wants to look for the .so files (no -dev packages installed) and fail to find libsoftokn3.so and libfreebl3.so

This sounds like an error in the SONAME embedded in the files. For example if the soname of libnss2.so.1oe, is libnss3.so, both it and the link will be captured in the base package -- leaving the -dev empty.

(If the SONAME is correct and it's not working this way that is likely a bug in the routines breaking up base and dev packages!)

Quoted 2 lines

Is there a way to [easily?] force these two libraries to be packaged into nss-XXX.ipk?

Assuming fixing the sonames is not an option, the alternative is to specify the packages and FILES_... list of files for each chunk instead of letting the system determine things automatically. It's a bit messier, but you have ultimate control of what is and is not included...

Quoted 3 lines

My current workaround is to use a post-install script to create the .so files from the .so.1oe files for these two libraries. It gets my code (chromium-11 browser!) to work, but it's not very satisfying.

If possible, fix the soname item... otherwise there can be loader problems if the device doesn't end up with an ld.so.cache... (which is why the link is working I suspect...)

--Mark

Quoted 2 lines

Any ideas? Thanks

#2 lore raw
Quoted 20 lines · Mark Hatle
Quoted 14 lines · Gary Thomas

I'm working on a recipe which has a number of shared libraries (actually this is just an import from OE (mozilla/nss) which has the same problem as listed below) The package creates a number of libraries (from the work tree):

      image/usr/lib/libsmime3.so ->  libsmime3.so.1oe
      image/usr/lib/libsmime3.so.1oe
      image/usr/lib/libsoftokn3.so
      image/usr/lib/libfreebl3.so
      image/usr/lib/libnssutil3.so ->  libnssutil3.so.1oe
      image/usr/lib/libnssutil3.so.1oe
      image/usr/lib/libnss3.so ->  libnss3.so.1oe
      image/usr/lib/libnss3.so.1oe
      image/usr/lib/libssl3.so ->  libssl3.so.1oe
      image/usr/lib/libssl3.so.1oe
Quoted 4 lines

The .so.1oe files are packaged in nss_XXX.ipk and the .so files are put into nss-dev_XXX.ipk. The problem is that there is code out there that only wants to look for the .so files (no -dev packages installed) and fail to find libsoftokn3.so and libfreebl3.so

Quoted 6 lines

This sounds like an error in the SONAME embedded in the files. For example if the soname of libnss2.so.1oe, is libnss3.so, both it and the link will be captured in the base package -- leaving the -dev empty.

(If the SONAME is correct and it's not working this way that is likely a bug in the routines breaking up base and dev packages!)

How can I check this (not my comfort zone)?

Quoted 9 lines
Quoted 3 lines

Is there a way to [easily?] force these two libraries to be packaged into nss-XXX.ipk?

Assuming fixing the sonames is not an option, the alternative is to specify the packages and FILES_... list of files for each chunk instead of letting the system determine things automatically. It's a bit messier, but you have ultimate control of what is and is not included...

Quoted 7 lines
Quoted 3 lines

My current workaround is to use a post-install script to create the .so files from the .so.1oe files for these two libraries. It gets my code (chromium-11 browser!) to work, but it's not very satisfying.

If possible, fix the soname item... otherwise there can be loader problems if the device doesn't end up with an ld.so.cache... (which is why the link is working I suspect...)

I think the problem is in some very messy Mozilla code that uses dl_load() directly and only looks for the .so file name.

I'll probably go with the FILES solution.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#3 lore raw
Quoted 21 lines · Gary Thomas
Quoted 20 lines · Mark Hatle
Quoted 18 lines · Gary Thomas

I'm working on a recipe which has a number of shared libraries (actually this is just an import from OE (mozilla/nss) which has the same problem as listed below) The package creates a number of libraries (from the work tree):

      image/usr/lib/libsmime3.so ->  libsmime3.so.1oe
      image/usr/lib/libsmime3.so.1oe
      image/usr/lib/libsoftokn3.so
      image/usr/lib/libfreebl3.so
      image/usr/lib/libnssutil3.so ->  libnssutil3.so.1oe
      image/usr/lib/libnssutil3.so.1oe
      image/usr/lib/libnss3.so ->  libnss3.so.1oe
      image/usr/lib/libnss3.so.1oe
      image/usr/lib/libssl3.so ->  libssl3.so.1oe
      image/usr/lib/libssl3.so.1oe

The .so.1oe files are packaged in nss_XXX.ipk and the .so files are put into nss-dev_XXX.ipk. The problem is that there is code out there that only wants to look for the .so files (no -dev packages installed) and fail to find libsoftokn3.so and libfreebl3.so

Quoted 8 lines
Quoted 6 lines

This sounds like an error in the SONAME embedded in the files. For example if the soname of libnss2.so.1oe, is libnss3.so, both it and the link will be captured in the base package -- leaving the -dev empty.

(If the SONAME is correct and it's not working this way that is likely a bug in the routines breaking up base and dev packages!)

How can I check this (not my comfort zone)?

I usually run "readelf -a <library>" and then grep for SONAME.

It's likely better to run the target version of readelf if the target is not IA32.

Quoted 13 lines
Quoted 13 lines
Quoted 3 lines

Is there a way to [easily?] force these two libraries to be packaged into nss-XXX.ipk?

Assuming fixing the sonames is not an option, the alternative is to specify the packages and FILES_... list of files for each chunk instead of letting the system determine things automatically. It's a bit messier, but you have ultimate control of what is and is not included...

Quoted 3 lines

My current workaround is to use a post-install script to create the .so files from the .so.1oe files for these two libraries. It gets my code (chromium-11 browser!) to work, but it's not very satisfying.

Quoted 9 lines
Quoted 3 lines

If possible, fix the soname item... otherwise there can be loader problems if the device doesn't end up with an ld.so.cache... (which is why the link is working I suspect...)

I think the problem is in some very messy Mozilla code that uses dl_load() directly and only looks for the .so file name.

I'll probably go with the FILES solution.

Ya, dl_loaded files don't follow the normal conventions, the files approach is likely your only solution then.

--Mark

#4 lore raw
Quoted 52 lines · Mark Hatle
Quoted 21 lines · Gary Thomas
Quoted 20 lines · Mark Hatle
Quoted 18 lines · Gary Thomas

I'm working on a recipe which has a number of shared libraries (actually this is just an import from OE (mozilla/nss) which has the same problem as listed below) The package creates a number of libraries (from the work tree):

      image/usr/lib/libsmime3.so ->  libsmime3.so.1oe
      image/usr/lib/libsmime3.so.1oe
      image/usr/lib/libsoftokn3.so
      image/usr/lib/libfreebl3.so
      image/usr/lib/libnssutil3.so ->  libnssutil3.so.1oe
      image/usr/lib/libnssutil3.so.1oe
      image/usr/lib/libnss3.so ->  libnss3.so.1oe
      image/usr/lib/libnss3.so.1oe
      image/usr/lib/libssl3.so ->  libssl3.so.1oe
      image/usr/lib/libssl3.so.1oe

The .so.1oe files are packaged in nss_XXX.ipk and the .so files are put into nss-dev_XXX.ipk. The problem is that there is code out there that only wants to look for the .so files (no -dev packages installed) and fail to find libsoftokn3.so and libfreebl3.so

Quoted 8 lines
Quoted 6 lines

This sounds like an error in the SONAME embedded in the files. For example if the soname of libnss2.so.1oe, is libnss3.so, both it and the link will be captured in the base package -- leaving the -dev empty.

(If the SONAME is correct and it's not working this way that is likely a bug in the routines breaking up base and dev packages!)

How can I check this (not my comfort zone)?

I usually run "readelf -a <library>" and then grep for SONAME.

It's likely better to run the target version of readelf if the target is not IA32.

Quoted 17 lines
Quoted 16 lines
Quoted 3 lines

Is there a way to [easily?] force these two libraries to be packaged into nss-XXX.ipk?

Assuming fixing the sonames is not an option, the alternative is to specify the packages and FILES_... list of files for each chunk instead of letting the system determine things automatically. It's a bit messier, but you have ultimate control of what is and is not included...

Quoted 3 lines

My current workaround is to use a post-install script to create the .so files from the .so.1oe files for these two libraries. It gets my code (chromium-11 browser!) to work, but it's not very satisfying.

If possible, fix the soname item... otherwise there can be loader problems if the device doesn't end up with an ld.so.cache... (which is why the link is working I suspect...)

Quoted 8 lines
Quoted 5 lines

I think the problem is in some very messy Mozilla code that uses dl_load() directly and only looks for the .so file name.

I'll probably go with the FILES solution.

Ya, dl_loaded files don't follow the normal conventions, the files approach is likely your only solution then.

if you enable QA/insane.bbclass then you will get QA errors for ".so" library symlinks in non-dev packages

So you might have to disable QA for this case.

Quoted 6 lines

--Mark
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 1 line
-Khem