logo       

Re: Building pthread.: msg#00061

gnu.cegcc.devel

Subject: Re: Building pthread.

Hi Pedro,

I am still not able to compile any kind of pthreads with cegcc/mingw32ce.

I did some smaller modifications to the source of mingw32e and to
pthread-w32-2.8.0, and it almost compiles. But at the end I get lots of
undefined references. This is strange, since the compiler flag "-DWINCE" should
take care of this, for instance by using the errno hack you mentioned.

I commented the following lines out on mingw32Ce files:
errno.h 12,13,14,109
signal.h 12
process.h 99,102

And on pthread-w32-2.8.0:
ptw32_allUser... 44,45,194

I also changed GNUMakefile on line 66 from "-lwsock32" to "-lws2", since that
removes one undefined reference. The other libraries from mingw32ce do not seem
to solve any undefined references...

I compile with:

make CROSS=arm-wince-mingw32ce- CC="arm-wince-mingw32ce-g++ -DWINCE" clean GC

The output is at the end of this mail.

PS1: I did not find any information on someone compiling pthreads with
cegcc/mingw32ce. Do you have some more information? I am not a very experienced
programmer, so I guess it would be hard for me to port jamvm to native win32
threads...

PS2: There are other kinds of Java for WinCe, but they all have different
limitations. See
http://www.rainer-keuchel.de/wince/kaffe.html
http://www2s.biglobe.ne.jp/~dat/java/project/jvm/index_en.html

Kind Regards,
Leonardo.

