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?


Alexander Gottwald wrote:

On Wed, 1 Oct 2003, Harold L Hunt II wrote:


Alexander Gottwald wrote:

Have you tested this with programs which uses libXt and some widgets from
another library?

Yeah, that is what I was saying above. I built a shared version, made some changes, and rebuilt some clients (xman.exe, xcalc.exe, etc.), but they keep giving the unresolved inheritence error as above.


The location of _XtInherit still differs in dll and program.


Actually, if you look at xc/config/cf/ibmLib.rules/SharedLibraryTarget(), you see that sharedlib.o (which is contained in $(UNSHAREDOBJS)) is linked directly into the import library, not into the shared library. The idea is that each application linked against libXt should end up with one copy of the sharedlib.o code. Thus, comparisons against _XtInherit will work just fine within one application, which is the only case that we are concerned with.


no. The structures of the dll are initialized with dll_base + x and the structures from the program are inititalized with program_base + y. Even
if we find a way to have x == y, the symbols still differ because the dll is placed on a different place than the program.


Simple testprogram:

--x.h
typedef void (*func)(void);
extern void _XtInherit(void);
typedef struct { func callback; } x;
extern x x1, x2;
--xtinherit.c
#include "x.h"
void _XtInherit(void) {
}
--x1.c
#include "x.h"
x x1 = { _XtInherit };
--x2.c
#include "x.h"
x x2 = { _XtInherit };
--xtest.c
#include "x.h"
#include <stdio.h>

int main(void) {
    printf("x1.callback: %p\n", x1.callback);
    printf("x2.callback: %p\n", x2.callback);
    return 0;
}
--build.sh
gcc -shared -o x1.dll x1.c xtinherit.c
^^^^^^ ^^^^^^^^^^^

That is the crux of my whole argument, and I believe it is what Alan was trying to tell me to do. You do *not* link xtinherit.c/o into x1.dll. Instead, only for demonstration purposes, you can link it directly into any executables that link to x1.dll.

What is your response to that?

Harold



gcc -o xtest.exe xtest.c x2.c xtinherit.c x1.dll
gcc -o xtest2.exe xtest.c x2.c x1.dll
--output xtest.exe
x1.callback: 0x10001010 x2.callback: 0x4010d0
--output xtest2.exe
x1.callback: 0x10001010
x2.callback: 0x401750


bye
	ago


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