On Tuesday 13 August 2013 12:39:58 Jan Kundrát wrote:
> On Tuesday, 13 August 2013 08:26:51 CEST, Pali Rohár wrote:
> > Yes, I want to support also this configuration. But not only
> > this.
> 
> What are the benefits of this? "There will be no shared
> library" is not a benefit, that's a statement of fact. I want
> to know *why* it is important to you to work without any
> shared library.
> 
> Some reasons on why I believe that it is not worth the effort:
> 
> - it requires extra code -> increased future maintenance

No, it does not required extra source code. Only some options and 
configurations in cmakelists.txt.

> - it works only on GCC

Now yes. I do no have other compilers for testing. But is this 
problem? This is optional option in cmake. Also if you compile 
some plugins statically into trojita executable special linker 
flag is not needed.

> - the linker flags one needs could be considered hackish
> - it goes against the general plugin recommendations
> - Trojita already links against a myriad of shared libraries

$ readelf -d /usr/bin/trojita | grep NEEDED | wc -l
11

Only Qt libraries, standard C and C++ libraries, zlib and 
pthread. Except Qts all other are present on every linux system.

> - the solution requires code duplication in both
> Trojita-the-binary and each .so plugin (speaking about the
> code segment in the resulting ELF), thereby wasting memory,
> as per what Thiago said
> - one would be, effectively, linking the plugin against the
> /usr/bin/trojita, if I understand Thiago correctly
> 

No. You do not understand it correctly. My solution is another, 
not that provided by Thiago.

Thiago wrote to link common static library into trojita 
executable and each plugin. And hope that dynamic linker will 
resolve duplicate code somehow.

In my solution, I including common static library only to trojita 
executable, not to plugins. So memory usage is same as with one 
shared common library. In my opinion this can reduce memory 
usage, compiler/linker can maybe optimize this common code in 
trojita executable and system do not need to load one library. 
But I think this is irrelevant.

> What I'm interested to know is a similar list of benefits --
> could you please provide one?
> 
> > No. Runtime loading should work too (at least with GCC). For
> > GNU compiler/linker is needed special flag, but this is
> > added by cmake when using GNU. Also if some password and
> > some addressbook plugins will be statically linked into
> > trojita executable, it will not be needed anymore.
> 
> OK, I stand corrected and am not including "it will disable
> runtime plugin loading" in the list of drawbacks.
> 
> Jan

-- 
Pali Rohár
pali.ro...@gmail.com

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

Reply via email to