bionic: update and optimize from master and Linaro

fix broken pointer overflow check ns_name_unpack()

Many compilers optimize away the overflow check `msg + l < msg',
where `msg' is a pointer and `l' is an integer, because pointer
overflow is undefined behavior in C.

Use a safe precondition test `l >= eol - msg' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>

Fix the detection of alt-network in dns resolver.

Used to determine proper A/AAAA record request.

bug:10132565

Add ssse3 implementation of __memcmp16.

__memcmp16 was missing in x86. Also added C-version for backward
compatibility. Added bionic test for __memcmp16 and for wmemcmp.

Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>

Update kernel input headers

To upstream SHA e1c85813f3832b909d1c4309b213bb0a52c79ba5

Add more information to error due to truncated Elf32_Ehdr

don't hardcode register r0/v1 when reading the TLS

this leads to much improved code when calling __get_tls()

Change hard-coded temporary directory.

The properties tests creates a temporary directory in /data/nativetest,
but this directory might not exist in all circumstances.
Change this to create the temporary directory in /data/local/tmp.

Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.

tgkill() needs the .save stack unwinding directive to get the complete
stack trace.

BUG: https://code.google.com/p/android/issues/detail?id=16672

Add the dl_iterate_phdr function to libdl for arm.

Bug: 8410085

Merge from internal master.

(cherry-picked from cb491bc66dc0abc145930b09086eb9189a30f6c2)

Add bionic-unit-tests-run-on-host special target

Allows running the tests linked with bionic .so on the host if host and
target are compatible. See more comments and usage limitation inlined.

make bionic-unit-tests-run-on-host should do build and run.

Adjust includes in sincos() for their 4.3 paths

Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>

Make cpp.py less braindead.

The old code ignored operator precedence (!), despite having two tables
of operator precedence. The code's still pretty awful, but I've cleaned
it up enough to fix this, the most important bug.

This patch lets us correctly clean the uapi unistd.h, stat.h, and swab.h files,
and also fixes the mess we were already making of various old kernel
header files. I've added a bunch more tests, fixed the existing tests that
the existing script was already failing (!), and changed the script so that
the tests are run every time the script is run.

We can probably remove some of the old kernel header files that we were
parsing incorrectly, but we can worry about that later.

Bug: 11253477

Add processed uapi kernel headers for ARM.

Remove pathconf's dependencies on non-uapi header files.

Remove the dependency on the non-uapi __kernel_nlink_t.

The kernel doesn't have an nlink_t; it just uses the equivalent of
uint32_t. We already had a usable __nlink_t in the C library, so
let's just define our nlink_t in terms of __nlink_t, which is what
__nlink_t was meant for anyway.

Note that our struct stat just follows the kernel, and doesn't refer
to nlink_t anyway.

Add a temporary uapi/linux/compiler.h until upstream has one.

Bug: 11559337

Add extra regression tests for an already-fixed dynamic linker bug.

Bug: https://code.google.com/p/android/issues/detail?id=61799

Add a unit test for syscall(2).

Change-Id: If8bfcecb36e869dbd87fb60b386bf7c342070356