| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |  uClibc and Glibc are not the same -- there are a number of differences whichmay or may not cause you problems.  This document attempts to list thesedifferences and, when completed, will contain a full list of all relevantdifferences.1) uClibc is smaller than glibc.  We attempt to maintain a glibc compatibleinterface, allowing applications that compile with glibc to easily compile withuClibc.  However, we do not include _everything_ that glibc includes, andtherefore some applications may not compile.  If this happens to you, pleasereport the failure to the uclibc mailing list, with detailed error messages.2) uClibc is much more configurable then glibc.  This means that a developermay have compiled uClibc in such a way that significant amounts offunctionality have been omitted.  3) uClibc does not even attempt to ensure binary compatibility across releases.When a new version of uClibc is released, you may or may not need to recompileall your binaries.4) malloc(0) in glibc returns a valid pointer to something(!?!?) while inuClibc calling malloc(0) returns a NULL.  The behavior of malloc(0) is listedas implementation-defined by SuSv3, so both libraries are equally correct.This difference also applies to realloc(NULL, 0).  I personally feel glibc'sbehavior is not particularly safe.  To enable glibc behavior, one has toexplicitly enable the MALLOC_GLIBC_COMPAT option.4.1) glibc's malloc() implementation has behavior that is tunable via theMALLOC_CHECK_ environment variable.  This is primarily used to provide extramalloc debugging features.  These extended malloc debugging features are notavailable within uClibc.  There are many good malloc debugging librariesavailable for Linux (dmalloc, electric fence, valgrind, etc) that work muchbetter than the glibc extended malloc debugging.  So our omitting thisfunctionality from uClibc is not a great loss.5) uClibc does not provide a database library (libdb).6) uClibc does not support NSS (/lib/libnss_*), which allows glibc to easilysupport various methods of authentication and DNS resolution.  uClibc onlysupports flat password files and shadow password files for storingauthentication information.7) uClibc's libresolv is only a stub.  Some, but not all of the functionalityprovided by glibc's libresolv is provided internal to uClibc.  Other functionsare not at all implemented.8) libnsl provides support for Network Information Service (NIS) which wasoriginally called "Yellow Pages" or "YP", which is an extension of RPC inventedby Sun to share Unix password files over the network.  I personally think NISis an evil abomination, and should be avoided.  These days, using ldap is muchmore effective mechanism for doing the same thing.  uClibc provides a stublibnsl, but and has no actual support for Network Information Service (NIS).We therefore, also do not provide any of the headers files provided by glibcunder /usr/include/rpcsvc.   I am open to implementing ldap based passwordauthentication, but I do not personally intend to implement it (since I have nouse for it).9) uClibc's locale support is not 100% complete yet.  We are working on it.10) uClibc's math library only supports long double as inlines, and eventhen the long double support is quite limited.11) uClibc's libcrypt does not support the reentrant crypt_r, setkey_r andencrypt_r, since these are not required by SuSv3.12) uClibc directly uses the kernel types to define most opaque data types.13) uClibc directly uses the linux kernel's arch specific 'stuct stat'.14) Add other things here as they come up......******************************  Manuel's Notes  ******************************Some general comments...The intended target for all my uClibc code is ANSI/ISO C99 and SUSv3compliance.  While some glibc extensions are present, many will eventuallybe configurable.  Also, even when present, the glibc-like extensions maydiffer slightly or be more restrictive than the native glibc counterparts.They are primarily meant to be porting _aides_ and not necessarilydrop-in replacements.Now for some details...time functions--------------1) Leap seconds are not supported.2) /etc/timezone and the whole zoneinfo directory tree are not supported.   To set the timezone, set the TZ environment variable as specified in   http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html   or you may also create an /etc/TZ file of a single line, ending with a   newline, containing the TZ setting.  For example   echo CST6CDT > /etc/TZ3) Currently, locale specific eras and alternate digits are not supported.   They are on my TODO list.wide char support-----------------1) The only multibyte encoding currently supported is UTF-8.  The various   ISO-8859-* encodings are (optionally) supported.  The internal   representation of wchar's is assumed to be 31 bit unicode values in   native endian representation.  Also, the underlying char encoding is   assumed to match ASCII in the range 0-0x7f.2) In the next iteration of locale support, I plan to add support for   (at least some) other multibyte encodings.locale support--------------1) The target for support is SUSv3 locale functionality.  While nl_langinfo   has been extended, similar to glibc, it only returns values for related   locale entries.2) Currently, all SUSv3 libc locale functionality should be implemented   except for wcsftime and collating item support in regex.stdio-----1) Conversion of large magnitude floating-point values by printf suffers a loss   of precision due to the algorithm used.2) uClibc's printf is much stricter than glibcs, especially regarding positional   args.  The entire format string is parsed first and an error is returned if   a problem is detected.  In locales other than C, the format string is checked   to be a valid multibyte sequence as well.  Also, currently at most 10 positional   args are allowed (although this is configurable).3) BUFSIZ is configurable, but no attempt is made at automatic tuning of internal   buffer sizes for stdio streams.  In fact, the stdio code in general sacrifices   sophistication/performace for minimal size.4) uClibc allows glibc-like custom printf functions.  However, while not   currently checked, the specifier must be <= 0x7f.5) uClibc allows glibc-like custom streams.  However, no in-buffer seeking is   done.6) The functions fcloseall() and __fpending() can behave differently than their   glibc counterparts.7) uClibc's setvbuf is more restrictive about when it can be called than glibc's   is.  The standards specify that setvbuf must occur before any other operations   take place on the stream.8) Right now, %m is not handled properly by printf when the format uses positional   args.More to follow as I think of it...
 |