public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Trying to get pthread-win32 compiling for WinCE
@ 2006-12-28 21:04 Philip Van Hoof
  2006-12-28 21:40 ` Marcel Ruff
  0 siblings, 1 reply; 4+ messages in thread
From: Philip Van Hoof @ 2006-12-28 21:04 UTC (permalink / raw)
  To: pthreads-win32

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

Hi there,

I'm trying to compile pthread-win32 with eMbedded Visual C++ 4.0's
compiler (cl.exe) and nmake.exe with include files of the Pocket PC 2003
SDK.

I tried various things and got stuck at this problem:

(note that I am not compiling with cygwin, it's just the location where
I checked the sources out)

C:\cygwin\home\Philip Van Hoof\pthreads>PATH
PATH=C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\Bin;C:\Program Files
\Microsoft eMbedded C++ 4.0\EVC\wce400\bin;C:\cygwin\bin

C:\cygwin\home\Philip Van Hoof\pthreads>

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        if exist *.obj del *.obj
        if exist *.ilk del *.ilk
        if exist *.pdb del *.pdb
        if exist *.exp del *.exp
        if exist *.map del *.map
        if exist *.o del *.o
        if exist *.i del *.i
        if exist *.res del *.res
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
attr.c
attr.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
barrier.c
barrier.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
cancel.c
cancel.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
cleanup.c
cleanup.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
condvar.c
condvar.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
create.c
create.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
dll.c
dll.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
errno.c
errno.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
exit.c
exit.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
fork.c
fork.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
global.c
global.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
misc.c
misc.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
mutex.c
mutex.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
nonportable.c
nonportable.c
        cl /O2 /Ob2 /GX /TP /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_
CONFIG_H /DWINCE -IC:\Include\Emulator /Zi /D DEBUG /D _i386_ /D UNDER_CE= /D i_
386_ /D UNICODE /D _UNICODE /D _X86_ /D x86 /c /D NEED_FTIME /D__CLEANUP_CXX -c
private.c
private.c
ptw32_threadStart.c(108) : error C2146: syntax error : missing ';' before identi
fier 'terminate_function'
ptw32_threadStart.c(108) : fatal error C1004: unexpected end of file found
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft eMbedded C++ 4.0\Common\
EVC\Bin\NMAKE.EXE"' : return code '0x2'
Stop.

C:\cygwin\home\Philip Van Hoof\pthreads>

I also had to make various little fixes (like some casting and setting
Makefile includes right) of which I for the ease of explaining what I
did simply made a diff (which is attached).


Note that I removed the eh.h include from the ptw32_threadStart.c file
because it doesn't exist in the include directory. That's probably not
the right way to fix it ;-) (I know).



Does somebody have pointers? How did others get the WinCE port compiled?



-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog




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

? process.h
? signal.h
? vc60.pdb
Index: Makefile
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/Makefile,v
retrieving revision 1.41
diff -u -r1.41 Makefile
--- Makefile	3 Jun 2005 08:36:27 -0000	1.41
+++ Makefile	28 Dec 2006 20:52:36 -0000
@@ -27,7 +27,10 @@
 OPTIM	= /O2 /Ob2
 OPTIMD	=
 
-CFLAGS	= /W3 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
+CFLAGS	= /W0 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H /DWINCE -IC:\Include\Emulator 
+
+CFLAGS = $(CFLAGS) /Zi /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /c /D NEED_FTIME
+
 CFLAGSD	= /Zi $(CFLAGS)
 
 
Index: dll.c
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/dll.c,v
retrieving revision 1.29
diff -u -r1.29 dll.c
--- dll.c	1 Apr 2005 00:55:21 -0000	1.29
+++ dll.c	28 Dec 2006 20:52:36 -0000
@@ -38,7 +38,8 @@
 
 #include "pthread.h"
 #include "implement.h"
-
+
+#if 0
 #ifdef _MSC_VER
 /* 
  * lpvReserved yields an unreferenced formal parameter;
@@ -90,3 +91,4 @@
 }				/* DllMain */
 
 #endif /* PTW32_STATIC_LIB */
+#endif
Index: implement.h
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/implement.h,v
retrieving revision 1.117
diff -u -r1.117 implement.h
--- implement.h	3 Jun 2005 08:36:27 -0000	1.117
+++ implement.h	28 Dec 2006 20:52:37 -0000
@@ -695,12 +695,12 @@
                        arg, \
                        flags, \
                        pid) \
-        CreateThread(security, \
+        CreateThread((struct _SECURITY_ATTRIBUTES *) security, \
                      stack_size, \
                      (LPTHREAD_START_ROUTINE) start_proc, \
                      arg, \
                      flags, \
-                     pid)
+                     (unsigned long *) pid)
 
 #define _endthreadex ExitThread
 
Index: need_errno.h
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/need_errno.h,v
retrieving revision 1.3
diff -u -r1.3 need_errno.h
--- need_errno.h	14 Aug 2000 03:43:09 -0000	1.3
+++ need_errno.h	28 Dec 2006 20:52:37 -0000
@@ -62,12 +62,12 @@
 
 /* declare reference to errno */
 
-#if     (defined(_MT) || defined(_MD) || defined(_DLL)) && !defined(_MAC)
-_CRTIMP extern int * __cdecl _errno(void);
-#define errno   (*_errno())
-#else   /* ndef _MT && ndef _MD && ndef _DLL */
+//#if     (defined(_MT) || defined(_MD) || defined(_DLL)) && !defined(_MAC)
+//_CRTIMP extern int * __cdecl _errno(void);
+//#define errno   (*_errno())
+//#else   /* ndef _MT && ndef _MD && ndef _DLL */
 _CRTIMP extern int errno;
-#endif  /* _MT || _MD || _DLL */
+//#endif  /* _MT || _MD || _DLL */
 
 /* Error Codes */
 
Index: ptw32_threadStart.c
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/ptw32_threadStart.c,v
retrieving revision 1.10
diff -u -r1.10 ptw32_threadStart.c
--- ptw32_threadStart.c	15 May 2005 15:28:27 -0000	1.10
+++ ptw32_threadStart.c	28 Dec 2006 20:52:40 -0000
@@ -79,11 +79,13 @@
 }
 
 #elif defined(__CLEANUP_CXX)
+
 
 #if defined(_MSC_VER)
-# include <eh.h>
+//# include <eh.h>
+#include <stdio.h>
 #elif defined(__WATCOMC__)
-# include <eh.h>
+//# include <eh.h>
 # include <exceptio.h>
 typedef terminate_handler
   terminate_function;
@@ -102,6 +104,8 @@
 typedef terminate_handler
   terminate_function;
 #endif
+
+typedef terminate_handler terminate_function;
 
 static terminate_function
   ptw32_oldTerminate;
@@ -109,9 +113,9 @@
 void
 ptw32_terminate ()
 {
-  set_terminate (ptw32_oldTerminate);
+ // set_terminate (ptw32_oldTerminate);
   (void) pthread_win32_thread_detach_np ();
-  terminate ();
+  //terminate ();
 }
 
 #endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to get pthread-win32 compiling for WinCE
  2006-12-28 21:04 Trying to get pthread-win32 compiling for WinCE Philip Van Hoof
@ 2006-12-28 21:40 ` Marcel Ruff
  2006-12-28 21:47   ` Philip Van Hoof
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Ruff @ 2006-12-28 21:40 UTC (permalink / raw)
  To: Philip Van Hoof, pthreads-win32

Hi Philip,

i have compiled the patched pthreads successfully for Windows CE with 
ARM processor.

Download the patch for Windows CE from
   http://www.xmlBlaster.org/wince/pthreads-2006-11-29.patch
and apply it on pthreads 2.7.0 or better the cvs checkout from 2006-11-29.

I'm not sure if the patch was integrated to the current release 2.8.0
as i didn't get any feedback.

Compile pthread.c, pthread.h and config.h with the compiler defines 
/DWINCE and /D_ARM_.
(all other files are automatically added by pthread.c)

My compiler was from VC++ 2005,

regards
Marcel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to get pthread-win32 compiling for WinCE
  2006-12-28 21:40 ` Marcel Ruff
