Re: Problem with gkrellfire plugin

Dale Smith <[email protected]> Thu, 11 Apr 2019 16:55:12 -0400
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <CAFGZJC77xy+On7Rad7oDD9NY7kO6dz1xXryU_ser9K1PRpNi6w@mail.gmail.com>
Well, it probably won't fix things, but there *is* a difference in
those two linker calls that might be important.

The "-Wl,--as-needed" flag is for the following libs.  Looks like that
is coming *after* the gtk libs on gkrellm-volume but *before* the gtk
libs on gkrellfire.

-Dale


On 4/11/19, Jack Ostroff <[email protected]> wrote:
> On 2019.04.11 13:20, Jack wrote:
>> On 2019.04.11 04:37, Peter Humphrey wrote:
>>> On Wednesday, 10 April 2019 23:58:26 BST you wrote:
>>>> A gkrellm_init_plugin() function is supposed to be in each plugin
>>>> so something is wrong with the gkrellfire plugin.  Maybe it is
>>>> corrupted or the plugin has had symbols stripped.
>
> [snip....]
>
> Something is definitely strange.  If I unpack the source, and do "grep
> init gkrellfire.c" I get
>
> // All GKrellM plugins must have one global routine named init_plugin()
> __declspec(dllexport) GkrellmMonitor
> *gkrellm_init_plugin(win32_plugin_callbacks* calls)
> GkrellmMonitor *gkrellm_init_plugin()
>
> so the call is present.  Compiling is only two commands.  After the
> first, "x86_64-pc-linux-gnu-gcc -O2 -pipe -fPIC `pkg-config gtk+-2.0
> --cflags`   -c -o gkrellfire.o gkrellfire.c" if I do "objdump -t
> gkrellfire.o I  grep init" I get
>
> 00000000000018b0 g     F .text  0000000000000089 gkrellm_init_plugin
>
> so the function is compiled into the .o file.  The second command is
> "x86_64-pc-linux-gnu-gcc -O2 -pipe -fPIC `pkg-config gtk+-2.0
> --cflags`  -o gkrellfire.so -Wl,-O1 -Wl,--as-needed -shared `pkg-config
> gtk+-2.0 --libs`" after which "objdump -t gkrellfire.so | grep init"
> gives
>
> 0000000000001000 l    d  .init  0000000000000000              .init
> 0000000000003e30 l    d  .init_array    0000000000000000
> .init_array
> 0000000000003e30 l     O .init_array    0000000000000000
> __frame_dummy_init_array_entry
> 0000000000001000 l     F .init  0000000000000000              _init
>
> It makes no sense to me.
>
> If I do the same with gkrellm-volume, both volume.o and volume.so
> contain gkrellm_init_plugin.   The compiles seems pretty similar:
>
> x86_64-pc-linux-gnu-gcc -O2 -pipe -DPACKAGE="\"gkrellm-volume\""  -fPIC
> `pkg-config gtk+-2.0 --cflags`  -I/usr/local/include -DALSA   -c -o
> volume.o volume.c
>    (same for mixer.c, oss_mixer.c, and alsa_mixer.c)
> x86_64-pc-linux-gnu-gcc volume.o mixer.o oss_mixer.o alsa_mixer.o  -o
> volume.so `pkg-config gtk+-2.0 --libs` -lasound -shared -Wl,-O1
> -Wl,--as-needed
>
> Anything else I can check or try?
>
> Jack
>