Revert "Detect userspace memory leak for JB_MR2"

This reverts commit 7317cba2f00831feeb68a3ffed77b142a72863a3.
__strnlen_chk: avoid recursive strlen calls

Don't use FORTIFY_SOURCE on functions which implement
FORTIFY_SOURCE.

Bug: 12216860
Change-Id: I61db1b47ccdd6bdcf41eab3303f4806494016199
bionic: call stdio cleanup on exit

As of 61e699a133a4807fe878a6cb0d7190d7c96e21f8, stdio clean up
functions are no longer registered in atexit and must be called
manually via __cleanup.

The issue this fixes is some static binaries linked against bionic
cannot output properly when piped or redirected because the buffer
is not flushed before closing.

This is done by pulling in exit.c (and other dependencies) from
netbsd.

Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22
Clean up more recursive FORTIFY_SOURCE calls

Don't use FORTIFY_SOURCE on functions which implement
FORTIFY_SOURCE, to avoid infinite recursion problems.

The previous patch only addressed one of the problems.

Bug: 12216860
Change-Id: I6f30ae7cb5b481be9942add18182ea4839d348a6
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>
[ARM NEON] libm: original optimized modf

Summary: Significantly faster than the generic C implementation

Test Plan: test on a device that had issues with libm neon based modf implementation.

Reviewers: anders3408, jriordan001, raymanfx, randall.rushing

Reviewed By: randall.rushing

CC: raymanfx

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

Conflicts:

	libm/Android.mk

Change-Id: I59902f8f194961316a7f525e511806baa7eb5232
Replace the bionic hack for a vfprintf leak with (roughly) the upstream fix.

Currently in bionic free and freedtoa are equivalent, but that's not true
of gdtoa. This makes it easier to test gdtoa without having to replace
everything. (Yes, I found this bug the hard way.)

Change-Id: I290823a2a0a83329def5f2719b349215ad0dbbde

Conflicts:
	libc/stdio/vfprintf.c
Workaround the GCC "(long)fn -> lfn" optimization bug.

Pass "-fno-builtin-rint -fno-builtin-rintl -fno-builtin-rintf" to avoid
generating self recursions in lrint, lrintl, and lrintf.

BUG: 14225968
Change-Id: Iffc4d8f0692580d636a529f4c8aa9a7a10d7acd8

Conflicts:
	libm/Android.mk
Add ARMv7 optimized string handling routines

Change-Id: Ib10f45d36a3bf61e4e0114305a58f4c7cfe5a843
cortex-a9: Integrate cortex-strings memcpy.

This version of memcpy, taken from cortex-strings revision 103, improves
performance over the existing implementation on the majority of copies.

Benchmarks and tests for this routine can be found as part of the
cortex-strings project on Launchpad:

https://launchpad.net/cortex-strings

Change-Id: I7f6f77995f3ca903ad9c66d14261441667a2a935
Signed-off-by: Will Newton <will.newton@linaro.org>
cortex-a9: Use ARMv7 optimization for strchr, strcpy and strlen

Change-Id: I1692db8d73cd698bc56eacab2d33597eb91e40d7