@ 2006-12-28 21:47   ` Philip Van Hoof
  2006-12-28 22:02     ` Philip Van Hoof
  0 siblings, 1 reply; 4+ messages in thread
From: Philip Van Hoof @ 2006-12-28 21:47 UTC (permalink / raw)
  To: Marcel Ruff; +Cc: pthreads-win32

On Thu, 2006-12-28 at 22:41 +0100, Marcel Ruff wrote:
> Hi Philip,
> 
> i have compiled the patched pthreads successfully for Windows CE with 
> ARM processor.
> 
> Download the patch for Windows CE from
>    http://www.xmlBlaster.org/wince/pthreads-2006-11-29.patch
> and apply it on pthreads 2.7.0 or better the cvs checkout from 2006-11-29.

Oh, cool and thanks.

I will of course check it out.

Note. So far I succeeded pretty far in getting the cvs HEAD compiled
(with x86 as target, however). Some minor discrepanties about errno.h
and stuff like that .. and winver.h not existing (check my new post).

> I'm not sure if the patch was integrated to the current release 2.8.0
> as i didn't get any feedback.

Oh ok. Well, to the maintainers of pthread-win32: it would be very
interesting to have default wince support! ;)

ps. My plan is to after this try to get glib (from the GNOME stack)
working. And after that, who knows, the win32 gtk+ port of Tor. Guessing
iconv and pthread will be the two most difficult dependencies.

