On Friday 09 August 2013 17:49:23 Jan Kundrát wrote:
> On Thursday, 8 August 2013 10:04:10 CEST, Pali Rohár wrote:
> > This means that all code which is needed by plugins must be
> > moved into shared library. So then trojita will have one
> > executable binary and one shared library. Both binaries
> > will be needed to run trojita and trojita version without
> > plugins... Do you think that this is really acceptable
> > solution?
> 
> I've mailed [1] the interest ML with a question on whether
> this is supposed to work. Some random posts on the Qt forum
> [2] suggest that a shared library is indeed required.
> 
> What would be the problems of requiring a shared library even
> for standalone Trojita? Perhaps I'm missing something here.
> 
> Cheers,
> Jan
> 
> [1]
> http://lists.qt-project.org/pipermail/interest/2013-August/00
> 8194.html [2] http://qt-project.org/forums/viewreply/61603/

I read emails and now I understand where is problem. I thought 
that it will be possible to use plugins also without shared 
library. For me it looks bad that some application needs shared 
library and only for loading plugins... I wrote some modular 
applications in C and I did not have this problem. I used linker 
-rdynamic flag on elf executable (with visibility attributes on 
exported functions) and plugins then used exported functions 
without any problems.

I tried to export shared trojita symbols from ELF executable 
binary and then plugins will use them. But due to some linker 
optimalization (dropping symbols/code from ELF exeutable which is 
not called) it not worked. It dropped constructor symbols of base 
plugin classes because these are not called from ELF exeutable.

So it looks like that only solution will be to use one shared 
library which will contains all shared plugin code...

-- 
Pali Rohár
[email protected]

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to