Xfce 4.4BETA1 - core packages
Brian J. Tarricone
bjt23 at cornell.edu
Mon Mar 27 15:27:09 CEST 2006
Benedikt Meurer wrote:
> Brian J. Tarricone wrote:
>>> You cannot unload thunar-vfs/thunarx/libexo, as they register static
>>> GTypes. I was solely talking about loading, and I doubt that this
>>>
>>> xfdesktop -> thunar-vfs -> libexo
>>> xfdesktop -> thunarx -> extension.so[LOCAL] [-> thunar-vfs -> libexo]
>>>
>>> is going to work w/o trouble with the various dlopen()/shl_load()
>>> implementations on the supported platforms. You'll need to be very
>>> careful to even make it work with glibc, not to mention the more exotic
>>> platforms.
>> Well, the real problem comes into play if your "extension.so" above
>> pulls in a different version of something already loaded. ELF is broken
>> that way. Otherwise... I agree, it's messy.
>
> I don't necessarily worry about ELF platforms (atleast the sane ones).
> I'm more worried that this hack will not work at all on non-ELF
> platforms, for example Cygwin comes to mind here, which uses PECOFF, or
> Darwin/Mach-O, or "older" COFF/a.out based systems (for which shared
> libraries are implemented as a hack, etc.). I'll try to support those
> platforms as far as loading thunarx plugins goes, but I can impossibly
> support thunarx/thunar-vfs/libexo itself as loadable plugins. You'll be
> on your own there.
>
>>>> I looked at relaytool, and it appears to do what I want, though it'll
>>>> only work on x86. Not sure if it's worth the effort. Since all the
>>>> thunar-vfs stuff is in only a couple files that won't get used at all if
>>>> thunar-vfs isn't available, I might just write my own wrapper that uses
>>>> GModule instead, so it should support all platforms. Again, not sure if
>>>> it's worth the effort.
>>> GModule just uses dlopen()/shl_load().
>> Of course. I was merely pointing out that relaytool only supports x86,
>> and from looking through it, only dlopen(), so using GModule would allow
>> it to work on any platform that glib supports, and hence any platform
>> Xfce supports.
>
> What I meant is: Don't rely on consistent behavior of dlopen() across
> platforms. GModule is just a very slim wrapper, and it doesn't abstract
> the problem of the scenario described above. Even though it provides a
> consistent API on different platforms, the semantics of such special
> cases may (and will) still differ among the various platforms.
So basically you're saying that dlopen() (and friends) are basically
useless for anything but incredibly simple plugin systems that do
basically nothing but incredibly trivial things. What a waste.
-brian
More information about the Xfce4-dev
mailing list