WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Creating an extension for a Shared Library  (Read 491 times)

Offline pdietl

  • WikiUser
  • *
  • Posts: 3
Creating an extension for a Shared Library
« on: March 15, 2017, 08:08:07 AM »
So when a tcz file is loaded, an optional script can be automatically ran. When one is creating an extension for a shared object library, does one need to include a script which calls ldconfig to add your library to the cache?

Offline polikuo

  • Full Member
  • ***
  • Posts: 239
Re: Creating an extension for a Shared Library
« Reply #1 on: March 15, 2017, 08:12:42 AM »
If you configured with --prefix=/usr/local
It's OK to omit the start-up script.

Offline pdietl

  • WikiUser
  • *
  • Posts: 3
Re: Creating an extension for a Shared Library
« Reply #2 on: March 15, 2017, 08:20:25 AM »
So say your squahsfs is
    /usr/local/lib/thing.so
    /usr/local/lib/thing.so.1
    /usr/local/lib/thing.so.1.0.0

When you load the fs, it will copy those files from the tcz into those directories.
But is ld.so.cache automatically updated? If it isn't then the loader should not be able to find them.

Offline polikuo

  • Full Member
  • ***
  • Posts: 239
Re: Creating an extension for a Shared Library
« Reply #3 on: March 15, 2017, 08:42:00 AM »
When you load the fs, it will copy those files from the tcz into those directories.
Unless you have copy2fs enabled.
Otherwise, the symbolic link is created instead.

Quote
But is ld.so.cache automatically updated? If it isn't then the loader should not be able to find them.
It's written inside the tce-load script.

Offline pdietl

  • WikiUser
  • *
  • Posts: 3
Re: Creating an extension for a Shared Library
« Reply #4 on: March 15, 2017, 09:03:38 AM »
Ah that makes sense. I should have considered that tce-load is a shell script. For anyone else who is curious, th ldconfig set is performed in the "update_system" function.

Thanks for the help!