WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline pdietl

  • Newbie
  • *
  • Posts: 3
Creating an extension for a Shared Library
« on: March 15, 2017, 12:08:07 PM »
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: 736
Re: Creating an extension for a Shared Library
« Reply #1 on: March 15, 2017, 12:12:42 PM »
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, 12:20:25 PM »
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: 736
Re: Creating an extension for a Shared Library
« Reply #3 on: March 15, 2017, 12:42:00 PM »
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, 01:03:38 PM »
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!