How to port uclibc to Windows CE

Rich Felker dalias at aerifal.cx
Tue Feb 8 19:18:49 UTC 2011


On Tue, Feb 08, 2011 at 09:56:24AM -0500, David Lynch Jr. wrote:
> 	I am not specifically familiar with Windows CE. But I have done lots of
> cross platform work with windows.  Ignoring tangents like the Windows
> Posix subsystem and Cygwin, normal windows - microsoft's C libraries
> provides a significant portion of POSIX support.  The critical problem
> is that windows developers almost univerally use the Windows specific
> API's over the more portable POSIX API's. 

This is not true. The Microsoft libc (MSVCRT) does not even conform to
ancient versions of the C standard, much less C99, and the degree to
which the functions with names that mirror POSIX functions differ from
the POSIX-specified behavior is laughable. (For instance, sockets and
file descriptors are not the same and cannot be used interchangibly,
and they're not allocated in lowest-available order.)

If you want to run POSIX programs on Windows, you need to do one of
the following:

- Use cygwin, OR
- Find all the critical bugs and conformance issues in MSVCRT and
  improve mingw to wrap or replace all those interfaces with
  conformant ones, OR
- Hack the program you're trying to port to bits and eliminate all
  assumptions of sanity and POSIX (and even ANSI/ISO C) conformance.
  Add #ifdefs all over the place. Welcome to the 1990s all over again.

Good luck! :-)

Rich


More information about the uClibc mailing list