Re: If somebody is interested in porting stuff to cool targets



This is pthread-win32 compiled with this WinCE compiler (CeGCC's
mingw32ce) after I commented out the two or three compilation errors:

Looks like _errno, _ftime and _endthread are the only unresolved
symbols. 

The errors that I had to fix where two errors in pthread_cancel.c which
advertises to be architecture dependent and replacing -lwsock32 with
-lwinsock in the file GNUmakefile.

pthread.o:pthread.c:(.text+0x388): undefined reference to
`WSAGetLastError'
pthread.o:pthread.c:(.text+0x3a8): undefined reference to
`WSASetLastError'
pthread.o:pthread.c:(.text+0x7cc): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x7e4): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x7fc): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x820): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x844): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x898): more undefined references to `_errno'
follow
pthread.o:pthread.c:(.text+0x958): undefined reference to
`GetProcessAffinityMask'
pthread.o:pthread.c:(.text+0xca8): undefined reference to `_ftime'
pthread.o:pthread.c:(.text+0x10e8): undefined reference to
`GetProcessAffinityMask'
pthread.o:pthread.c:(.text+0x123c): undefined reference to
`GetProcessAffinityMask'
pthread.o:pthread.c:(.text+0x1fb0): undefined reference to `_endthread'
pthread.o:pthread.c:(.text+0x1fe8): undefined reference to `_endthread'
pthread.o:pthread.c:(.text+0x2100): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x214c): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x21fc): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x22ac): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x2410): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x2428): more undefined references to
`_errno' follow
pthread.o:pthread.c:(.text+0x2cb0): undefined reference to `_endthread'
pthread.o:pthread.c:(.text+0x2e48): undefined reference to `_ftime'
pthread.o:pthread.c:(.text+0x2ec0): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x2f30): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x2ff8): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3000): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3020): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x30dc): more undefined references to
`_errno' follow
pthread.o:pthread.c:(.text+0x3a24): undefined reference to
`GetProcessAffinityMask'
pthread.o:pthread.c:(.text+0x3c98): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3d90): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3da0): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3e5c): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x3ea0): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x4030): more undefined references to
`_errno' follow
pthread.o:pthread.c:(.text+0x4d58): undefined reference to
`_beginthread'
pthread.o:pthread.c:(.text+0x4ea8): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x4f88): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x4fa4): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x4fb0): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x5464): undefined reference to `_ftime'
pthread.o:pthread.c:(.text+0x5644): undefined reference to `_ftime'
pthread.o:pthread.c:(.text+0x5a74): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x5a7c): undefined reference to `_errno'
pthread.o:pthread.c:(.text+0x5aa8): undefined reference to `_errno'
collect2: ld returned 1 exit status
make[1]: *** [pthreadGC2.stamp] Error 1
make: *** [GC-inlined] Error 2



