WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline pdietl

  • Newbie
  • *
  • Posts: 3
Creating an extension for a Shared Library
« on: March 15, 2017, 09: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

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

Offline pdietl

  • Newbie
  • *
  • Posts: 3
Re: Creating an extension for a Shared Library
« Reply #2 on: March 15, 2017, 09: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

  • Hero Member
  • *****
  • Posts: 714
Re: Creating an extension for a Shared Library
« Reply #3 on: March 15, 2017, 09: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

  • Newbie
  • *
  • Posts: 3
Re: Creating an extension for a Shared Library
« Reply #4 on: March 15, 2017, 10: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!