Extending KPluginFactory to support exporting symbols

Chris Burel chrisburel at gmail.com
Sun Dec 5 00:19:51 GMT 2010


Hey guys,
I'm working on Perl bindings to Plasma.  For this, I've created a
subclass of KPluginFactory that links to libperl and loads the Perl
KDE bindings.  But I'm running into trouble when the Perl code needs
to load in more Perl extensions dynamically (perl modules that are
written and compiled using Perl's C API).  kperlpluginfactory does
link to libperl, but because Plasma doesn't export the symbols of the
loaded plugin (aka, the load hint QLibrary::ExportExternalSymbolsHint
is not set when the plugin is loaded), symbols from the dynamically
loaded Perl modules don't get resolved.  So I get something like this:

> plasmoidviewer perl-hello-plasmoid
Can't load '/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Devel/Peek/Peek.so'
for module Devel::Peek:
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Devel/Peek/Peek.so:
undefined symbol: Perl_runops_standard at
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/XSLoader.pm line 64.
 at /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/Devel/Peek.pm line 19

If I use LD_PRELOAD to load libperl.so, everything works correctly,
but that's not really a solution.

What I'd like to do is modify KPluginFactory to have the option of
specifying load hints in the constructor, and then have plasma check
for a key in the .desktop file used to load the plugin to determine if
the symbols from the plugin should be exported.

Or maybe there's some other/better way for me to make sure that
loading kperlpluginfactory will export the necessary symbols from
libperl.so?

-Chris




More information about the kde-core-devel mailing list