This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin.rules - Enabling shared libXt finally?


Harold L Hunt II wrote:

> Alexander,
>
> I don't understand how your example code relates to the problem at hand.

the structs x1 and x2 represent widget classes from libXt and from eg xclock.
x1 must be linked into the dll and x2 must be linked into the program.

The other problem is the function which compares the callback with _XtInherit.
_XtInherit is bound to an address in the dll, but the callback is bound
to _XtInherit in the program. Both are at different memory locations.

What we would need is a startup function which replaces pointers to the
importlib _XtInherit to the pointer of _XtInherit from the dll.

func reloc_addr[] = { .... };
unsigned reloc_addr_size = ...;
__startup_relocate(void) {
    unsigned i;
    func real_func = dlsym("cygXt.dll", "_XtInherit");
    for (i = 0; i < reloc_addr_size; i++)
        *(reloc_addr[i]) = real_func;
}

This must be added to libXt.dll.a and the linker must fill the reloc_addr
array.

>   I have created a more sophisticated example and I wish that you could
> look at it and modify it if it doesn't currently exhibit the problem
> either.  The code is attached, just 'make' it.
>
> $ ./xtest
> x1.callback: 0x4010e0
> x2.callback: 0x4010e0

Both callbacks are bound to _XtInherit from the program.

I've changed the source to match the problem from libXt. The problem is solved
if the output is
$ ./xtest
x1.callback: 0x1000xxx
x2.callback: 0x4010e0
test(x1): 1
test(x2): 1

Unfortunately it fails at test(x2).

bye
    ago
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de
 http://www.gotti.org           ICQ: 126018723

Attachment: libtest.tar.bz2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]