rm -f *~
rm -f *.i
rm -f *.o
rm -f *.obj
rm -f *.exe
rm -f pthread.def
make CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="attr.o barrier.o cancel.o
cleanup.o condvar.o create.o dll.o errno.o exit.o fork.o global.o misc.o
mutex.o nonportable.o private.o rwlock.o sched.o semaphore.o signal.o spin.o
sync.o tsd.o version.o" pthreadGC2.dll
make[1]: Entering directory
`/cec/storage/dqkal002/homes/d046460/CeGCC/pthreads-w32-2-8-0-release'
arm-wince-mingw32ce-g++ -DWINCE -c -o attr.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall attr.c
arm-wince-mingw32ce-g++ -DWINCE -c -o barrier.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall barrier.c
pthread_barrier_wait.c: In function 'int
pthread_barrier_wait(pthread_barrier_t_**)':
pthread_barrier_wait.c:56: warning: dereferencing type-punned pointer will
break strict-aliasing rules
pthread_barrier_wait.c:90: warning: dereferencing type-punned pointer will
break strict-aliasing rules
arm-wince-mingw32ce-g++ -DWINCE -c -o cancel.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall cancel.c
arm-wince-mingw32ce-g++ -DWINCE -c -o cleanup.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall cleanup.c
arm-wince-mingw32ce-g++ -DWINCE -c -o condvar.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall condvar.c
arm-wince-mingw32ce-g++ -DWINCE -c -o create.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall create.c
arm-wince-mingw32ce-g++ -DWINCE -c -o dll.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall dll.c
arm-wince-mingw32ce-g++ -DWINCE -c -o errno.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall errno.c
arm-wince-mingw32ce-g++ -DWINCE -c -o exit.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall exit.c
arm-wince-mingw32ce-g++ -DWINCE -c -o fork.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall fork.c
arm-wince-mingw32ce-g++ -DWINCE -c -o global.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall global.c
arm-wince-mingw32ce-g++ -DWINCE -c -o misc.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall misc.c
pthread_once.c: In function 'int pthread_once(pthread_once_t*, void (*)())':
pthread_once.c:57: warning: dereferencing type-punned pointer will break
strict-aliasing rules
pthread_once.c:61: warning: dereferencing type-punned pointer will break
strict-aliasing rules
pthread_self.c: In function 'pthread_t pthread_self()':
pthread_self.c:63: warning: unused variable 'nil'
arm-wince-mingw32ce-g++ -DWINCE -c -o mutex.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall mutex.c
arm-wince-mingw32ce-g++ -DWINCE -c -o nonportable.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall nonportable.c
pthread_win32_attach_detach_np.c: In function 'BOOL
pthread_win32_process_attach_np()':
pthread_win32_attach_detach_np.c:54: warning: unused variable 'vProcessCPUs'
pthread_win32_attach_detach_np.c:55: warning: unused variable 'vSystemCPUs'
arm-wince-mingw32ce-g++ -DWINCE -c -o private.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall private.c
In file included from private.c:54:
ptw32_timespec.c:62: warning: this decimal constant is unsigned only in ISO C90
ptw32_timespec.c:77: warning: this decimal constant is unsigned only in ISO C90
ptw32_timespec.c:79: warning: this decimal constant is unsigned only in ISO C90
ptw32_MCS_lock.c: In function 'void
ptw32_mcs_lock_release(ptw32_mcs_local_node_t*)':
ptw32_MCS_lock.c:187: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ptw32_MCS_lock.c:205: warning: dereferencing type-punned pointer will break
strict-aliasing rules
ptw32_getprocessors.c: In function 'int ptw32_getprocessors(int*)':
ptw32_getprocessors.c:58: warning: unused variable 'vProcessCPUs'
ptw32_getprocessors.c:59: warning: unused variable 'vSystemCPUs'
arm-wince-mingw32ce-g++ -DWINCE -c -o rwlock.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall rwlock.c
arm-wince-mingw32ce-g++ -DWINCE -c -o sched.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall sched.c
arm-wince-mingw32ce-g++ -DWINCE -c -o semaphore.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall semaphore.c
arm-wince-mingw32ce-g++ -DWINCE -c -o signal.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall signal.c
arm-wince-mingw32ce-g++ -DWINCE -c -o spin.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall spin.c
arm-wince-mingw32ce-g++ -DWINCE -c -o sync.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall sync.c
arm-wince-mingw32ce-g++ -DWINCE -c -o tsd.o -D__CLEANUP_C -O3
-finline-functions -I. -DHAVE_CONFIG_H -Wall tsd.c
arm-wince-mingw32ce-windres --include-dir=. -D__CLEANUP_C -o version.o
version.rc
arm-wince-mingw32ce-g++ -DWINCE -D__CLEANUP_C -O3 -finline-functions -shared -o
pthreadGC2.dll attr.o barrier.o cancel.o cleanup.o condvar.o create.o dll.o
errno.o exit.o fork.o global.o misc.o mutex.o nonportable.o private.o rwlock.o
sched.o semaphore.o signal.o spin.o sync.o tsd.o version.o
condvar.o:condvar.c:(.text+0x184): undefined reference to `errno'
condvar.o:condvar.c:(.text+0x25c): undefined reference to `errno'
condvar.o:condvar.c:(.text+0x400): undefined reference to `errno'
condvar.o:condvar.c:(.text+0x5a0): undefined reference to `errno'
condvar.o:condvar.c:(.text+0x6f0): undefined reference to `errno'
condvar.o:condvar.c:(.text+0x848): more undefined references to `errno' follow
create.o:create.c:(.text+0x108): undefined reference to `_beginthread'
exit.o:exit.c:(.text+0x2c): undefined reference to `_endthread'
misc.o:misc.c:(.text+0x224): undefined reference to `ptw32_mcs_lock_acquire'
misc.o:misc.c:(.text+0x244): undefined reference to `ptw32_mcs_lock_release'
misc.o:misc.c:(.text+0x274): undefined reference to `ptw32_mcs_lock_release'
mutex.o:mutex.c:(.text+0x3c8): undefined reference to `ptw32_relmillisecs'
mutex.o:mutex.c:(.text+0x550): undefined reference to `ptw32_relmillisecs'
private.o:private.c:(.text+0xe4): undefined reference to `errno'
private.o:private.c:(.text+0x2b8): undefined reference to `_endthread'
private.o:private.c:(.text+0x4d4): undefined reference to `_endthread'
sched.o:sched.c:(.text+0x1c): undefined reference to `errno'
sched.o:sched.c:(.text+0x3c): undefined reference to `errno'
sched.o:sched.c:(.text+0xb4): undefined reference to `errno'
sched.o:sched.c:(.text+0x130): undefined reference to `errno'
semaphore.o:semaphore.c:(.text+0x14): undefined reference to `errno'
semaphore.o:semaphore.c:(.text+0x2c): more undefined references to `errno'
follow
semaphore.o:semaphore.c:(.text+0x32c): undefined reference to
`ptw32_relmillisecs'
semaphore.o:semaphore.c:(.text+0x3ec): undefined reference to `errno'
semaphore.o:semaphore.c:(.text+0x550): undefined reference to `errno'
semaphore.o:semaphore.c:(.text+0x61c): undefined reference to `errno'
semaphore.o:semaphore.c:(.text+0x6d4): undefined reference to `errno'
tsd.o:tsd.c:(.text+0x18): undefined reference to `WSAGetLastError'
tsd.o:tsd.c:(.text+0x38): undefined reference to `WSASetLastError'
collect2: ld returned 1 exit status
make[1]: *** [pthreadGC2.dll] Error 1
make[1]: Leaving directory
`/cec/storage/dqkal002/homes/d046460/CeGCC/pthreads-w32-2-8-0-release'
make: *** [GC] Error 2

----- Ursprüngliche Mail ----
Von: Pedro Alves <pedro_alves-BwYwT0D5Mwdz4s462UR3lw@xxxxxxxxxxxxxxxx>
An: Leonardo Weiss Chaves <humaita-/E1597aS9LQAvxtiuMwx3w@xxxxxxxxxxxxxxxx>
CC: cegcc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
Gesendet: Dienstag, den 10. Juli 2007, 23:22:15 Uhr
Betreff: Re: [Cegcc-devel] Building pthread.


Hi Leonardo,

sorry for the delay,

Leonardo Weiss Chaves wrote:
> Hi,
>
> I am trying to build jamvm (http://jamvm.sourceforge.net/) with
> cegcc/mingw32ce, since jamvm can also be build with cygwin
> (http://developer.classpath.org/mediation/ClasspathOnCygwin).
>

Cool stuff. I wish I knew about this a year ago, when I was stuck with
Jeode and Thinlet in a project at my last job.

> I am able to build classpath, but when I run the configure script from jamvm
> I get
>
> checking for pthread_self in -lpthread... no
> configure: error: libpthread is missing
>
> with both ceggc and mingw32ce.
>
> So I downloaded pthread 2.0.7 from http://www.gnu.org/software/pth/ and tried
> building it, but the configure script always fails with both cegcc and
> mingw32ce. I also wanted to try pthreads-win32
> (http://sources.redhat.com/pthreads-win32/), but it has no configure script,
> so I was not able to build it.
>
> Has anyone managed to build pthreads with cegcc or with mingw32ce? Or can
> anyone help me build it ;-)
>

Any luck on this yet? AFAIR, some did get pthread built with cegcc, back
in the berlios days.

I though that there was already a port of pthreads-win32 for WinCE at
pthreads-win32 upstream. I've seen the patch for it in the past
somewhere, and I remember that it wasn't that clean (defined an int
errno as a workaround, for example), but it was reported to work
by its author.

OTOH, how hard would it be to add native win32 threads support to jamwm?

Cheers,
Pedro Alves






___________________________________________________________
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail:
http://mail.yahoo.de

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise