[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/docs/Glibc_vs_uClibc_Differences.txt b/ap/build/uClibc/docs/Glibc_vs_uClibc_Differences.txt
new file mode 100644
index 0000000..ffddbae
--- /dev/null
+++ b/ap/build/uClibc/docs/Glibc_vs_uClibc_Differences.txt
@@ -0,0 +1,215 @@
+ uClibc and Glibc are not the same -- there are a number of differences which
+may or may not cause you problems.  This document attempts to list these
+differences and, when completed, will contain a full list of all relevant
+differences.
+
+
+1) uClibc is smaller than glibc.  We attempt to maintain a glibc compatible
+interface, allowing applications that compile with glibc to easily compile with
+uClibc.  However, we do not include _everything_ that glibc includes, and
+therefore some applications may not compile.  If this happens to you, please
+report the failure to the uclibc mailing list, with detailed error messages.
+
+2) uClibc is much more configurable then glibc.  This means that a developer
+may have compiled uClibc in such a way that significant amounts of
+functionality 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 recompile
+all your binaries.
+
+4) malloc(0) in glibc returns a valid pointer to something(!?!?) while in
+uClibc calling malloc(0) returns a NULL.  The behavior of malloc(0) is listed
+as implementation-defined by SuSv3, so both libraries are equally correct.
+This difference also applies to realloc(NULL, 0).  I personally feel glibc's
+behavior is not particularly safe.  To enable glibc behavior, one has to
+explicitly enable the MALLOC_GLIBC_COMPAT option.
+
+4.1) glibc's malloc() implementation has behavior that is tunable via the
+MALLOC_CHECK_ environment variable.  This is primarily used to provide extra
+malloc debugging features.  These extended malloc debugging features are not
+available within uClibc.  There are many good malloc debugging libraries
+available for Linux (dmalloc, electric fence, valgrind, etc) that work much
+better than the glibc extended malloc debugging.  So our omitting this
+functionality 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 easily
+support various methods of authentication and DNS resolution.  uClibc only
+supports flat password files and shadow password files for storing
+authentication information.  If you need something more complex than this,
+you can compile and install pam.
+
+7) uClibc's libresolv is only a stub.  Some, but not all of the functionality
+provided by glibc's libresolv is provided internal to uClibc.  Other functions
+are not at all implemented.
+
+8) libnsl provides support for Network Information Service (NIS) which was
+originally called "Yellow Pages" or "YP", which is an extension of RPC invented
+by Sun to share Unix password files over the network.  I personally think NIS
+is an evil abomination and should not be used.  These days, using ldap is much
+more effective mechanism for doing the same thing.  uClibc provides a stub
+libnsl, but has no actual support for Network Information Service (NIS).
+We therefore, also do not provide any of the headers files provided by glibc
+under /usr/include/rpcsvc.
+
+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 even
+then the long double support is quite limited.  Also, very few of the
+float math functions are implemented.  Stick with double and you should
+be just fine.
+
+11) uClibc's libcrypt does not support the reentrant crypt_r, setkey_r and
+encrypt_r, since these are not required by SuSv3.
+
+12) uClibc directly uses kernel types to define most opaque data types.
+
+13) uClibc directly uses the linux kernel's arch specific 'struct stat'.
+
+14) uClibc's librt library currently lacks all aio routines, all clock
+    routines, and all shm routines (only the timer routines and the mq
+    routines are implemented).
+
+<other things as we notice them>
+
+
+
+******************************  Manuel's Notes  ******************************
+
+Some general comments...
+
+The intended target for all my uClibc code is ANSI/ISO C99 and SUSv3
+compliance.  While some glibc extensions are present, many will eventually
+be configurable.  Also, even when present, the glibc-like extensions may
+differ slightly or be more restrictive than the native glibc counterparts.
+They are primarily meant to be porting _aides_ and not necessarily
+drop-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/TZ
+3) 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.
+9) The FILEs created by glibc's fmemopen(), open_memstream(), and fopencookie()
+   are not capable of wide orientation.  The corresponding uClibc routines do
+   not have this limitation.
+10) For scanf, the C99 standard states "The fscanf function returns the value of
+    the macro EOF if an input failure occurs before any conversion."  But glibc's
+    scanf does not respect conversions for which assignment was surpressed, even
+    though the standard states that the value is converted but not stored.
+
+glibc bugs that Ulrich Drepper has refused to acknowledge or comment on
+  ( http://sources.redhat.com/ml/libc-alpha/2003-09/ )
+-----------------------------------------------------------------------
+1) The C99 standard says that for printf, a %s conversion makes no special
+   provisions for multibyte characters.  SUSv3 is even more clear, stating
+   that bytes are written and a specified precision is in bytes.  Yet glibc
+   treats the arg as a multibyte string when a precision is specified and
+   not otherwise.
+2) Both C99 and C89 state that the %c conversion for scanf reads the exact
+   number of bytes specified by the optional field width (or 1 if not specified).
+   uClibc complies with the standard.  There is an argument that perhaps the
+   specified width should be treated as an upper bound, based on some historical
+   use.  However, such behavior should be mentioned in the Conformance document.
+3) glibc's scanf is broken regarding some numeric patterns.  Some invalid
+   strings are accepted as valid ("0x.p", "1e", digit grouped strings).
+   In spite of my posting examples clearly illustrating the bugs, they remain
+   unacknowledged by the glibc developers.
+4) glibc's scanf seems to require a 'p' exponent for hexadecimal float strings.
+   According to the standard, this is optional.
+5) C99 requires that once an EOF is encountered, the stream should be treated
+   as if at end-of-file even if more data becomes available.  Further reading
+   can be attempted by clearing the EOF flag though, via clearerr() or a file
+   positioning function.  For details concerning the original change, see
+   Defect Report #141.  glibc is currently non-compliant, and the developers
+   did not comment when I asked for their official position on this issue.
+6) glibc's collation routines and/or localedef are broken regarding implicit
+   and explicit UNDEFINED rules.
+
+More to follow as I think of it...
+
+
+
+
+Profiling:
+-------------------------------------------------------------------
+
+uClibc no longer supports 'gcc -fprofile-arcs  -pg' style profiling, which
+causes your application to generate a 'gmon.out' file that can then be analyzed
+by 'gprof'.  Not only does this require explicit extra support in uClibc, it
+requires that you rebuild everything with profiling support.  There is both a
+size and performance penalty to profiling your applications this way, as well
+as Heisenberg effects, where the act of measuring changes what is measured.
+
+There exist a number of less invasive alternatives that do not require you to
+specially instrument your application, and recompile and relink everything.
+
+The OProfile system-wide profiler is an excellent alternative:
+      http://oprofile.sourceforge.net/
+
+Many people have had good results using the combination of Valgrind
+to generate profiling information and KCachegrind for analysis:
+      http://developer.kde.org/~sewardj/
+      http://kcachegrind.sourceforge.net/
+
+Prospect is another alternative based on OProfile:
+      http://prospect.sourceforge.net/
+
+And the Linux Trace Toolkit (LTT) is also a fine tool:
+    http://www.opersys.com/LTT/
+
+FunctionCheck:
+	http://www710.univ-lyon1.fr/~yperret/fnccheck/
+
diff --git a/ap/build/uClibc/docs/PORTING b/ap/build/uClibc/docs/PORTING
new file mode 100644
index 0000000..cadb323
--- /dev/null
+++ b/ap/build/uClibc/docs/PORTING
@@ -0,0 +1,138 @@
+Some notes to help future porters.  Replace 'ARCH' with whatever arch
+you are hacking on.
+
+====================
+=== Config Files ===
+====================
+- create extra/Configs/Config.ARCH
+   See the other arch files for some good examples.  powerpc/sparc/alpha
+   should be pretty simple templates.
+- add ARCH to the 'Target Architecture' list in extra/Configs/Config.in
+- Initially you will want to disable shared libraries, since making
+   the shared library loader work requires you first have basic architecture
+   support working.  Thus you should add ARCH_HAS_NO_SHARED and
+   ARCH_HAS_NO_LDSO to Config.ARCH's TARGET_ARCH
+
+====================
+=== libc sysdeps ===
+====================
+(note: if glibc has already been ported to your arch, you can usually just
+       copy a lot of files from them rather than coding from scratch)
+- create libc/sysdeps/linux/ARCH
+- copy Makefile and Makefile.arch from libc/sysdeps/linux/i386/
+- set CSRC and SSRC to nothing in Makefile.arch for now
+
+- create crt1.S which defines the _start function ... you will probably want
+  to clear the frame pointer to make gdb happy, and then you will want to call
+  the funcion __uClibc_main() which takes these parameters:
+   __uClibc_main(main(), argc, argv, _init(), _fini())
+  Initially if you wish to make things easier on yourself, you can disable the
+  UCLIBC_CTOR_DTOR option and just set the init/fini arguments to NULL.
+  glibc generally stores this function in libc/sysdeps/ARCH/elf/start.S
+
+- create these additional files in ARCH/bits/
+
+  (template versions can be found in common/bits/ for you to tweak)
+  endian.h  fcntl.h  setjmp.h  stackinfo.h  uClibc_arch_features.h  wordsize.h
+
+  kernel_types.h should be created based upon linux asm-ARCH/posix_types.h
+
+  copy linux asm-ARCH/stat.h to bits/kernel_stat.h
+
+  create syscalls.h based upon linux's unistd.h / glibc's sysdeps.h ... really
+  you just want to define the _syscall[0-6] macros.  It is important that
+  these syscalls should be PIC safe (or you should provide a PIC and non-PIC
+  version) if you wish to properly support shared libraries.
+
+- at this point, you should have enough to generate a working HELLO WORLD
+  static binary (see test/silly/*.c files)
+
+- if you want UCLIBC_CTOR_DTOR support, you will need to create crti.S and
+  crtn.S files which define function prologues/epilogues.
+
+- for a more stable static port, you will need to create these files (and
+  update the Makefile.arch values accordingly)
+    __longjmp  bsd-_setjmp  bsd-setjmp  brk  clone  setjmp  syscall  vfork
+  usually these are written in assembler, but you may be able to cheat and
+  write them in C ... see other ports for more information
+
+====================
+=== pthread deps ===
+====================
+
+TODO: nptl / linuxthreads / linuxthreads.old
+
+====================
+=== ldso sysdeps ===
+====================
+- elf.h - presumably you've already taught binutils all about the random ELF
+  relocations your arch needs, so now you need to make sure the defines exist
+  for uClibc.  make sure the EM_### define exists and all of the R_###_###
+  reloc defines.
+
+- enable ldso/shared options in your extra/Configs/Config.ARCH file
+- you will need to create the following files in ldso/ldso/ARCH/
+  dl-debug.h  dl-startup.h  dl-syscalls.h  dl-sysdep.h  elfinterp.c  resolve.S
+
+- dl-debug.h: define string versions of all the relocations of your arch in the
+  _dl_reltypes_tab array ... the index should match the actual reloc type, so
+  if the value of say R_X86_64_PC16 is 13, then "R_X86_64_PC16" better be at
+  index 13 of the array
+
+- dl-startup.h:
+  - define the _start function which should call _dl_start which takes just one
+    parameter ... a pointer to argc (usually on the stack)
+    glibc stores this function in libc/sysdeps/ARCH/dl-machine.h as RTLD_START
+  - define the GET_ARGV() macro which calculates the value of argv based upon
+    the parameter passed to _dl_start (usually it's simply just ARGS+1)
+  - define PERFORM_BOOTSTRAP_RELOC() macro which will handle just the relocs
+    that the ldso itself will generate
+
+- dl-syscalls.h:
+  if you wrote your bits/syscalls.h file correctly in the libc step above, you
+  can simply copy this file from another arch and be done ... otherwise you
+  will have to define the syscall[0-6] macros again, but this time setting
+  _dl_errno instead of just errno
+
+- dl-sysdep.h:
+  misc cruft goes in here ... you want to:
+  - either define or undefine ELF_USES_RELOCA
+  - define the INIT_GOT macro
+  - define MAGIC1 to the EM_### value your ELF arch uses
+  - define ELF_TARGET to a string name for your arch
+  - define the do_rem() macro
+  - define misc ALIGN macro's
+  - define elf_machine_type_class() macro
+  - define the inline functions elf_machine_dynamic, elf_machine_load_address,
+    and elf_machine_relative
+  glibc stores a bunch of these values in libc/sysdeps/ARCH/dl-machine.h
+
+- elfinterp.c:
+  define all the relocation functions ... it's best if you just copy from
+  another arch which uses the same type of relocations (REL or RELA) and
+  start from there.
+
+- resolve.S:
+  front end of lazy relocation ... define the _dl_linux_resolve symbol which
+  is called by a PLT entry which has yet to be setup ... you will want to:
+  - set up arguments for _dl_linux_resolver()
+  - call _dl_linux_resolver()
+  - clean up after call
+  - jump to function address now stored in PLT
+  glibc stores this function in libc/sysdeps/ARCH/dl-trampoline.S
+
+- utils/ldd.c - if you want support for ldso cache files (spoiler: you do),
+  then you'll need to teach ldd a little.  generally, the fallback code
+  should be smart and "just work", but you should be explicit.  just pop
+  it open and add an appropriate ifdef for your arch and set MATCH_MACHINE()
+  and ELFCLASSM.  there are plenty examples and you're (hopefully) smart.
+
+====================
+===  Misc Cruft  ===
+====================
+- utils/readelf.c - not really needed generally speaking, but might as well
+  add your arch to the giant EM_* list (describe_elf_hdr)
+
+- MAINTAINERS - presumably you're going to submit this code back to mainline
+  and since you're the only one who cares about this arch (right now), you
+  should add yourself to the toplevel MAINTAINERS file.  do it.
diff --git a/ap/build/uClibc/docs/crt.txt b/ap/build/uClibc/docs/crt.txt
new file mode 100644
index 0000000..41a44dc
--- /dev/null
+++ b/ap/build/uClibc/docs/crt.txt
@@ -0,0 +1,80 @@
+Mini FAQ about the misc libc/gcc crt files.
+
+
+Some definitions:
+PIC - position independent code (-fPIC)
+PIE - position independent executable (-fPIE -pie)
+crt - C runtime
+
+
+
+crt0.o crt1.o etc...
+  Some systems use crt0.o, while some use crt1.o (and a few even use crt2.o
+  or higher).  Most likely due to a transitionary phase that some targets
+  went through.  The specific number is otherwise entirely arbitrary -- look
+  at the internal gcc port code to figure out what your target expects.  All
+  that matters is that whatever gcc has encoded, your C library better use
+  the same name.
+
+  This object is expected to contain the _start symbol which takes care of
+  bootstrapping the initial execution of the program.  What exactly that
+  entails is highly libc dependent and as such, the object is provided by
+  the C library and cannot be mixed with other ones.
+
+  On uClibc/glibc systems, this object initializes very early ABI requirements
+  (like the stack or frame pointer), setting up the argc/argv/env values, and
+  then passing pointers to the init/fini/main funcs to the internal libc main
+  which in turn does more general bootstrapping before finally calling the real
+  main function.
+
+  glibc ports call this file 'start.S' while uClibc ports call this crt0.S or
+  crt1.S (depending on what their gcc expects).
+
+crti.o
+  Defines the function prologs for the .init and .fini sections (with the _init
+  and _fini symbols respectively).  This way they can be called directly.  These
+  symbols also trigger the linker to generate DT_INIT/DT_FINI dynamic ELF tags.
+
+  These are to support the old style constructor/destructor system where all
+  .init/.fini sections get concatenated at link time.  Not to be confused with
+  newer prioritized constructor/destructor .init_array/.fini_array sections and
+  DT_INIT_ARRAY/DT_FINI_ARRAY ELF tags.
+
+  glibc ports used to call this 'initfini.c', but now use 'crti.S'.  uClibc
+  also uses 'crti.S'.
+
+crtn.o
+  Defines the function epilogs for the .init/.fini sections.  See crti.o.
+
+  glibc ports used to call this 'initfini.c', but now use 'crtn.S'.  uClibc
+  also uses 'crtn.S'.
+
+Scrt1.o
+  Used in place of crt1.o when generating PIEs.
+gcrt1.o
+  Used in place of crt1.o when generating code with profiling information.
+  Compile with -pg.  Produces output suitable for the gprof util.
+Mcrt1.o
+  Like gcrt1.o, but is used with the prof utility.  glibc installs this as
+  a dummy file as it's useless on linux systems.
+
+crtbegin.o
+  GCC uses this to find the start of the constructors.
+crtbeginS.o
+  Used in place of crtbegin.o when generating shared objects/PIEs.
+crtbeginT.o
+  Used in place of crtbegin.o when generating static executables.
+crtend.o
+  GCC uses this to find the start of the destructors.
+crtendS.o
+  Used in place of crtend.o when generating shared objects/PIEs.
+
+
+
+General linking order:
+crt1.o crti.o crtbegin.o [-L paths] [user objects] [gcc libs] [C libs] [gcc libs] crtend.o crtn.o
+
+
+
+More references:
+	http://gcc.gnu.org/onlinedocs/gccint/Initialization.html
diff --git a/ap/build/uClibc/docs/defines.txt b/ap/build/uClibc/docs/defines.txt
new file mode 100644
index 0000000..6e4a604
--- /dev/null
+++ b/ap/build/uClibc/docs/defines.txt
@@ -0,0 +1,85 @@
+Feeble attempt to document the horde of #defines we deal with.
+Editors, please make your descriptions short but informative.
+
+
+
+__BEGIN_DECLS, __END_DECLS
+    Defined to either empty or 'extern "C" {' and '}' if included by C++.
+
+__USE_GNU, __USE_BSD, __USE_XOPEN[2K], __USE_SVID, __USE_POSIX...
+    If defined, user program which included us requests compat additions
+    from relevant standard or Unix flavor. See features.h for full list.
+
+__USE_FILE_OFFSET64
+__USE_LARGEFILE[64]
+_LARGEFILE[64]_SOURCE
+_FILE_OFFSET_BITS
+    ???
+
+__THROW
+    Function annotation "I do not throw anything".
+__NTH(func(params))
+    Function annotation "I do not throw anything".
+    Needed for situatuons when it's unclear on what side of "func(params)"
+    the "throw()" or "attribute((nothrow))" should eventually appear.
+    Messy, eh?
+
+return_type __REDIRECT(name, (params), alias)
+    declare alias to "name(params)"
+return_type __REDIRECT_NTH(name, (params), alias)
+    declare alias to "name(params) __THROW"
+
+__BIG_ENDIAN    4321
+__LITTLE_ENDIAN 1234
+    Should be always as shown. __PDP_ENDIAN is historic, ignore?
+__BYTE_ORDER, __FLOAT_WORD_ORDER
+    Should be defined to __BIG_ENDIAN or __LITTLE_ENDIAN.
+    Usage: "#if __BYTE_ORDER == __LITTLE_ENDIAN ..."
+    __USE_BSD adds versions without leading "__" for above four defines.
+_BIG_ENDIAN, __BIG_ENDIAN__
+_LITTLE_ENDIAN, __LITTLE_ENDIAN__
+    Defined (to what?) by gcc for some architectures to indicate endianness.
+    Seems that the fact of defined-ness is an indicator, not the value.
+
+__USE_EXTERN_INLINES
+    If defined, headers will supply some function as inlines.
+    uclibc itself is built with this option off and provides
+    out-of-line version of every inlined function in case user program
+    calls it instead of using an inline.
+_EXTERN_INLINE
+    If not defined by user prior to #include, will be defined to
+    "extern inline" or equivalent. IOW, if user defines it prior
+    #include, it replaces "extern __inline" string in inline definitions
+    (those enabled by __USE_EXTERN_INLINES) with something else.
+    A few uclibc .c files use it to create non-inlined functions
+    by defining it to "".
+__extern_inline
+    Defined to "extern inline", modulo gcc/C standard deviations.
+    Can't be used by user to play tricks as with _EXTERN_INLINE.
+
+internal_function
+    Used to modify function's calling convention, if "standard" one
+    is suboptimal. Examples:
+	int func(params) internal_function;
+	int internal_function func(params) { body }
+
+_LIBC
+    Defined only at libc build time. It is physically deleted
+from the headers (using unifdef tool) in installed headers ("make install").
+
+__UCLIBC_XXX
+    uclibc-internal and uclibc-specific defines. In particular:
+__UCLIBC_HAS_XXX__, __UCLIBC_HAVE_XXX__
+    __UCLIBC_HAS_XXX__ are booleans (defined/undefined), defined in
+    uClibc_config.h and generated from uclibc .config file.
+    __UCLIBC_HAVE_XXX__ are booleans from bits/uClibc_arch_features.h
+    (there are more __UCLIBC_XXX defines there)
+
+_IEEE_LIBM
+    Always defined at libm build time
+__LDBL_COMPAT
+    Never defined, TODO: remove?
+
+__SSP_ALL__
+    All functions, even small ones, have stack smashing protection
+    prologue enabled.
diff --git a/ap/build/uClibc/docs/man/ldconfig.8 b/ap/build/uClibc/docs/man/ldconfig.8
new file mode 100644
index 0000000..208d63d
--- /dev/null
+++ b/ap/build/uClibc/docs/man/ldconfig.8
@@ -0,0 +1,73 @@
+.TH LDCONFIG 8 2005-08-15 uClibc "Linux Programmer's Manual"
+.SH NAME
+ldconfig \- updates symlinks and cache for shared libraries
+.SH SYNOPSIS
+.B ldconfig
+[
+.B -DvqnNX
+] [
+.B -f conf
+] [
+.B -C cache
+] [
+.B -r root
+] 
+.B dir ...
+.br
+.B ldconfig -l
+[
+.B -Dv
+] 
+.B lib ...
+.br
+.B ldconfig -p
+.SH DESCRIPTION
+.B ldconfig 
+creates the necessary links and cache to the most recent shared libraries 
+found in the directories specified on the command line, in the file 
+\fI/etc/ld.so.conf\fR, and in the default trusted directories (\fI/lib\fR and 
+\fI/usr/lib\fR).  The cache is used by the run-time linker.
+.B ldconfig
+checks the header and file names of the libraries it encounters when 
+determining which versions should have their links updated.
+
+.B Note:
+Some features may not exist depending on how uClibc was built
+.SH OPTIONS
+.TP
+.B -C cache
+use specified \fIcache\fR instead of default
+.TP
+.B -D
+debug mode, do not update links
+.TP
+.B -f conf
+use specified \fIconf\fR instead of default
+.TP
+.B -l
+library mode, manually link libraries
+.TP
+.B -n
+do not process standard trusted directories
+.TP
+.B -N
+do not update the library cache
+.TP
+.B -p
+print the current library cache
+.TP
+.B -q
+quiet mode, do not print warnings you should actually be reading
+.TP
+.B -r root
+chroot to \fIroot\fR before running
+.TP
+.B -v
+verbose mode, print things as we go, and generally be annoying
+.TP
+.B -X
+do not update the library links
+.SH BUGS
+Probably, make sure you complain when you find them:
+.br
+http://bugs.uclibc.org/
diff --git a/ap/build/uClibc/docs/man/ldd.1 b/ap/build/uClibc/docs/man/ldd.1
new file mode 100644
index 0000000..0b69f73
--- /dev/null
+++ b/ap/build/uClibc/docs/man/ldd.1
@@ -0,0 +1,17 @@
+.TH LDD 1 2005-08-15 uClibc "Linux Programmer's Manual"
+.SH NAME
+ldd \- Print shared library dependencies
+.SH SYNOPSIS
+.B ldd
+[
+.B OPTIONS
+]
+.B FILE ...
+.SH DESCRIPTION
+Prints shared library dependencies.
+.SH OPTIONS
+None actually, we lied about that part.
+.SH BUGS
+Probably, make sure you complain when you find them:
+.br
+http://bugs.uclibc.org/
diff --git a/ap/build/uClibc/docs/probe_math_exception.c b/ap/build/uClibc/docs/probe_math_exception.c
new file mode 100644
index 0000000..dbc9020
--- /dev/null
+++ b/ap/build/uClibc/docs/probe_math_exception.c
@@ -0,0 +1,64 @@
+/* Small test program for probing how various math functions
+ * with specific operands set floating point exceptions
+ */
+
+#define _ISOC99_SOURCE 1
+#define _GNU_SOURCE    1
+
+#include <stdint.h>
+#include <math.h>
+#include <fenv.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+	float largest, small, t, inf_float;
+
+	largest = small = 1;
+	while (1) {
+		t = largest + small;
+		/* optimizations may make plain "t == largest" unreliable */
+		if (memcmp(&t, &largest, sizeof(float)) == 0)
+			break;
+		if (isfinite(t)) {
+			largest = t;
+			small *= 2;
+			continue;
+		}
+		small /= 2;
+	}
+	inf_float = largest + largest;
+	//printf("%.40g ", largest);
+	//printf("[%llx]\n", (long long) (*(uint32_t *)&largest));
+
+	feclearexcept(FE_ALL_EXCEPT);
+
+	//t = 1.0 / 0.0; // simple test: FE_DIVBYZERO
+	//t = nextafterf(largest, 1); // glibc 2.8: no math exceptions raised
+	//t = nextafterf(largest, largest); // glibc 2.8: no math exceptions raised
+	//t = nextafterf(largest, inf_float); // glibc 2.8: FE_INEXACT FE_OVERFLOW
+
+#define PREX(ex) do { if (fetestexcept(ex)) printf(#ex " "); } while(0)
+#ifdef FE_INEXACT
+	PREX(FE_INEXACT);
+#endif
+#ifdef FE_DIVBYZERO
+	PREX(FE_DIVBYZERO);
+#endif
+#ifdef FE_UNDERFLOW
+	PREX(FE_UNDERFLOW);
+#endif
+#ifdef FE_OVERFLOW
+	PREX(FE_OVERFLOW);
+#endif
+#ifdef FE_INVALID
+	PREX(FE_INVALID);
+#endif
+	if (fetestexcept(FE_ALL_EXCEPT))
+		printf("\n");
+	else
+		printf("no math exceptions raised\n");
+
+	printf("%.40g\n", t);
+	return 0;
+}
diff --git a/ap/build/uClibc/docs/pthreads_hacking.txt b/ap/build/uClibc/docs/pthreads_hacking.txt
new file mode 100644
index 0000000..6c23257
--- /dev/null
+++ b/ap/build/uClibc/docs/pthreads_hacking.txt
@@ -0,0 +1,748 @@
+# Run me as a shell script in uclibc lib/*
+
+
+# Dump the list of dynamic symbols from libpthread
+# and compare libpthread's exported symbols of uclibc with glibc
+# (adjust /lib64/libpthread-*.*.so as needed).
+# The resulting diff is suspiciously large.
+# We export a lot of stuff which glibc does not.
+
+readelf -sDW libpthread-*.*.so \
+| grep '^ *[0-9]' \
+| sed 's/^[0-9a-f: ]*[^ ]\(  *[A-Z]\)/\1/' \
+| sed 's/ [0-9] / N /' | sed 's/ [0-9][0-9] /  N /' | sed 's/ [0-9][0-9][0-9] /   N /' \
+| sort -k5 | uniq \
+>uclibc.lst
+
+readelf -sDW /lib64/libpthread-*.*.so \
+| grep '^ *[0-9]' \
+| sed 's/^[0-9a-f: ]*[^ ]\(  *[A-Z]\)/\1/' \
+| sed 's/ [0-9] / N /' | sed 's/ [0-9][0-9] /  N /' | sed 's/ [0-9][0-9][0-9] /   N /' \
+| sort -k5 | uniq \
+>glibc.lst
+diff -u uclibc.lst glibc.lst >ug.diff
+
+
+# Check which exported symbols from libpthread are never referenced
+# from other libraries. Generally, I'd expect a very few __functions
+# with two underscores to be exported and not used by e.g. libc-X.X.X.so,
+# as these names are supposed to be internal, i.e. external programs
+# usually don't call them. On my system, I got 141 such __functions.
+# Examples:
+# __flockfilelist - NOP function (why do we need it at all?)
+# __pthread_perform_cleanup - called only from within libpthread
+
+echo *-*.*.*.so | xargs -n1 | grep -v libpthread | xargs readelf -aW >full_dump.lst
+>uclibc_unrefd.lst
+>uclibc_refd.lst
+sed 's/^.* //g' uclibc.lst \
+| while read symbol; do
+	if grep -F -- "$symbol" full_dump.lst >/dev/null 2>&1; then
+		echo "$symbol" >>uclibc_refd.lst
+	else
+		echo "$symbol" >>uclibc_unrefd.lst
+	fi
+done
+
+exit
+
+
+In case you don't have a glibc system to try it,
+ug.diff from vda's system is below.
+
+--- uclibc.lst	2009-03-16 03:07:58.000000000 +0100
++++ glibc.lst	2009-03-16 03:07:58.000000000 +0100
+@@ -1,188 +1,173 @@
+-  NOTYPE GLOBAL DEFAULT ABS __bss_start
+-    FUNC GLOBAL DEFAULT   N __compare_and_swap
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.2.5
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.2.6
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.2
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.3
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.4
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.4
++  OBJECT GLOBAL DEFAULT ABS GLIBC_PRIVATE
++    FUNC GLOBAL DEFAULT   N _IO_flockfile
++    FUNC GLOBAL DEFAULT   N _IO_ftrylockfile
++    FUNC GLOBAL DEFAULT   N _IO_funlockfile
++  NOTYPE   WEAK DEFAULT UND _Jv_RegisterClasses
++    FUNC GLOBAL DEFAULT UND __clone
++    FUNC   WEAK DEFAULT   N __close
++    FUNC   WEAK DEFAULT   N __connect
++    FUNC   WEAK DEFAULT UND __cxa_finalize
++    FUNC GLOBAL DEFAULT UND __endmntent
+     FUNC GLOBAL DEFAULT   N __errno_location
+-    FUNC GLOBAL DEFAULT   N __flockfilelist
+-    FUNC GLOBAL DEFAULT   N __fresetlockfiles
+-    FUNC GLOBAL DEFAULT   N __funlockfilelist
++    FUNC   WEAK DEFAULT   N __fcntl
++    FUNC GLOBAL DEFAULT   N __fork
++    FUNC GLOBAL DEFAULT UND __fxstat64
++    FUNC GLOBAL DEFAULT UND __getdelim
++    FUNC GLOBAL DEFAULT UND __getmntent_r
++    FUNC GLOBAL DEFAULT UND __getpagesize
++    FUNC GLOBAL DEFAULT UND __gettimeofday
+     FUNC GLOBAL DEFAULT   N __h_errno_location
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_create_event
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_death_event
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_initial_report_events
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_key_2ndlevel_size
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_keys_max
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_sizeof_descr
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_threads_max
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_reap_event
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_version
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_timedlock
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getdetachstate
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getguardsize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getinheritsched
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getschedparam
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getschedpolicy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getscope
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getstack
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getstacksize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setdetachstate
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setguardsize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setinheritsched
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setschedparam
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setschedpolicy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setscope
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setstack
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setstacksize
+-    FUNC GLOBAL DEFAULT   N __pthread_barrierattr_getpshared
+-    FUNC GLOBAL DEFAULT   N __pthread_compare_and_swap
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_broadcast
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_init
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_signal
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_timedwait
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_wait
+-    FUNC GLOBAL DEFAULT   N __pthread_condattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_condattr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_create
+-    FUNC GLOBAL DEFAULT   N __pthread_destroy_specifics
+-    FUNC GLOBAL DEFAULT   N __pthread_do_exit
+-    FUNC GLOBAL DEFAULT   N __pthread_equal
+-    FUNC GLOBAL DEFAULT   N __pthread_exit
+-  OBJECT GLOBAL DEFAULT   N __pthread_exit_code
+-  OBJECT GLOBAL DEFAULT   N __pthread_exit_requested
+-    FUNC GLOBAL DEFAULT   N __pthread_find_self
+-  OBJECT GLOBAL DEFAULT   N __pthread_functions
+-    FUNC GLOBAL DEFAULT   N __pthread_getconcurrency
+-    FUNC GLOBAL DEFAULT   N __pthread_getschedparam
+-    FUNC   WEAK DEFAULT   N __pthread_getspecific
+-  OBJECT GLOBAL DEFAULT   N __pthread_handles
+-  OBJECT GLOBAL DEFAULT   N __pthread_handles_num
+-  OBJECT GLOBAL DEFAULT   N __pthread_has_cas
+-    FUNC GLOBAL DEFAULT   N __pthread_init_max_stacksize
+-  OBJECT GLOBAL DEFAULT   N __pthread_initial_thread
+-  OBJECT GLOBAL DEFAULT   N __pthread_initial_thread_bos
+-    FUNC GLOBAL DEFAULT   N __pthread_initialize
+-    FUNC GLOBAL DEFAULT   N __pthread_initialize_manager
++    FUNC GLOBAL DEFAULT   N __libc_allocate_rtsig
++    FUNC GLOBAL DEFAULT UND __libc_allocate_rtsig_private
++    FUNC GLOBAL DEFAULT   N __libc_current_sigrtmax
++    FUNC GLOBAL DEFAULT UND __libc_current_sigrtmax_private
++    FUNC GLOBAL DEFAULT   N __libc_current_sigrtmin
++    FUNC GLOBAL DEFAULT UND __libc_current_sigrtmin_private
++    FUNC GLOBAL DEFAULT UND __libc_dl_error_tsd
++    FUNC GLOBAL DEFAULT UND __libc_dlopen_mode
++    FUNC GLOBAL DEFAULT UND __libc_dlsym
++    FUNC GLOBAL DEFAULT UND __libc_fatal
++    FUNC GLOBAL DEFAULT UND __libc_fork
++    FUNC GLOBAL DEFAULT UND __libc_longjmp
++    FUNC GLOBAL DEFAULT UND __libc_pthread_init
++  OBJECT GLOBAL DEFAULT UND __libc_stack_end
++    FUNC GLOBAL DEFAULT UND __libc_system
++    FUNC GLOBAL DEFAULT UND __libc_thread_freeres
++    FUNC   WEAK DEFAULT   N __lseek
++    FUNC   WEAK DEFAULT   N __nanosleep
++    FUNC   WEAK DEFAULT   N __open
++    FUNC   WEAK DEFAULT   N __open64
++    FUNC   WEAK DEFAULT   N __pread64
++    FUNC GLOBAL DEFAULT   N __pthread_cleanup_routine
++    FUNC GLOBAL DEFAULT   N __pthread_clock_gettime
++    FUNC GLOBAL DEFAULT   N __pthread_clock_settime
++    FUNC GLOBAL DEFAULT   N __pthread_getspecific
+     FUNC GLOBAL DEFAULT   N __pthread_initialize_minimal
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_address
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_get
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_set
+-    FUNC   WEAK DEFAULT   N __pthread_key_create
+-    FUNC GLOBAL DEFAULT   N __pthread_kill_other_threads_np
+-  OBJECT GLOBAL DEFAULT   N __pthread_last_event
+-    FUNC GLOBAL DEFAULT   N __pthread_lock
+-  OBJECT GLOBAL DEFAULT   N __pthread_main_thread
+-    FUNC GLOBAL DEFAULT   N __pthread_manager
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_adjust_prio
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_event
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_reader
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_request
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_sighandler
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread_bos
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread_tos
+-  OBJECT GLOBAL DEFAULT   N __pthread_max_stacksize
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_destroy
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_init
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_mutex_timedlock
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_trylock
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_unlock
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_getkind_np
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_getpshared
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_gettype
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_setkind_np
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_setpshared
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_settype
+-  OBJECT GLOBAL DEFAULT   N __pthread_nonstandard_stacks
+-    FUNC GLOBAL DEFAULT   N __pthread_null_sighandler
+-  OBJECT GLOBAL DEFAULT   N __pthread_offsetof_descr
+-  OBJECT GLOBAL DEFAULT   N __pthread_offsetof_pid
+-    FUNC   WEAK DEFAULT   N __pthread_once
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_child
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_parent
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_prepare
+-    FUNC GLOBAL DEFAULT   N __pthread_perform_cleanup
+-    FUNC GLOBAL DEFAULT   N __pthread_raise
+-    FUNC GLOBAL DEFAULT   N __pthread_reset_main_thread
+-    FUNC GLOBAL DEFAULT   N __pthread_restart_new
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_destroy
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_init
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_rdlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlock_timedrdlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlock_timedwrlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_tryrdlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_trywrlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_unlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_wrlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlockattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_self
+-    FUNC GLOBAL DEFAULT   N __pthread_setcancelstate
+-    FUNC GLOBAL DEFAULT   N __pthread_setcanceltype
+-    FUNC GLOBAL DEFAULT   N __pthread_setconcurrency
+-    FUNC GLOBAL DEFAULT   N __pthread_setschedparam
+-    FUNC   WEAK DEFAULT   N __pthread_setspecific
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_cancel
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_debug
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_restart
+-    FUNC GLOBAL DEFAULT   N __pthread_sigaction
+-    FUNC GLOBAL DEFAULT   N __pthread_sighandler
+-    FUNC GLOBAL DEFAULT   N __pthread_sighandler_rt
+-    FUNC GLOBAL DEFAULT   N __pthread_sigwait
+-  OBJECT GLOBAL DEFAULT   N __pthread_sizeof_handle
+-  OBJECT GLOBAL DEFAULT   N __pthread_smp_kernel
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_init
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_trylock
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_thread_self
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_debug
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_events
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_max
+-    FUNC GLOBAL DEFAULT   N __pthread_timedsuspend_new
+-    FUNC GLOBAL DEFAULT   N __pthread_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_wait_for_restart_signal
+-    FUNC GLOBAL DEFAULT   N __register_atfork
++    FUNC GLOBAL DEFAULT   N __pthread_key_create
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_init
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_lock
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_trylock
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_unlock
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_init
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_settype
++    FUNC GLOBAL DEFAULT   N __pthread_once
++    FUNC GLOBAL DEFAULT   N __pthread_register_cancel
++    FUNC GLOBAL DEFAULT   N __pthread_register_cancel_defer
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_init
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_rdlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_tryrdlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_trywrlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_unlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_wrlock
++    FUNC GLOBAL DEFAULT   N __pthread_setspecific
++    FUNC GLOBAL DEFAULT   N __pthread_unregister_cancel
++    FUNC GLOBAL DEFAULT   N __pthread_unregister_cancel_restore
++    FUNC GLOBAL DEFAULT   N __pthread_unwind
++    FUNC GLOBAL DEFAULT   N __pthread_unwind_next
++    FUNC   WEAK DEFAULT   N __pwrite64
++    FUNC   WEAK DEFAULT   N __read
++    FUNC GLOBAL DEFAULT UND __register_atfork
++    FUNC GLOBAL DEFAULT   N __res_state
++     TLS GLOBAL DEFAULT UND __resp
++    FUNC GLOBAL DEFAULT UND __sched_getparam
++    FUNC GLOBAL DEFAULT UND __sched_getscheduler
++    FUNC GLOBAL DEFAULT UND __sched_setscheduler
++    FUNC   WEAK DEFAULT   N __send
++    FUNC GLOBAL DEFAULT UND __setmntent
+     FUNC GLOBAL DEFAULT   N __sigaction
+-  OBJECT GLOBAL DEFAULT   N __sighandler
+-  NOTYPE GLOBAL DEFAULT ABS _edata
+-  NOTYPE GLOBAL DEFAULT ABS _end
+-    FUNC GLOBAL DEFAULT   N _fini
+-    FUNC GLOBAL DEFAULT   N _init
++    FUNC GLOBAL DEFAULT UND __statfs
++    FUNC GLOBAL DEFAULT UND __sysconf
++    FUNC GLOBAL DEFAULT UND __tls_get_addr
++  OBJECT GLOBAL DEFAULT UND __vdso_clock_gettime
++    FUNC GLOBAL DEFAULT   N __vfork
++    FUNC   WEAK DEFAULT   N __wait
++    FUNC   WEAK DEFAULT   N __write
++    FUNC GLOBAL DEFAULT UND _dl_allocate_tls
++    FUNC GLOBAL DEFAULT UND _dl_allocate_tls_init
++    FUNC GLOBAL DEFAULT UND _dl_deallocate_tls
++    FUNC GLOBAL DEFAULT UND _dl_get_tls_static_info
++    FUNC GLOBAL DEFAULT UND _dl_make_stack_executable
++    FUNC GLOBAL DEFAULT UND _exit
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_pop
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_pop_restore
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_push
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_push_defer
+-    FUNC GLOBAL DEFAULT   N compare_and_swap_is_available
+-    FUNC GLOBAL DEFAULT   N get_eflags
++  OBJECT GLOBAL DEFAULT UND _rtld_global
++    FUNC GLOBAL DEFAULT UND _setjmp
++    FUNC GLOBAL DEFAULT UND abort
++    FUNC   WEAK DEFAULT   N accept
++    FUNC GLOBAL DEFAULT UND calloc
++    FUNC   WEAK DEFAULT   N close
++    FUNC   WEAK DEFAULT   N connect
++     TLS GLOBAL DEFAULT UND errno
++    FUNC GLOBAL DEFAULT UND exit
++    FUNC GLOBAL DEFAULT UND fclose
++    FUNC   WEAK DEFAULT   N fcntl
++    FUNC   WEAK DEFAULT   N flockfile
++    FUNC GLOBAL DEFAULT UND fopen
++    FUNC GLOBAL DEFAULT   N fork
++    FUNC GLOBAL DEFAULT UND free
++    FUNC   WEAK DEFAULT   N fsync
++    FUNC   WEAK DEFAULT   N ftrylockfile
++    FUNC   WEAK DEFAULT   N funlockfile
++    FUNC GLOBAL DEFAULT UND getrlimit
++     TLS GLOBAL DEFAULT UND h_errno
++    FUNC GLOBAL DEFAULT UND link
+     FUNC GLOBAL DEFAULT   N longjmp
++    FUNC   WEAK DEFAULT   N lseek
++    FUNC   WEAK DEFAULT   N lseek64
++    FUNC GLOBAL DEFAULT UND malloc
++    FUNC GLOBAL DEFAULT UND memcpy
++    FUNC GLOBAL DEFAULT UND mempcpy
++    FUNC GLOBAL DEFAULT UND memset
++    FUNC GLOBAL DEFAULT UND mktemp
++    FUNC GLOBAL DEFAULT UND mmap
++    FUNC GLOBAL DEFAULT UND mprotect
++    FUNC   WEAK DEFAULT   N msync
++    FUNC GLOBAL DEFAULT UND munmap
++    FUNC   WEAK DEFAULT   N nanosleep
++    FUNC   WEAK DEFAULT   N open
++    FUNC   WEAK DEFAULT   N open64
++    FUNC   WEAK DEFAULT   N pause
++    FUNC   WEAK DEFAULT   N pread
++    FUNC   WEAK DEFAULT   N pread64
++    FUNC GLOBAL DEFAULT   N pthread_atfork
+     FUNC GLOBAL DEFAULT   N pthread_attr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_attr_getaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_attr_getdetachstate
+-    FUNC   WEAK DEFAULT   N pthread_attr_getguardsize
++    FUNC GLOBAL DEFAULT   N pthread_attr_getguardsize
+     FUNC GLOBAL DEFAULT   N pthread_attr_getinheritsched
+     FUNC GLOBAL DEFAULT   N pthread_attr_getschedparam
+     FUNC GLOBAL DEFAULT   N pthread_attr_getschedpolicy
+     FUNC GLOBAL DEFAULT   N pthread_attr_getscope
+-    FUNC   WEAK DEFAULT   N pthread_attr_getstack
+-    FUNC   WEAK DEFAULT   N pthread_attr_getstacksize
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstack
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstackaddr
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstacksize
+     FUNC GLOBAL DEFAULT   N pthread_attr_init
++    FUNC GLOBAL DEFAULT   N pthread_attr_setaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_attr_setdetachstate
+-    FUNC   WEAK DEFAULT   N pthread_attr_setguardsize
++    FUNC GLOBAL DEFAULT   N pthread_attr_setguardsize
+     FUNC GLOBAL DEFAULT   N pthread_attr_setinheritsched
+     FUNC GLOBAL DEFAULT   N pthread_attr_setschedparam
+     FUNC GLOBAL DEFAULT   N pthread_attr_setschedpolicy
+     FUNC GLOBAL DEFAULT   N pthread_attr_setscope
+-    FUNC   WEAK DEFAULT   N pthread_attr_setstack
+-    FUNC   WEAK DEFAULT   N pthread_attr_setstacksize
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstack
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstackaddr
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstacksize
+     FUNC GLOBAL DEFAULT   N pthread_barrier_destroy
+     FUNC GLOBAL DEFAULT   N pthread_barrier_init
+     FUNC GLOBAL DEFAULT   N pthread_barrier_wait
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_barrierattr_getpshared
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_init
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_cancel
+@@ -193,36 +178,49 @@
+     FUNC GLOBAL DEFAULT   N pthread_cond_timedwait
+     FUNC GLOBAL DEFAULT   N pthread_cond_wait
+     FUNC GLOBAL DEFAULT   N pthread_condattr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_condattr_getclock
+     FUNC GLOBAL DEFAULT   N pthread_condattr_getpshared
+     FUNC GLOBAL DEFAULT   N pthread_condattr_init
++    FUNC GLOBAL DEFAULT   N pthread_condattr_setclock
+     FUNC GLOBAL DEFAULT   N pthread_condattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_create
+     FUNC GLOBAL DEFAULT   N pthread_detach
+     FUNC GLOBAL DEFAULT   N pthread_equal
+     FUNC GLOBAL DEFAULT   N pthread_exit
++    FUNC GLOBAL DEFAULT   N pthread_getaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_getattr_np
+-    FUNC   WEAK DEFAULT   N pthread_getconcurrency
++    FUNC GLOBAL DEFAULT   N pthread_getconcurrency
++    FUNC GLOBAL DEFAULT   N pthread_getcpuclockid
+     FUNC GLOBAL DEFAULT   N pthread_getschedparam
+     FUNC GLOBAL DEFAULT   N pthread_getspecific
+     FUNC GLOBAL DEFAULT   N pthread_join
+     FUNC GLOBAL DEFAULT   N pthread_key_create
+     FUNC GLOBAL DEFAULT   N pthread_key_delete
+     FUNC GLOBAL DEFAULT   N pthread_kill
+-    FUNC   WEAK DEFAULT   N pthread_kill_other_threads_np
++    FUNC GLOBAL DEFAULT   N pthread_kill_other_threads_np
++    FUNC GLOBAL DEFAULT   N pthread_mutex_consistent_np
+     FUNC GLOBAL DEFAULT   N pthread_mutex_destroy
++    FUNC GLOBAL DEFAULT   N pthread_mutex_getprioceiling
+     FUNC GLOBAL DEFAULT   N pthread_mutex_init
+     FUNC GLOBAL DEFAULT   N pthread_mutex_lock
++    FUNC GLOBAL DEFAULT   N pthread_mutex_setprioceiling
+     FUNC GLOBAL DEFAULT   N pthread_mutex_timedlock
+     FUNC GLOBAL DEFAULT   N pthread_mutex_trylock
+     FUNC GLOBAL DEFAULT   N pthread_mutex_unlock
+     FUNC GLOBAL DEFAULT   N pthread_mutexattr_destroy
+     FUNC   WEAK DEFAULT   N pthread_mutexattr_getkind_np
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_getpshared
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_gettype
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getprioceiling
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getprotocol
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getpshared
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getrobust_np
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_gettype
+     FUNC GLOBAL DEFAULT   N pthread_mutexattr_init
+     FUNC   WEAK DEFAULT   N pthread_mutexattr_setkind_np
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_setpshared
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_settype
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setprioceiling
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setprotocol
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setpshared
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setrobust_np
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_settype
+     FUNC GLOBAL DEFAULT   N pthread_once
+     FUNC GLOBAL DEFAULT   N pthread_rwlock_destroy
+     FUNC GLOBAL DEFAULT   N pthread_rwlock_init
+@@ -240,27 +238,35 @@
+     FUNC GLOBAL DEFAULT   N pthread_rwlockattr_setkind_np
+     FUNC GLOBAL DEFAULT   N pthread_rwlockattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_self
++    FUNC GLOBAL DEFAULT   N pthread_setaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_setcancelstate
+     FUNC GLOBAL DEFAULT   N pthread_setcanceltype
+-    FUNC   WEAK DEFAULT   N pthread_setconcurrency
+-    FUNC GLOBAL DEFAULT   N pthread_setegid_np
+-    FUNC GLOBAL DEFAULT   N pthread_seteuid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setgid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setregid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setresgid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setresuid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setreuid_np
++    FUNC GLOBAL DEFAULT   N pthread_setconcurrency
+     FUNC GLOBAL DEFAULT   N pthread_setschedparam
++    FUNC GLOBAL DEFAULT   N pthread_setschedprio
+     FUNC GLOBAL DEFAULT   N pthread_setspecific
+-    FUNC GLOBAL DEFAULT   N pthread_setuid_np
+     FUNC GLOBAL DEFAULT   N pthread_sigmask
+-    FUNC   WEAK DEFAULT   N pthread_spin_destroy
+-    FUNC   WEAK DEFAULT   N pthread_spin_init
+-    FUNC   WEAK DEFAULT   N pthread_spin_lock
+-    FUNC   WEAK DEFAULT   N pthread_spin_trylock
+-    FUNC   WEAK DEFAULT   N pthread_spin_unlock
++    FUNC GLOBAL DEFAULT   N pthread_spin_destroy
++    FUNC GLOBAL DEFAULT   N pthread_spin_init
++    FUNC GLOBAL DEFAULT   N pthread_spin_lock
++    FUNC GLOBAL DEFAULT   N pthread_spin_trylock
++    FUNC GLOBAL DEFAULT   N pthread_spin_unlock
+     FUNC GLOBAL DEFAULT   N pthread_testcancel
++    FUNC GLOBAL DEFAULT   N pthread_timedjoin_np
++    FUNC GLOBAL DEFAULT   N pthread_tryjoin_np
++    FUNC GLOBAL DEFAULT   N pthread_yield
++    FUNC   WEAK DEFAULT   N pwrite
++    FUNC   WEAK DEFAULT   N pwrite64
+     FUNC GLOBAL DEFAULT   N raise
++    FUNC   WEAK DEFAULT   N read
++    FUNC GLOBAL DEFAULT UND realloc
++    FUNC   WEAK DEFAULT   N recv
++    FUNC   WEAK DEFAULT   N recvfrom
++    FUNC   WEAK DEFAULT   N recvmsg
++    FUNC GLOBAL DEFAULT UND sched_get_priority_max
++    FUNC GLOBAL DEFAULT UND sched_get_priority_min
++    FUNC GLOBAL DEFAULT UND sched_setparam
++    FUNC GLOBAL DEFAULT UND sched_yield
+     FUNC GLOBAL DEFAULT   N sem_close
+     FUNC GLOBAL DEFAULT   N sem_destroy
+     FUNC GLOBAL DEFAULT   N sem_getvalue
+@@ -271,8 +277,23 @@
+     FUNC GLOBAL DEFAULT   N sem_trywait
+     FUNC GLOBAL DEFAULT   N sem_unlink
+     FUNC GLOBAL DEFAULT   N sem_wait
+-    FUNC GLOBAL DEFAULT   N set_eflags
+-    FUNC GLOBAL DEFAULT   N sigaction
+-    FUNC GLOBAL DEFAULT   N siglongjmp
+-    FUNC GLOBAL DEFAULT   N sigwait
+-    FUNC GLOBAL DEFAULT   N testandset
++    FUNC   WEAK DEFAULT   N send
++    FUNC   WEAK DEFAULT   N sendmsg
++    FUNC   WEAK DEFAULT   N sendto
++    FUNC   WEAK DEFAULT   N sigaction
++    FUNC   WEAK DEFAULT   N siglongjmp
++    FUNC   WEAK DEFAULT   N sigwait
++    FUNC GLOBAL DEFAULT UND sscanf
++    FUNC GLOBAL DEFAULT UND strcmp
++    FUNC GLOBAL DEFAULT UND strlen
++    FUNC GLOBAL DEFAULT   N system
++    FUNC   WEAK DEFAULT   N tcdrain
++    FUNC GLOBAL DEFAULT UND tdelete
++    FUNC GLOBAL DEFAULT UND tfind
++    FUNC GLOBAL DEFAULT UND tsearch
++    FUNC GLOBAL DEFAULT UND twalk
++    FUNC GLOBAL DEFAULT UND unlink
++    FUNC   WEAK DEFAULT   N vfork
++    FUNC   WEAK DEFAULT   N wait
++    FUNC   WEAK DEFAULT   N waitpid
++    FUNC   WEAK DEFAULT   N write
+
+
+And uclibc_unrefd.lst is:
+
+__compare_and_swap
+__flockfilelist
+__fresetlockfiles
+__funlockfilelist
+__linuxthreads_create_event
+__linuxthreads_death_event
+__linuxthreads_initial_report_events
+__linuxthreads_pthread_key_2ndlevel_size
+__linuxthreads_pthread_keys_max
+__linuxthreads_pthread_sizeof_descr
+__linuxthreads_pthread_threads_max
+__linuxthreads_reap_event
+__linuxthreads_version
+__pthread_alt_lock
+__pthread_alt_timedlock
+__pthread_alt_unlock
+__pthread_attr_destroy
+__pthread_attr_getdetachstate
+__pthread_attr_getguardsize
+__pthread_attr_getinheritsched
+__pthread_attr_getschedparam
+__pthread_attr_getschedpolicy
+__pthread_attr_getscope
+__pthread_attr_getstack
+__pthread_attr_getstacksize
+__pthread_attr_init
+__pthread_attr_setdetachstate
+__pthread_attr_setguardsize
+__pthread_attr_setinheritsched
+__pthread_attr_setschedparam
+__pthread_attr_setschedpolicy
+__pthread_attr_setscope
+__pthread_attr_setstack
+__pthread_attr_setstacksize
+__pthread_barrierattr_getpshared
+__pthread_compare_and_swap
+__pthread_cond_broadcast
+__pthread_cond_destroy
+__pthread_cond_init
+__pthread_cond_signal
+__pthread_cond_timedwait
+__pthread_cond_wait
+__pthread_condattr_destroy
+__pthread_condattr_init
+__pthread_create
+__pthread_destroy_specifics
+__pthread_do_exit
+__pthread_equal
+__pthread_exit_code
+__pthread_exit_requested
+__pthread_find_self
+__pthread_functions
+__pthread_getconcurrency
+__pthread_getschedparam
+__pthread_getspecific
+__pthread_handles
+__pthread_handles_num
+__pthread_has_cas
+__pthread_init_max_stacksize
+__pthread_initial_thread
+__pthread_initial_thread_bos
+__pthread_initialize_manager
+__pthread_internal_tsd_address
+__pthread_internal_tsd_get
+__pthread_internal_tsd_set
+__pthread_key_create
+__pthread_kill_other_threads_np
+__pthread_last_event
+__pthread_lock
+__pthread_main_thread
+__pthread_manager
+__pthread_manager_adjust_prio
+__pthread_manager_event
+__pthread_manager_reader
+__pthread_manager_request
+__pthread_manager_sighandler
+__pthread_manager_thread
+__pthread_manager_thread_bos
+__pthread_manager_thread_tos
+__pthread_max_stacksize
+__pthread_mutex_destroy
+__pthread_mutex_timedlock
+__pthread_mutexattr_destroy
+__pthread_mutexattr_getkind_np
+__pthread_mutexattr_getpshared
+__pthread_mutexattr_gettype
+__pthread_mutexattr_init
+__pthread_mutexattr_setkind_np
+__pthread_mutexattr_setpshared
+__pthread_mutexattr_settype
+__pthread_nonstandard_stacks
+__pthread_null_sighandler
+__pthread_offsetof_descr
+__pthread_offsetof_pid
+__pthread_once_fork_child
+__pthread_once_fork_parent
+__pthread_once_fork_prepare
+__pthread_perform_cleanup
+__pthread_raise
+__pthread_reset_main_thread
+__pthread_restart_new
+__pthread_rwlock_destroy
+__pthread_rwlock_init
+__pthread_rwlock_rdlock
+__pthread_rwlock_timedrdlock
+__pthread_rwlock_timedwrlock
+__pthread_rwlock_tryrdlock
+__pthread_rwlock_trywrlock
+__pthread_rwlock_unlock
+__pthread_rwlock_wrlock
+__pthread_rwlockattr_destroy
+__pthread_self
+__pthread_setcancelstate
+__pthread_setcanceltype
+__pthread_setconcurrency
+__pthread_setschedparam
+__pthread_setspecific
+__pthread_sig_cancel
+__pthread_sig_debug
+__pthread_sig_restart
+__pthread_sigaction
+__pthread_sighandler
+__pthread_sighandler_rt
+__pthread_sigwait
+__pthread_sizeof_handle
+__pthread_smp_kernel
+__pthread_spin_destroy
+__pthread_spin_init
+__pthread_spin_lock
+__pthread_spin_trylock
+__pthread_spin_unlock
+__pthread_thread_self
+__pthread_threads_debug
+__pthread_threads_events
+__pthread_threads_max
+__pthread_timedsuspend_new
+__pthread_unlock
+__pthread_wait_for_restart_signal
+__register_atfork
+__sigaction
+__sighandler
+compare_and_swap_is_available
+get_eflags
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_attr_getstacksize
+pthread_attr_setguardsize
+pthread_attr_setstack
+pthread_attr_setstacksize
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_barrier_wait
+pthread_barrierattr_destroy
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_cancel
+pthread_condattr_getpshared
+pthread_condattr_setpshared
+pthread_create
+pthread_detach
+pthread_getattr_np
+pthread_getconcurrency
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_kill_other_threads_np
+pthread_mutex_timedlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getkind_np
+pthread_mutexattr_getpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setkind_np
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_timedrdlock
+pthread_rwlock_timedwrlock
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_getkind_np
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_init
+pthread_rwlockattr_setkind_np
+pthread_rwlockattr_setpshared
+pthread_setconcurrency
+pthread_setegid_np
+pthread_seteuid_np
+pthread_setgid_np
+pthread_setregid_np
+pthread_setresgid_np
+pthread_setresuid_np
+pthread_setreuid_np
+pthread_setspecific
+pthread_setuid_np
+pthread_sigmask
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_testcancel
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+set_eflags
+testandset
diff --git a/ap/build/uClibc/docs/sigaction.txt b/ap/build/uClibc/docs/sigaction.txt
new file mode 100644
index 0000000..667eeba
--- /dev/null
+++ b/ap/build/uClibc/docs/sigaction.txt
@@ -0,0 +1,249 @@
+	All what you never wanted to know about sigaction(),
+	struct sigaction, and sigset_t.
+
+
+Before vda started messing with sigset_t, struct sigaction
+and sigaction() functions, things looked this way:
+
+
+	Structures
+
+MIPS:
+
+Ignoring bogus "#if defined(__mips__) ..." block in
+libc/sysdeps/linux/common/bits/kernel_sigaction.h
+and using
+libc/sysdeps/linux/mips/bits/kernel_sigaction.h
+as an authoritative source:
+
+HAVE_SA_RESTORER is #defined
+struct old_kernel_sigaction {
+        unsigned      sa_flags;
+        sighandler_t  k_sa_handler;
+        unsigned long sa_mask;
+        unsigned      pad0[3]; /* reserved, keep size constant */
+        /* Abi says here follows reserved int[2] */
+        void          (*sa_restorer)(void);
+#if (_MIPS_SZPTR < 64)
+        /* For 32 bit code we have to pad struct sigaction to get
+         * constant size for the ABI */
+        int           pad1[1]; /* reserved */
+#endif
+};
+struct kernel_sigaction {
+        unsigned int  sa_flags;
+        sighandler_t  k_sa_handler;
+        kernel_sigset_t sa_mask;
+        void          (*sa_restorer)(void);
+        int           s_resv[1]; /* reserved */
+};
+struct sigaction {
+	unsigned      sa_flags;
+	sighandler_t  sa_handler;
+	sigset_t      sa_mask;
+	/* The ABI says here are two unused ints following. */
+	/* Restore handler.  */
+	void          (*sa_restorer)(void);
+#if _MIPS_SZPTR < 64
+	int           sa_resv[1];
+#endif
+};
+
+IA64:
+
+Has no old_sigaction. What a relief.
+
+struct kernel_sigaction {
+        sighandler_t  k_sa_handler;
+        unsigned long sa_flags;
+        sigset_t      sa_mask;
+};
+struct sigaction {
+	sighandler_t  sa_handler;
+	unsigned long sa_flags;
+	sigset_t      sa_mask;
+};
+
+Alpha:
+
+struct old_kernel_sigaction {
+	sighandler_t  k_sa_handler;
+	unsigned long sa_mask;
+	unsigned      sa_flags;
+};
+struct kernel_sigaction {
+	sighandler_t  k_sa_handler;
+	unsigned      sa_flags;
+	sigset_t      sa_mask;
+};
+struct sigaction {
+	sighandler_t  sa_handler;
+	sigset_t      sa_mask;
+	unsigned      sa_flags;
+};
+
+HPPA:
+
+struct kernel_sigaction {
+	sighandler_t  k_sa_handler;
+	unsigned long sa_flags;
+	sigset_t      sa_mask;
+};
+struct sigaction {
+	sighandler_t  sa_handler;
+	unsigned long sa_flags;
+	sigset_t      sa_mask;
+};
+
+The rest, kernel side:
+
+HAVE_SA_RESTORER #defined
+struct old_kernel_sigaction {
+	sighandler_t  k_sa_handler;
+	unsigned long sa_mask;
+	unsigned long sa_flags;
+	void          (*sa_restorer)(void);
+};
+struct kernel_sigaction {
+	sighandler_t  k_sa_handler;
+	unsigned long sa_flags;
+	void          (*sa_restorer)(void);
+	sigset_t      sa_mask;
+};
+
+On userspace side, Sparc has special struct sigaction:
+
+struct sigaction {
+	sighandler_t  sa_handler;
+	sigset_t      sa_mask;
+	unsigned long sa_flags;
+	void          (*sa_restorer)(void); /* Not used by Linux/Sparc */
+};
+
+And finally the rest has:
+
+struct sigaction {
+	sighandler_t  sa_handler;
+	sigset_t      sa_mask;
+	int           sa_flags;
+	void          (*sa_restorer)(void);
+};
+
+Userspace sigset_t was uniformly defined as vector of longs
+big enough to hold 1024 (!) bits - carried over from glibc.
+Since the only arch whose struct kernel_sigaction contains sa_mask
+not as a last member is MIPS, MIPS has special kernel_sigset_t,
+which is an array of longs long enough for 128 bits.
+Other arches still used userspace sigset_t in struct kernel_sigaction,
+but it did not really matter because overlong kernel_sigaction
+does not hurt in sigaction() [explained below].
+On kernel side, all arches define _NSIG to 65 (meaning
+there are 64 signals, 1..64) except MIPS, which define it to 129.
+
+
+	Functions
+
+sigaction() [libc function] usually has two kernel_sigaction's
+on stack and copy (userspace) struct sigaction members into
+first one, executes syscall, then pulls out the result from
+second one. This accomodates differences in layouts of structs.
+
+The only typically present quirk is what to do with sa_restorer.
+
+    libc/sysdeps/linux/arm/sigaction.c
+
+if HAVE_SA_RESTORER and (sa_flags & SA_RESTORER) is not set,
+sets sa_restorer to
+(flags & SA_SIGINFO) ? __default_rt_sa_restorer : __default_sa_restorer,
+and sets SA_RESTORER,
+otherwise passes it as-is. Which is kinda strange, because AFAICS
+HAVE_SA_RESTORER is *not* defined for ARM.
+
+    libc/sysdeps/linux/i386/sigaction.c
+
+Forcibly sets SA_RESTORER and sa_restorer:
+kact.sa_flags = act->sa_flags | SA_RESTORER;
+kact.sa_restorer = ((act->sa_flags & SA_SIGINFO) ? &restore_rt : &restore);
+
+    libc/sysdeps/linux/x86_64/sigaction.c
+
+Forcibly sets SA_RESTORER and sa_restorer:
+kact.sa_flags = act->sa_flags | SA_RESTORER;
+kact.sa_restorer = &restore_rt;
+
+    libc/sysdeps/linux/mips/sigaction.c
+
+# ifdef HAVE_SA_RESTORER
+#  if _MIPS_SIM == _ABIO32
+                kact.sa_restorer = act->sa_restorer;
+#  else
+                kact.sa_restorer = &restore_rt;
+#  endif
+# endif
+No confusion here, HAVE_SA_RESTORER is #defined for MIPS
+
+    libc/sysdeps/linux/avr32/sigaction.c
+
+if (kact.sa_flags & SA_RESTORER) {
+        kact.sa_restorer = act->sa_restorer;
+} else {
+        kact.sa_restorer = __default_rt_sa_restorer;
+	kact.sa_flags |= SA_RESTORER;
+}
+Does not check HAVE_SA_RESTORER, but avr32 falls
+in "completely ordinary" category on both kernel and
+userspace sides, and those have it defined.
+
+    libc/sysdeps/linux/xtensa/sigaction.c
+
+if (kact.sa_flags & SA_RESTORER) {
+        kact.sa_restorer = act->sa_restorer;
+} else {
+        kact.sa_restorer = __default_sa_restorer;
+	kact.sa_flags |= SA_RESTORER;
+}
+Thus, similar to avr32.
+
+    libc/signal/sigaction.c (i.e. the all other arches)
+
+# ifdef HAVE_SA_RESTORER
+        kact.sa_restorer = act->sa_restorer;
+# endif
+Plain translation, just sa_restorer copy is protected
+by HAVE_SA_RESTORER #define check. Looks like here
+HAVE_SA_RESTORER will be undef'ed only for IA64,
+Alpha an HPPA.
+
+
+	Proposed overhaul past 0.9.30
+
+Since we can define libc-side structures at will:
+make sigset_t and struct sigaction identical on kernel side and libc side
+within each arch. If arches do not need special handling of sa_restorer,
+then sigaction() can directly use passed struct sigaction as-is.
+Otherwise, a copy is still needed, although sigaction() might have
+just one struct kernel_sigaction on stack and use it both for passing
+data to kernel and for receiving it back. Might save a few bytes.
+
+To this effect:
+
+* Make sigset_t size match kernel side on all arches.
+  This is easy since all arches have 64 signals and only MIPS has 128.
+
+* Modify libc/sysdeps/linux/$ARCH/bits/sigaction.h
+  so that its struct sigaction matches kernel's. If sa_restorer
+  field is present in libc but is missing in kernel_sigaction,
+  add it at the bottom in order to not mess up kernel_sigaction layout.
+
+* Modify libc/sysdeps/linux/$ARCH/sigaction.c
+  to implement the logic above. In "common" pseudo-arch
+  (libc/signal/sigaction.c file),
+  we would not even need to do any copying, as described above.
+
+* Document discovered arch quirks while debugging this mess.
+
+* struct old_kernel_sigaction can't be disposed of in a similar way,
+  we need to have userspace struct sigaction unchanged regardless
+  whether we use "old" or "new" kernel sigaction() syscall.
+  It's moot anyway because "old" one is long unused, it's from
+  pre-2.2 kernels.
diff --git a/ap/build/uClibc/docs/threads.txt b/ap/build/uClibc/docs/threads.txt
new file mode 100644
index 0000000..182f1be
--- /dev/null
+++ b/ap/build/uClibc/docs/threads.txt
@@ -0,0 +1,56 @@
+uClibc thread-safety analysis
+
+Things that are still known to be needed for thread safety:
+
+        none
+
+
+
+
+Things that might be nice, but are not required:
+
+        getnetent_r             <desired, but not required for SuSv3>
+        gethostent_r            <desired, but not required for SuSv3>
+        getprotoent_r           <desired, but not required for SuSv3>
+        getnetbyname_r          <desired, but not required for SuSv3>
+        getnetbyaddr_r          <desired, but not required for SuSv3>
+
+
+
+
+
+Functions that use static data and may still need locking:
+
+
+        --------------------------------------------------------------------
+
+        libc/inet/rpc/rpc_thread.c:
+
+        __rpc_thread_variables is currently disabled, since thread
+        local storage seems to not be correctly specified as 
+        weak functions.
+
+        --------------------------------------------------------------------
+
+        unistd/getpass.c:
+
+        static char buf[PWD_BUFFER_SIZE];
+
+        getpass                 <fix required>                          <---
+
+        NOTE: This function returns a pointer to a static data structure.
+        This seems like it requires an _r version of this function.  Glibc
+        does the same thing.  Oops!  So much for thread-safe glibc!
+
+        --------------------------------------------------------------------
+
+        unistd/sysconf.c:
+
+        static long int ret_vals[_UCLIBC_SYSCONF_NUM_VALID_ARGS];
+
+        find_or_add_in_table    <fix required?>                         <---
+        main                    <fix required?>                         <---
+
+        NOTE: I'm not sure if this needs to be made reentrant...
+
+        --------------------------------------------------------------------
diff --git a/ap/build/uClibc/docs/uClibc_vs_SuSv3.txt b/ap/build/uClibc/docs/uClibc_vs_SuSv3.txt
new file mode 100644
index 0000000..a5a9dcd
--- /dev/null
+++ b/ap/build/uClibc/docs/uClibc_vs_SuSv3.txt
@@ -0,0 +1,105 @@
+uClibc attempts to fully (and rigorously) support "The Open Group Base
+Specifications Issue 6 IEEE Std 1003.1, 2003 Edition" (aka SuSv3).  However, as
+with any standard, they sometimes require things that are either impossible or
+are Completely Stupid(tm).  Therefore, we cannot claim full compliance, and
+there may be some areas of uClibc that differ from the requirements of this
+specification.  This document attempts to list these differences and, when
+completed, will contain a full list of all relevant differences between uClibc
+and the requirements of the SuSv3.
+
+
+*) The uClibc setlocale() function is not threadsafe.
+
+    SuSv3 states that "The locale state is common to all threads
+    within a process.".  But it does not explicitly mention
+    setlocale() as a function that need not be thread-safe.
+    Making setlocale() threadsafe would require an absurd amount
+    of locking (i.e. inside each and every ctype call such as
+    isalpha()).  Furthermore, we consider calling setlocale()
+    from N threads concurrently while using string functions to
+    be a terribly dumb thing to do.  Therefore, we have decided
+    that setlocale() shall not be threadsafe.  If you are
+    multi-threaded, and you wish to change the global locale
+    state, please take care to prevent all other threads from
+    using any locale or ctype functions until the setlocale()
+    call has finished.
+
+
+
+
+----------------------------------------------------------------
+heukelum -- heukelum at freemail dot nl writes:
+
+Hi everyone,
+
+I think uClibc is a great project! And, since I found the file
+docs/uClibc_vs_SuSv3.txt in the source tarball which mentioned only
+fmtmsg as a missing function compared to the SUSv3, I got curious about
+the length of the list denoted by "<others?>". So I built the
+20040305-snapshot using allyesconfig, extracted the symbols from the
+(dynamic) libraries, and compared that list to the SUSv3 header files...
+
+The largest source of omissions was the mathematical interface
+(183/355), followed by optional interfaces (134/355). The result: only
+38 non-mathematical interfaces are missing compared to the minimal
+SUSv3! Naming only one function as missing was over-enthousiastic, but
+the result was better than I anticipated.
+
+A compact list of omissions is appended.
+I hope this was a helpful exercise ;)
+
+Greetings,
+         Alexander
+
+P.S. uClibc was compiled with thread support, but did not provide the
+interfaces pthread_cleanup_push and pthread_cleanup_pop.
+
+
+
+Omissions from obligatory interfaces:
+-------------------------------------
+stdlib.h: _Exit, lcong48, lldiv, posix_openpt;
+          ecvt, fcvt
+ndbm.h: [all=9] dbm_*
+utmpx.h: [all=6] *utx* (but functions without "x" do exist!)
+nl_types.h: [all] catclose, catgets, catopen
+unistd.h: getwd, ualarm
+inttypes.h: imaxdiv
+fmtmsg.h: fmtmsg
+string.h: strerror_r
+setjmp.h: setsigjmp
+monetary.h: strfmon
+sys/select.h: pselect
+sys/socket.h: sockatmark
+sys/wait.h: waitid
+
+
+Unimplemented optional interfaces:
+----------------------------------
+trace.h: (depends on TRC) [all=50] posix_trace_*
+pthread.h: (depends on THR) pthread_cleanup_{push,pop};
+         pthread_attr_{g,s}etstack (depend on TSA TSS);
+         [7] pthread_barrier* (depend on BAR);
+         pthread_condattr_{g,s}et_clock (depend on CS);
+         pthread_getcpuclockid (depends on TCT);
+         pthread_mutex{,attr}_{g,s}etprioceiling (depend on TPP);
+         pthread_mutexattr_{g,s}etprotocol (depend on TPP|TPI);
+         pthread_rwlock_timed{rd,rw}lock (depend on TMO);
+         pthread_setschedprio (depends on TPS);
+         [5] pthread_spin_* (depend on SPI)
+spawn.h: (depends on SPN) [all=21] posix_spawn*
+aio.h: (depends on AIO) [all=8] aio_*, lio_*
+stropts.h: (depends on XSR) isastream, {g,s}et{,p}msg, fattach, fdetach
+sys/mman.h: posix_madvice (depends on ADV); posix_mem_offset,
+         posix_typed_mem_getinfo, posix_typed_mem_open (depend on TYM);
+         shm_open, shm_unlink (depend on SHM)
+fcntl.h: posix_fallocate (depend on ADV)
+signal.h: sigqueue (depends on RTS)
+
+
+Unimplemented mathematical interfaces:
+--------------------------------------
+math.h: [126] many
+complex.h: [46] all, except cabs
+fenv.h: [11] all
+_______________________________________________
diff --git a/ap/build/uClibc/docs/wchar_and_locale.txt b/ap/build/uClibc/docs/wchar_and_locale.txt
new file mode 100644
index 0000000..976c9aa
--- /dev/null
+++ b/ap/build/uClibc/docs/wchar_and_locale.txt
@@ -0,0 +1,113 @@
+		User-configurable
+
+UCLIBC_HAS_CTYPE_TABLES
+	Make toupper etc work thru translation tables
+	and isalhum etc thru lookup tables. Help says:
+	"While the non-table versions are often smaller when building
+	statically linked apps, they work only in stub locale mode."
+
+	"stub locale mode" is when !UCLIBC_HAS_LOCALE I presume,
+	when we are permanently in POSIX/C locale.
+
+UCLIBC_HAS_CTYPE_SIGNED
+	Handle sign-extended chars. I.e. if you want
+	toupper((char)0xa0) => toupper(0xffffffa0) => still works correctly,
+	as if toupper(0xa0) was called.
+
+UCLIBC_HAS_CTYPE_UNSAFE/CHECKED/ENFORCED
+	Do not check ctype function argument's range/check it and return
+	error/check it and abort(). Help says:
+	NOTE: This only affects the 'ctype' _functions_.  It does not affect
+	the macro implementations. [so what happens to macros?]
+	[examples?]
+
+UCLIBC_HAS_WCHAR
+	Wide character support. I assume all those wchar_t types and functions
+
+UCLIBC_HAS_LOCALE/XLOCALE
+	Support locale / extended locale
+
+UCLIBC_PREGENERATED_LOCALE_DATA
+	Not recommended
+
+
+		uclibc internal machinery
+
+__LOCALE_C_ONLY
+	#defined if !UCLIBC_HAS_LOCALE
+
+__NO_CTYPE
+	#defined only by some .c files. Prevents ctype macros to be #defined
+	(those w/o underscores. __ctype() macros will still be defined).
+	Looks like user is expected to never mess with defining it.
+
+__UCLIBC_DO_XLOCALE
+	#defined only by some .c files. Looks like user is expected to never
+	mess with defining it.
+
+__XL_NPP(N) - "add _l suffix if locale support is on"
+	#defined to N ## _l if __UCLIBC_HAS_XLOCALE__ && __UCLIBC_DO_XLOCALE,
+	else #defined to just N.
+
+__CTYPE_HAS_8_BIT_LOCALES
+__CTYPE_HAS_UTF_8_LOCALES
+	Depends on contents of extra/locale/LOCALES data file. Looks like
+	both will be set if UCLIBC_HAS_LOCALE and extra/locale/LOCALES
+	is not edited.
+
+__WCHAR_ENABLED
+	locale_mmap.h defines it unconditionally, extra/locale/gen_ldc.c
+	defines it too with a warning, and _then_ includes locale_mmap.h.
+	Makefile seems to prevent the warning in gen_ldc.c:
+	ifeq ($(UCLIBC_HAS_WCHAR),y)
+	BUILD_CFLAGS-gen_wc8bit += -DDO_WIDE_CHAR=1
+	BUILD_CFLAGS-gen_ldc += -D__WCHAR_ENABLED=1
+	endif
+	A mess. Why they can't just use __UCLIBC_HAS_WCHAR__?
+
+__WCHAR_REPLACEMENT_CHAR
+	Never defined (dead code???)
+
+
+
+		Actual ctype macros are a bloody mess!
+
+__C_isspace(c), __C_tolower(c) et al
+	Defined in bits/uClibc_ctype.h. Non-locale-aware, unsafe
+	wrt multiple-evaluation, macros. Return unsigned int.
+
+__isspace(c), __tolower(c) et al
+	Defined in bits/uClibc_ctype.h. Non-locale-aware,
+	but safe wrt multiple-evaluation, macros. Return int.
+
+__isdigit_char, __isdigit_int
+	Visible only to uclibc code. ((unsigned char/int)((c) - '0') <= 9).
+
+_tolower(c), _toupper(c)
+	Even more unsafe versions (they just do | 0x20 or ^ 0x20). Sheesh.
+	They are mandated by POSIX so we must have them defined,
+	but I removed all uses in uclibc code. Half of them were buggy.
+
+isspace(c), tolower(c) et al
+	Declared as int isXXXX(int c) in bits/uClibc_ctype.h. Then,
+	if not C++ compile, defined as macros to __usXXXX(c)
+
+bits/uClibc_ctype.h is included by ctype.h only if !__UCLIBC_HAS_CTYPE_TABLES__.
+
+Otherwise, ctype.h declares int isXXXX(int c) functions,
+then defines macros for isXXXX(c), __isXXX(c), toXXXX(c).
+Surprisingly, there are no __toXXXX(c), but if __USE_EXTERN_INLINES,
+there are inlines (yes, not macros!) for toXXXX(c) functions,
+so those may have both inlines and macros!).
+It also defines "unsafe" _toXXXX macros.
+
+All in all, __isXXXX(c) and __toXXXXX(c) seem to be useless,
+they are full equivalents to non-underscored versions.
+Remove?
+
+Macro-ization of isXXX(c) for __UCLIBC_HAS_XLOCALE__ case is problematic:
+it is done by indexing: __UCLIBC_CTYPE_B[c], and in __UCLIBC_HAS_XLOCALE__
+case __UCLIBC_CTYPE_B is doing a __ctype_b_loc() call! We do not save
+function call! Thus, why not have dedicated optimized functions
+for each isXXXX() instead? Looking deeper, __ctype_b_loc() may have
+another lever of function calls inside! What a mess...