Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: pdietl on March 15, 2017, 12:08:07 PM

Title: Creating an extension for a Shared Library
Post by: pdietl 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?
Title: Re: Creating an extension for a Shared Library
Post by: polikuo on March 15, 2017, 12:12:42 PM
If you configured with --prefix=/usr/local
It's OK to omit the start-up script.
Title: Re: Creating an extension for a Shared Library
Post by: pdietl 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.
Title: Re: Creating an extension for a Shared Library
Post by: polikuo 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.
Title: Re: Creating an extension for a Shared Library
Post by: pdietl 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!