Hello,
I have a work-around -- I put loader/kthread.c in its own shared library and things work again:
I changed:
distcc -c -I. -I. -I../include -I../include -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -O2 -g -o kthread.o kthread.c
to:
distcc -shared -I. -I. -I../include -I../include -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -O2 -g -o libkthread.so kthread.c
and:
distcc -o wine-kthread -Wl,--section-start,.interp=0x3c000100 main.o kthread.o -L../libs/wine -lwine -L../libs/port -lwine_port
to:
distcc -o wine-kthread -Wl,--section-start,.interp=0x3c000100 main.o -L. -lkthread -L../libs/wine -lwine -L../libs/port -lwine_port
and now the pthread_create() in kthread.c gets called.
Hopefully someone who understands linker magic better than me can come up with a better fix...
Jeremy Shaw.
At Sat, 15 Nov 2003 18:44:32 -0800, Jeremy Shaw wrote:
Hello,
I did some experiments, and I believe that something did get broken in the recent changes -- specifically, libjack is now calling the real pthread functions instead of the wine emulated functions.
In cvs head, in loader/kthread.c, in pthread_create() I added a P_OUTPUT. I never see 'pthread_create' get printed.
int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start_routine)(void *), void* arg) { assert( funcs.ptr_pthread_create ); P_OUTPUT("pthread_create.\n"); return funcs.ptr_pthread_create( thread, attr, start_routine, arg ); }
In wine-20030618, in schedular/pthread.c, in pthread_create() I added a similar P_OUTPUT statement, and I did see 'pthread_create get printed.' In addition, the pthread_create() function actually returned.
I ran nm on wine-kthread, and pthread_create() is defined:
3c0014b0 T pthread_create
Any idea how I can get things working again? I assume this is some sort of linking issue, but I don't know where to go from here...
Jeremy Shaw.
At Sat, 15 Nov 2003 16:44:00 -0800, Alexandre Julliard wrote:
Jeremy Shaw jeremy.shaw@lindows.com writes:
So, if winejack.drv.so requires libjack which is linked against libpthread -- should it work with wine-kthread? And, if it does work, will libjack be calling the real pthread functions in libpthread or the emulated pthread functions in wine?
Yes it should work with wine-kthread, and it will call the emulated pthread functions. At least that's the theory, it's quite possible that with all the recent changes something got broken; but in any case using wine-pthread instead won't do what you want.
-- Alexandre Julliard julliard@winehq.com