> Compile pthread.c, pthread.h and config.h with the compiler defines 
> /DWINCE and /D_ARM_.
> (all other files are automatically added by pthread.c)

Ok, I'll try that.

> My compiler was from VC++ 2005,


thanks

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Trying to get pthread-win32 compiling for WinCE
  2006-12-28 21:47   ` Philip Van Hoof
@ 2006-12-28 22:02     ` Philip Van Hoof
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Van Hoof @ 2006-12-28 22:02 UTC (permalink / raw)
  To: Marcel Ruff; +Cc: pthreads-win32

On Thu, 2006-12-28 at 22:47 +0100, Philip Van Hoof wrote:

> > i have compiled the patched pthreads successfully for Windows CE with 
> > ARM processor.
> > 
> > Download the patch for Windows CE from
> >    http://www.xmlBlaster.org/wince/pthreads-2006-11-29.patch
> > and apply it on pthreads 2.7.0 or better the cvs checkout from 2006-11-29.
> 
> Oh, cool and thanks.
> 
> I will of course check it out.

Right, the patch basically fixes the same problems that I encountered,
but then in a clean (ifdef-else-endif) way :-)

With the patch, I still get this problem:

C:\cygwin\home\Philip Van Hoof\pthreads>nmake VC

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        rc /dPTW32_RC_MSC /d__CLEANUP_C version.rc
version.rc(33) : fatal error RC1015: cannot open include file 'winver.h'.
NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft eMbedded C++ 4.0\Common
EVC\Bin\NMAKE.EXE"' : return code '0x2'
Stop.

C:\cygwin\home\Philip Van Hoof\pthreads>


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-28 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-28 21:04 Trying to get pthread-win32 compiling for WinCE Philip Van Hoof
2006-12-28 21:40 ` Marcel Ruff
2006-12-28 21:47   ` Philip Van Hoof
2006-12-28 22:02     ` Philip Van Hoof

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 read-only IMAP folder(s) and NNTP newsgroup(s).