Re: [linux-audio-dev] linking multiple .o plugins into a single .so library

From: Paul Davis <paul@email-addr-hidden>
Date: Thu Jun 30 2005 - 21:31:04 EEST

On Thu, 2005-06-30 at 19:32 +0200, fons adriaensen wrote:
> On Thu, Jun 30, 2005 at 07:59:51PM +0300, Artemio wrote:
>
> > As I understand I cannot change the names of _init and _fini because
> > these are standard for libraries (or not?) and names of
> > g_psStereoDescriptor and g_psMonoDescriptor are standard for a LADSPA
> > plgin (or not?)... But what should I do? Or is is better to keep the
> > plugins in separate .so files?
>
> Just combine the two _init() functions into one, and the same
> for _fini(). Or change their names and add _init() and _fini()
> that call both. Or use static declarations of all the required
> LADSPA structs and then you don't need _init() and _fini() at all.

and if you want to be really portable, don't use _init() or _fini(),
which are officially deprecated by gcc/glibc/ld.so, and use

void
myinitfunction() __attributes__((constructor))
{

}

void
myfinifunction() __attributes__((destructor))
{
}

i may have the syntax slightly wrong for that; the gcc info page will
reveal all. this will allow your plugins to be built on OS X, where they
have gone beyond deprecating support for _init()/_fini() and actually
removed it.

note that with this design, you can have multiple initialization and
finalization functions, which is why the _init()/fini() design was
deprecated in the first place.

--p
Received on Thu Jul 7 16:18:54 2005

This archive was generated by hypermail 2.1.8 : Thu Jul 07 2005 - 16:18:54 EEST