C++11 literal fix.
Move bionic over to GCC's 'warning' attribute.

This is a better solution than the old __warn_references because it's
a compile-time rather than link-time warning, it doesn't rely on something
that doesn't appear to be supported by gold (which is why you only used
to see these warnings on mips builds), and the errors refer to the exact
call site(s) rather than just telling you which object file contains a
reference to the bad function.

This is primarily so we can build bionic for aarch64; building libc.so
caused these warnings to fire (because link time is the wrong time) and
warnings are errors.

Change-Id: I5df9281b2a9d98b164a9b11807ea9472c6faa9e3
Update to tzdata2014d from AOSP master branch

Change-Id: I89169b20952ef3b200ddb83cb62be00b66d29efa
Upgrade to tzdata2014e.

From the release notes:

  Changes affecting near-future time stamps

    Egypt's 2014 Ramadan-based transitions are June 26 and July 31 at 24:00.
    (Thanks to Imed Chihi.)  Guess that from 2015 on Egypt will temporarily
    switch to standard time at 24:00 the last Thursday before Ramadan, and
    back to DST at 00:00 the first Friday after Ramadan.

    Similarly, Morocco's are June 28 at 03:00 and August 2 at 02:00. (Thanks
    to Milamber Space Network.)  Guess that from 2015 on Morocco will
    temporarily switch to standard time at 03:00 the last Saturday before
    Ramadan, and back to DST at 02:00 the first Saturday after Ramadan.

  Changes affecting past time stamps

    The abbreviation "MSM" (Moscow Midsummer Time) is now used instead of
    "MSD" for Moscow's double daylight time in summer 1921.  Also, a typo
    "VLASST" has been repaired to be "VLAST" for Vladivostok summer time
    in 1991.  (Thanks to Hank W. for reporting the problems.)

Change-Id: Iaca5e8c2d572559b464b10d24f4315405e413ada
Add __popcountsi2 to the function compat list.

This is needed if we use Clang to compile Bionic, which won't include
__popcountsi2 anymore as Clang generates inline instructions. However
prebuilt binary blobs still depend on libc.so to resolve __popcountsi2.

Change-Id: I9001a3884c4be250c0ceebcd79922783fae1a0b7
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>
Add all implicitly loaded symbols from libgcc.a into libgcc_compat.c.

Change-Id: I0e66a73e849a01817d016a688d7291c2fb604e48
Use __typeof__() instead of typeof()

typeof() is a gcc builtin and is not always available (such as clang when
-std=c*). Both gcc and clang always expose __typeof__(), so just use that.

Change-Id: I75e2a990acc35f6f39b2c353f6548100ec03c67f
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
Use __inline__ for fortify.

libunwind has #define inline /* empty */ which breaks our fortified headers.
glibc uses __inline but our BSD-derived headers often override that. __inline__
is the third alternative understood by GCC that -- as far as I know -- neither
the C library itself nor third-party code tries to mess with.

Bug: 12871594
Change-Id: I6677e70ea531bb7d4c46021b43af760d4ad8ecf7
Add "__noreturn" to assert and assert2

These functions should print assertion violation messages and then
call abort(). They do really not return control flow afterwards.
Consider the declaration of the similar __assert_fail from glibc:

extern void __assert_fail (const char *__assertion,
                           const char *__file,
			   unsigned int __line,
                           const char *__function)
     __THROW __attribute__ ((__noreturn__));

Bionic has __noreturn defined in sys/cdefs.h to be that GNU
noreturn attribute.

This patch has a practical value. Consider the following function:

void check(void* ptr) {
  assert(ptr != NULL);
}

Without this patch applied, gcc (and presumably clang) shows even in
debug mode:

warning: unused parameter 'ptr' [-Wunused-parameter]

In release mode, NDEBUG is defined and assert() becomes a no-op, as
one should expect. Thus, the warning is shown correctly then.

Another code sample:

float array[2];
int i = 3;
...
assert(i < 2);
array[i] = 0;

gcc says,

warning: array subscript is below array bounds [-Warray-bounds]

In other words, without noreturn attribute, assertions do not
allow a compiler's static analyzer to properly understand
the preconditions.

Change-Id: I3be92e99787c528899cf243ed448c4730c00c45b
Signed-off-by: Vadim Markovtsev <gmarkhor@gmail.com>
Replace memcpy with the cortex-strings implementation

Benchmarks on a Nexus 10 have shown this implementation to be
up to 12% faster.

Change-Id: I212df99357b338221779cfba118ebfff441c9457
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Add .cfi_startproc/.cfi_endproc wrapper to memcpy

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Declare __page_shift and __page_size with C linkage

__page_shift and __page_size are defined in asm/page.h with
C linkage - their implementation needs to use the same linkage.

The different linkage types cause a compiler error with clang.
Fixing them seems to be a good idea regardless of the compiler.

Change-Id: I35ed66a08989ced1db422eb03e4d154a5d6b5bda
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
bionic: Add ARMv7 optimized string handling routines

Add ARMv7 - and especially Cortex-A9 - optimized string handling
routines based on the versions found in the cortex-strings library.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Make use of new memcpy, tweak settings

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The new memcpy() is slightly faster than the cortex-strings version,
and fixes the Galaxy Nexus camera issue.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
bionic: Add Cortex-A15 optimized version of memcpy

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add the memcpy implementation from cortex-strings -- faster than
the current implementation on both A9 and A15.

To be investigated: Breaks saving pictures from the camera in
Galaxy Nexus builds

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
revert cortex string optimization routines for now

Change-Id: I410bdef93efd51277b494bde0300a01c49e926f7
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Fix build after 4.4 merge

Change-Id: I9b5eb314746ebadfced2f4a055a8e1306ca9e4ec
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Import memchr implementation from cortex-strings for Cortex A15

Benchmarks on a Nexus 10 have shown the cortex-strings implementation
of memchr to be 60%-70% faster (depending on input)

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Change-Id: I72b119905234570e54068375e5c3593d0647c67c