Converting wine to pthreads
David Fraser
davidf at sjsoft.com
Mon Feb 10 04:51:27 CST 2003
Dan Kegel wrote:
> David Fraser wrote:
>
>> Dan Kegel wrote:
>>
>>> However, it's not clear to me that's required
>>> for developing winethreads-over-pthreads. People
>>> could probably get started on that with their
>>> current Linux, even though it's not 100% posix-compliant,
>>> and has odd quirks like using a special management thread, etc.
>>
>>
>>
>> Exactly. Who's going to start it?
>
>
> According to a recent post, a quick try at basing things
> on pthreads is at
> http://www.geocrawler.com/archives/3/9376/2001/12/50/7309863/
> but I guess there's more to be done. So the question
> is, who's going to be the first to get a "new pthreads"
> Linux system up and running to verify the problem and
> try out that patch?
>
> (http://kt.zork.net/wine/wn20030131_155.html#2
> has a nice summary of recent discussions, but
> searching google for wine pthreads yields a few
> interesting tidbits, too.)
> - Dan
>
Seeing as nobody talked about this for a while, I decided to take
this patch and integrate it into my CVS copy... I did and the relevant
files compile fine, with one warning
gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-Wpointer-arith -mpreferred-stack-boundary=2 -gstabs+ -fPIC
-D__WINESRC__ -D_NTSYSTEM_ -DBINDIR="\"/usr/local/bin\""
-DETCDIR="\"/usr/local/etc\"" -D_REENTRANT -o ../../scheduler/sysdeps.o
../../scheduler/sysdeps.c
../../scheduler/sysdeps.c: In function `SYSDEPS_SpawnThread':
../../scheduler/sysdeps.c:219: warning: passing arg 3 of
`pthread_create' from incompatible pointer type
Not being an autoconf wizard I had to define USE_PTHREADS manually
in the files ... how could I add a --enable-pthreads switch?
When compiled, gave me the following error linking wine in miscemu:
gcc -o wine wine.spec.o main.o -L../dlls -lntdll.dll -L../library
-lwine -L../unicode -lwine_unicode -lm
../dlls/libntdll.dll.so: undefined reference to `pthread_create'
../dlls/libntdll.dll.so: undefined reference to `pthread_attr_setstackaddr'
../dlls/libntdll.dll.so: undefined reference to `pthread_once'
../dlls/libntdll.dll.so: undefined reference to `pthread_attr_setstacksize'
../dlls/libntdll.dll.so: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[1]: *** [wine] Error 1
If I tried to add libpthread, I got:
gcc -o wine wine.spec.o main.o -L../dlls -lntdll.dll -L../library -lwine
-L../unicode -lwine_unicode -lm -lpthread
../dlls/libntdll.dll.so: the use of `pthread_attr_setstackaddr' is
deprecated, use `pthread_attr_setstack'
so I replaced that, and it got rid of the warning...
Then everything links fine, but running gives an error because of an
assert in library/port.c because the pthread
functions in scheduler/pthreads.c had been compiled out in the patch. I
compiled them back in and wine just
hangs...
Hmmmm .... not very useful to anyone but I'd thought I'd let you know.
If anyone wants I can post the patch (to wine-patches?)
David
More information about the wine-devel
mailing list