On Tue, 2007-09-18 at 01:53 +0200, Philip Van Hoof wrote:
> On Tue, 2007-09-18 at 01:09 +0200, Philip Van Hoof wrote:
> > For WinCE I think the steps would go like this:
> > o. Download and install http://cegcc.sourceforge.net/ (alien on the RPM
> >    works fine on Ubuntu)
> 
> I think you can simply use --host=arm-wince-mingw32ce with the
> cegcc-mingw32ce-0.50-1.i586.rpm package the the configure line.
> 
> > o. Port libiconv and get it compiled
> 
> Seems to be a simple compile job. The CeGCC page talks about Unicode on
> WinCE, so perhaps read that part too?
> 
> export CC=/opt/mingw32ce/bin/arm-wince-mingw32ce-gcc
> ./configure --host=arm-wince-mingw32ce --prefix=/opt/glib-wince
> 
> Gives me something like this.
> 
> /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/errno.h:12:25: error: no include path in which to search for errno.h
> In file included from ./loops.h:23,
>                  from ./iconv.c:130:
> ./loop_unicode.h: In function 'unicode_loop_convert':
> ./loop_unicode.h:191: error: 'errno' undeclared (first use in this function)
> ./loop_unicode.h:191: error: (Each undeclared identifier is reported only once
> ./loop_unicode.h:191: error: for each function it appears in.)
> ./loop_unicode.h:191: error: 'ENOENT' undeclared (first use in this function)
> 
> Note that errno.h does not exist on WinCE so this is indeed a piece that
> you'll need to port. I guess including Mingw32's errno.h should work?
> (errno is not how to do errors on WinCE but it should just work this
> way, afaics).
> 
> You can of course replace all the errno usages with the proper way how
> to do this on WinCE. In that case you might want to contact the upstream
> developer of iconv about your plans?
> 
> 
> > o. Port pthread-win32 (somebody has been working on hard on getting
> >    pthread-win32 ported to WinCE, followup on this work)
> 
> 
> export PATH=/opt/mingw32ce/bin/:$PATH
> export CFLAGS=-DWINCE
> make CROSS=arm-wince-mingw32ce- clean GC-inlined
> 
> Gives you similar problems: errno.h can't be found so these compilation
> errors make sense.
> 
> ptw32_tkAssocCreate.c: In function 'ptw32_tkAssocCreate':
> ptw32_tkAssocCreate.c:88: error: 'ENOMEM' undeclared (first use in this function)
> ptw32_tkAssocCreate.c:88: error: (Each undeclared identifier is reported only once
> ptw32_tkAssocCreate.c:88: error: for each function it appears in.)
> 
> 
> ptw32_semwait.c: In function 'ptw32_semwait':
> ptw32_semwait.c:74: error: 'EINVAL' undeclared (first use in this function)
> ptw32_semwait.c:112: error: 'errno' undeclared (first use in this function)
> In file included from private.c:55,
> 
> 
> By simply adapting the errno.h in /opt/mingw32ce/arm-wince-mingw32ce/include/errno.h
> and using export CFLAGS="-DWINCE -I/opt/mingw32ce/arm-wince-mingw32ce/include/ I
> get this result:
> 
> 
> pvanhoof schtrumpf:~/Desktop/pthreads-w32-2-8-0-release$ make CROSS=arm-wince-mingw32ce- clean GC-inlined
> rm -f *~
> rm -f *.i
> rm -f *.o
> rm -f *.obj
> rm -f *.exe
> rm -f pthread.def
> make XOPT="-DPTW32_BUILD_INLINED" CLEANUP=-D__CLEANUP_C XC_FLAGS=" " OBJ="pthread.o version.o" pthreadGC2.stamp
> make[1]: Entering directory `/home/pvanhoof/Desktop/pthreads-w32-2-8-0-release'
> arm-wince-mingw32ce-gcc -c -o pthread.o -D__CLEANUP_C -O3 -finline-functions -DPTW32_BUILD_INLINED -I. -DHAVE_CONFIG_H -Wall  pthread.c
> In file included from private.c:44,
>                  from pthread.c:44:
> ptw32_MCS_lock.c: In function 'ptw32_mcs_lock_release':
> 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
> In file included from private.c:48,
>                  from pthread.c:44:
> ptw32_threadStart.c: In function 'ptw32_threadStart':
> ptw32_threadStart.c:349: warning: implicit declaration of function '_endthread'
> In file included from barrier.c:43,
>                  from pthread.c:46:
> pthread_barrier_wait.c: In function 'pthread_barrier_wait':
> 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
> In file included from cancel.c:44,
>                  from pthread.c:47:
> pthread_cancel.c:65:2: error: #error Module contains CPU-specific code; modify and recompile.
> In file included from cancel.c:44,
>                  from pthread.c:47:
> pthread_cancel.c: In function 'ptw32_RegisterCancelation':
> pthread_cancel.c:96: warning: implicit declaration of function 'PTW32_PROGCTR'
> pthread_cancel.c:96: error: invalid lvalue in assignment
> In file included from pthread.c:50:
> create.c: In function 'pthread_create':
> create.c:238: warning: implicit declaration of function '_beginthread'
> In file included from misc.c:42,
>                  from pthread.c:56:
> pthread_once.c: In function 'pthread_once':
> 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
> In file included from nonportable.c:45,
>                  from pthread.c:58:
> pthread_win32_attach_detach_np.c: In function 'pthread_win32_process_attach_np':
> pthread_win32_attach_detach_np.c:118: warning: passing argument 2 of 'GetProcAddressW' from incompatible pointer type
> pthread_win32_attach_detach_np.c:159: warning: passing argument 2 of 'GetProcAddressW' from incompatible pointer type
> pthread_win32_attach_detach_np.c:183: warning: passing argument 2 of 'GetProcAddressW' from incompatible pointer type
> pthread_win32_attach_detach_np.c: In function 'pthread_win32_process_detach_np':
> pthread_win32_attach_detach_np.c:239: warning: passing argument 2 of 'GetProcAddressW' from incompatible pointer type
> make[1]: *** [pthread.o] Error 1
> make[1]: Leaving directory `/home/pvanhoof/Desktop/pthreads-w32-2-8-0-release'
> make: *** [GC-inlined] Error 2
> pvanhoof schtrumpf:~/Desktop/pthreads-w32-2-8-0-release$ 
> 
> 
> 
> iconv gives me this after adapting errno.h:
> 
> pvanhoof schtrumpf:~/Desktop/libiconv-1.9.2$ make
> cd lib && make all
> make[1]: Entering directory `/home/pvanhoof/Desktop/libiconv-1.9.2/lib'
> /bin/sh ../libtool --mode=compile /opt/mingw32ce/bin/arm-wince-mingw32ce-gcc -I. -I. -I../include -I./../include  -g -O2 -DLIBDIR=\"/opt/glib-wince/lib\" -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/opt/glib-wince/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libiconv_set_relocation_prefix -Drelocate=libiconv_relocate -DHAVE_CONFIG_H -c ./iconv.c
>  /opt/mingw32ce/bin/arm-wince-mingw32ce-gcc -I. -I. -I../include -I./../include -g -O2 -DLIBDIR=\"/opt/glib-wince/lib\" -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/opt/glib-wince/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libiconv_set_relocation_prefix -Drelocate=libiconv_relocate -DHAVE_CONFIG_H -c ./iconv.c  -DDLL_EXPORT -DPIC -o .libs/iconv.o
> In file included from /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/wchar.h:45,
>                  from ./loop_wchar.h:28,
>                  from ./loops.h:24,
>                  from ./iconv.c:130:
> /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/wctype.h: In function 'isleadbyte':
> /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/wctype.h:144: error: '_pctype' undeclared (first use in this function)
> /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/wctype.h:144: error: (Each undeclared identifier is reported only once
> /opt/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/wctype.h:144: error: for each function it appears in.)
> In file included from ./loops.h:24,
>                  from ./iconv.c:130:
> ./loop_wchar.h: In function 'wchar_from_loop_convert':
> ./loop_wchar.h:107: error: 'MB_CUR_MAX' undeclared (first use in this function)
> make[1]: *** [iconv.lo] Error 1
> make[1]: Leaving directory `/home/pvanhoof/Desktop/libiconv-1.9.2/lib'
> make: *** [all] Error 2
> pvanhoof schtrumpf:~/Desktop/libiconv-1.9.2$ 
> 
> 
> I guess these things are fixable or doable to fix.
> 
> 
> 
> > o. Port glib
> 
> As glib depends on both pthread-win32 and iconv, I haven't even tried
> this yet.
> 
> > o. Get a basic Tinymail (without support for Gtk+ compiled)
> > o. Test some basic types like the TnyList
> > o. Port Gtk+ using tor's gtk-win32 port
> > o. Port the libtinymailui-gtk+ library
> > o. Implement a HTML TnyMsgView that uses the native browser of WinCE
> > o. Implement .NET bindings
> > o. Make the .NET bindings work with Compact Framework .NET
> > o. Implement a demo CF.NET E-mail client
> > 
> > I think all this combined is a one year one men project. Although some
> > parts will probably be done by other people while you would be
> > developing on earlier points in this list.
> > 
> > If somebody is interested in this, or needs my assistance, I'd be happy
> > to help out.
> > 
> > For P.i.p.s. I have no idea at this moment. I also think you will need
> 
> I haven't tried with P.i.p.s., please feel free to report your successes
> and failures here.
> 
> > to port iconv, but not pthread (as P.i.p.s. provides this). I think some
> > people might have ported an older version glib too. So double check what
> > other people have already finished. Maybe also contact Nokia about your
> > plans. Who knows they are interested in such a port (Tinymail on the S60
> > series, that would be nice).
> > 
> > If somebody is interested in this, or needs my assistance, I'd be happy
> > to help out.
> 
> 
-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]