Re-export libgcc's __aeabi_uidivmod and __popcount_tab

This is required to make the Nexus 10 graphics driver work on a system
compiled with gcc 4.9.

Change-Id: If3f3d488652a736d9ea3e583548d74fae3ffa902
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
libm: sync with upstream freebsd

Summary:
New long double functions have been included,
but are not in use due to the android double long
handling. imprecise.c is not built for the same reason.

Test Plan: verified

Reviewers: randall.rushing

Differential Revision: http://review.codefirex.com/D232

Change-Id: I77f2b6e202dd500ed38d62edf187a5ac10b3002c
Signed-off-by: DHOMD <DHO@dho.im>
libm: add fmal long double stub

Summary:
This is needed in some target cases, and has since been fixed internally in the AOSP.

From enh@google.com regarding this change:
you were right, and this was the way we should have done it, but i didn't work that out until i fixed this in the same way as part of the aarch64 work (where the weak reference didn't work).

Test Plan: verified

Reviewers: randall.rushing, jriordan001, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D234

Change-Id: Ia57674b89e110a7fff4a90c534f67a6bbef57c68
Signed-off-by: DHOMD <DHO@dho.im>
Add all implicitly loaded symbols from libgcc.a into libgcc_compat.c.

Change-Id: I0e66a73e849a01817d016a688d7291c2fb604e48
Use arch-specific variable to set up the x86 ld flags.

Bug: 11654773
Change-Id: I9e9075bac1303cfa39b0f717dd74625ce1dd5fa5

Conflicts:
	libdl/Android.mk
Remove libthread_db from bionic.

The NDK statically links its own copy into gdb.

Bug: 11882807
Change-Id: I0c7ed8761c32df3cc3644258551bc7d2e263f47b

Conflicts:
	libthread_db/libthread_db.c
Fix 32-bit mmap/mmap64 handling of negative offsets.

We don't actually need to worry about sign extension if we reject
negative values ourselves. Previously it was possible to come up
with negative but aligned values that we would pass to the kernel;
in the case of mmap (as opposed to mmap64) we'd incorrectly turn
those into large positive offsets.

Change-Id: I2aa583e0f892d59bb77429aea8730b72db32dcb0

Conflicts:
	libc/bionic/mmap.cpp
	tests/Android.mk
bionic: Change the type of soinfo's size to size_t

Some system functions like munmap expect soinfo's size to be size_t, but currently
it is unsigned. Change it to size_t to fit 64bit's portability.

Change-Id: I0bf6d522b38b0cd9bf1db05b004b5326217412a2
Signed-off-by: Weiwu Chen <weiwu.chen@intel.com>
Signed-off-by: Qiming Shi <qiming.shi@intel.com>

Conflicts:
	linker/linker.cpp
	linker/linker.h
Remove a __system_property_get call from the DNS code.

Change-Id: I48082ad9eb1b56349c6746ab2c371728c8571a81
Fix pthread_test to work with gtest 1.7.0.

Now we're building it correctly configured, gtest takes a couple of
TLS slots for itself.

Change-Id: I1c2c4e9e5f9c6e2e2e6ecd1214cfc16a5af5afed

Conflicts:
	tests/pthread_test.cpp
libc: krait: support KINGFISHER optimized memcpy

When defined use the KINGFISHER optimized
cortex-a9 memcpy instead to improve performance.

Change-Id: Idcfb94cc1e10d8326d7a9e623baed91125d7caf6
Add arm <sys/ucontext.h>.

Change-Id: I14d435f9e3e82f77d8a7e886ff88c18f5d09d14a

Conflicts:
	libc/include/sys/ucontext.h
Make ARM <user.h> more glibc-compatible.

Change-Id: I681930ad7f80a5e7bc40eb0f36872e415445f0f9

Conflicts:
	libc/include/sys/user.h
libm: Squashed CAF sin/cos implementation for ARM NEON

Summary:
Bionic/libm: Add precision-correct de-serialize sin/cos.

Modify sin/cos to improve performance while retaining bit-for-bit
accuracy with existing algorithm.

Change-Id: Iaba2dd731cd015732744705dad8bddb713b43067
(cherry picked from commit df55e67573e176042c5d2ae084c758bc2e9e0025)
(cherry picked from commit 6a688d7aa4512731c430673ccd4f0d6e3999d439)
(cherry picked from commit 47bb7bc2962bff835000dca016f6319c20734398)

Bionic/libm: add assembly versions of sin/cos.

Add assembly versions of sin/cos with integrated remainder pi/2
calculation.  Directly extracted from binary libm.so compiled with
__ieee754_rem_pio2 calls inlined.

Change-Id: Ia093f420e58e794635e3a5f09e8236ae7601f1f6
(cherry picked from commit 19a356a1ed6384a9161739d5833cf5cfd88a8d3b)
(cherry picked from commit 1c9bdcfa6a68cd1a13a1e3b1a51616bddffeefad)
(cherry picked from commit cdaad8ab61325e958926b57a6a726d0cfa6f7511)

Bionic/libm: Remove extra vmov from sin/cos.

Move integer representations of x bits on the integer side rather
than moving them to and from the FP registers.

Change-Id: I1895db385c9616cdae9ab6403f392dfbae292adc
(cherry picked from commit 1d0c5a9fe67141515fa54403d985828590f9c206)
(cherry picked from commit ca46b68c30cf470464ffac530b8bdba242cc5c17)
(cherry picked from commit d7acb8827620ab7331995e843fd79015aed84996)

Test Plan: testing

Reviewers: jriordan001, randall.rushing, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D270

Conflicts:
	libm/Android.mk
	libm/upstream-freebsd/lib/msun/src/e_pow.c
	libm/upstream-freebsd/lib/msun/src/k_cos.c
	libm/upstream-freebsd/lib/msun/src/math_private.h
libm:also use optimized sqrt/sqrtf on ARM NEON

Summary: Depends on D270 and stacks on top. Fixed from initial patch that was reverted

Test Plan: verified

Reviewers: randall.rushing, jriordan001

Differential Revision: http://review.codefirex.com/D271

Conflicts:
	libm/arm/e_sqrt.S
	libm/arm/e_sqrtf.S
[ARM] libc: Improve how we set memcpy and memcmp flags

Summary: Check by cpu variant, and also that NEON_MEMCPY_ALIGNMENT_DIVIDER wasn't set elsewhere.

Test Plan: verified

Reviewers: randall.rushing, jriordan001

Differential Revision: http://review.codefirex.com/D275

Conflicts:
	libc/Android.mk
libc: counting, rounding, and min/max macros

Summary:
These macros are the same as in gnu libc
and bsd's sys/sys/param.h

Test Plan: verified, and used in aosp internally now from glibc set for new linux-perf building.

Reviewers: randall.rushing, jriordan001, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D314
[ARM] libm: Implement ARM NEON optimized modf

Summary: Based on the math-neon implementation (which is based on the clibm implementation).

Test Plan: Performs slightly better than the generic freebsd implementation. Verified here.

Reviewers: randall.rushing, jriordan001

Differential Revision: http://review.codefirex.com/D331
Revert "Revert "Remove harmful attempts to be helpful in pthread_mutex functions.""

This reverts commit 834c159cc7ed89314b0d8bf1916c7b4d9d18282f.