Skip to contentSkip to conversation

notes under wine under qemu with the help of pth

Qemu-devel Rafael Ávila de Espíndola 1 participant 1 message Aug 26, 2004

lore
Share & tools
lore
#0 lore raw

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

dlls/Makedll.rules.in +1 -1
diff -ruN wine-20040813/dlls/Makedll.rules.in wine-20040813-novo/dlls/Makedll.rules.in
@@ -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
 
loader/kthread.c +1 -1
diff -ruN wine-20040813/loader/kthread.c wine-20040813-novo/loader/kthread.c
@@ -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 */