qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] notes under wine under qemu with the help of pth
@ 2004-08-26 13:33 Rafael Ávila de Espíndola
  0 siblings, 0 replies; only message in thread
From: Rafael Ávila de Espíndola @ 2004-08-26 13:33 UTC (permalink / raw)
  To: pth-users, qemu-devel, darwine-devel, wine-devel

[-- Attachment #1: Type: text/plain, Size: 2938 bytes --]

I was trying to run lotus notes under wine under qemu. Unfortunately qemu 
appears to have some trouble with linuxthreads. For example, consider the 
following program
test.c:
#include <pthread.h>
#include <stdio.h>

void * f(void *oie) {
 printf("tata\n");
 pthread_exit(oie);
 return NULL;
}

int main() {
 pthread_t t;
        int i;
 pthread_create(&t,NULL,f,&i);
 printf("blit\n");
 pthread_join(t, NULL);
 return 0;
}

I can compile and run it natively:
$ gcc -Wall -o test -lpthread test.c
$ ./test
tata
blit

but qemu (i386 -> i386) fails:

$ qemu-i386 ./teste
qemu: Unsupported syscall: 258
Segmentation fault

My next attempt was to use pth (www.gnu.org/software/pth):

export LD_LIBRARY_PATH=/home/rafael/inst/pth/lib
gcc -Wall -o teste -I/home/rafael/inst/pth/include/ 
-L/home/rafael/inst/pth/lib/-lpthread test.c
$ ./test
blit
tata

$ qemu-i386 ./teste
blit
tata

Success with the test program. Wine is able to run putty and notes6 when 
compiled with linuxthreads. To compile wine with pth I had to create empty 
pthreadtypes.h and sigthread.h files in the pth include dir and apply the 
attached patch in wine.

When compiled with pth wine is able to run putty (even inside qemu!). 
Unfortunately it fails to run notes6:

wine "c:\lotus\notes\nlnotes.exe"
fixme:console:SetConsoleCtrlHandler ((nil),0) - no error checking or testing 
yet
fixme:console:SetConsoleCtrlHandler (0x601aa540,1) - no error checking or 
testing yet
fixme:ole:CoRegisterMessageFilter stub
fixme:ole:CoCreateInstance no classfactory created for CLSID 
{4955dd33-b159-11d0-8fcf-00aa006bcc59}, hres is 0x80040154
wine client error:d: version mismatch 0/147.
Your wineserver binary was not upgraded correctly,
or you have an older one somewhere in your PATH.
Or maybe the wrong wineserver is still running?
wine client error:d: read: Bad file descriptor
wine client error:d: read: Bad file descriptor

There was no wineserver running when I started the program and only one was in 
the path. The log of a successful execution when linked with linuxthreads is:

fixme:console:SetConsoleCtrlHandler ((nil),0) - no error checking or testing 
yet
fixme:console:SetConsoleCtrlHandler (0x601aa540,1) - no error checking or 
testing yet
fixme:ole:CoRegisterMessageFilter stub
fixme:ole:CoCreateInstance no classfactory created for CLSID 
{4955dd33-b159-11d0-8fcf-00aa006bcc59}, hres is 0x80040154

fixme:hook:NotifyWinEvent (32782,0x10036,-4,2)-stub!
fixme:console:SetConsoleCtrlHandler ((nil),0) - no error checking or testing 
yet
fixme:console:SetConsoleCtrlHandler (0x601aa540,1) - no error checking or 
testing yet
fixme:ole:CoRegisterMessageFilter stub
fixme:console:SetConsoleCtrlHandler (0x601aa540,0) - no error checking or 
testing yet
fixme:console:SetConsoleCtrlHandler ((nil),1) - no error checking or testing 
yet

I have followed the instructions present in 
http://vowe.net/archives/004104.html to install notes.

Thanks for any help

Rafael

[-- Attachment #2: wine.patch --]
[-- Type: text/x-diff, Size: 1343 bytes --]

diff -ruN wine-20040813/dlls/Makedll.rules.in wine-20040813-novo/dlls/Makedll.rules.in
--- wine-20040813/dlls/Makedll.rules.in	2004-08-11 20:59:08.000000000 -0300
+++ wine-20040813-novo/dlls/Makedll.rules.in	2004-08-24 09:01:41.000000000 -0300
@@ -26,7 +26,7 @@
 # Rules for .so files
 
 $(MODULE).so: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) Makefile.in
-	$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(RC_SRCS:.rc=.res) $(SUBSYSTEM:%=-Wb,--subsystem,%) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(IMPORTS:%=-l%) $(ALL_LIBS)
+	$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(RC_SRCS:.rc=.res) $(SUBSYSTEM:%=-Wb,--subsystem,%) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(IMPORTS:%=-l%) $(ALL_LIBS) $(CFLAGS)
 
 # Rules for .dll files
 
diff -ruN wine-20040813/loader/kthread.c wine-20040813-novo/loader/kthread.c
--- wine-20040813/loader/kthread.c	2004-06-24 01:07:22.000000000 -0300
+++ wine-20040813-novo/loader/kthread.c	2004-08-24 09:30:32.153210544 -0300
@@ -500,7 +500,7 @@
 
 /* FIXME: no win32 equivalent for schedule param */
 int pthread_attr_setschedparam(pthread_attr_t *attr,
-    const struct sched_param *param)
+    struct sched_param *param)
 {
   P_OUTPUT("FIXME:pthread_attr_setschedparam\n");
   return 0; /* return success */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-26 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-26 13:33 [Qemu-devel] notes under wine under qemu with the help of pth Rafael Ávila de Espíndola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).