Commit graph

1341 commits

Author SHA1 Message Date
Nick Kralevich
cffdf6693f FORTIFY_SOURCE: add snprintf, vsnprintf
Add _FORTIFY_SOURCE support for snprintf, vsnprintf

At this time, we opt out of these protections for clang, as clang
does not implement __builtin_va_arg_pack().

http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

Change-Id: I73ebe5ec8dad1dca8898a76d6afb693a25f75375
2012-06-11 16:46:16 -07:00
Nick Kralevich
85b06f9365 inet_ntop: pass the size of tmp to snprintf()
Fix runtime error when snprintf() FORTIFY_SOURCE protections are
applied. The size passed to snprintf() is larger than the tmp
buffer size, which results in a runtime assertion failure.

Even though the size passed to snprintf is larger than the buffer,
there's no danger of overwriting the buffer because of the format
string passed to snprintf.

Change-Id: I35f0217d25f3b9c6d04c5a76c3238759c235545a
2012-06-11 16:00:52 -07:00
Nick Kralevich
76656afc6d _FORTIFY_SOURCE: check for integer overflows
Ensure that strcat / strncat check for integer overflows
when computing the length of the resulting string.

Change-Id: Ib806ad33a0d3b50876f384bc17787a28f0dddc37
2012-06-08 20:18:19 -07:00
Geremy Condra
ec8addcc8a Merge "Adding event logging to libc." 2012-06-08 12:17:11 -07:00
Geremy Condra
8b11c4cec2 Adding event logging to libc.
I've basically just copied the relevant bits out of liblog and
EventLog.cpp. While this will let us do the uid logging we want
to address the concerns in 245c07027f78565858dd489eb0d94c3d48743e9d
it doesn't give us much else.

Change-Id: Icac6ff20bc0a3ade5927f6f76fedffe1ae6f8522
2012-06-08 12:14:48 -07:00
Nick Kralevich
71a18dd435 _FORTIFY_SOURCE: add memset / bzero support
Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
2012-06-07 14:19:52 -07:00
Elliott Hughes
459049719c am d0c25027: am 2b89f1e3: Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."
* commit 'd0c250271c983c3de282ff02bd2528e74ad8b5f1':
  Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
2012-06-06 13:50:29 -07:00
Elliott Hughes
d0c250271c am 2b89f1e3: Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."
* commit '2b89f1e37df838e466d382fc602728930bad4c68':
  Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
2012-06-06 13:48:07 -07:00
Elliott Hughes
a985076bfe Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
Bug: http://code.google.com/p/enh/issues/detail?id=33
Change-Id: I679b4cd888d362031042284e8edf01c5273a92aa
2012-06-06 12:04:38 -07:00
Elliott Hughes
158ad015c2 am 3069270d: am c2bba24d: Merge "Give the timer_create SIGEV_THREAD helper threads sensible names."
* commit '3069270d8641c7bb57aa308d8f90b4d2dcbf66fc':
  Give the timer_create SIGEV_THREAD helper threads sensible names.
2012-06-06 11:37:25 -07:00
Elliott Hughes
3069270d86 am c2bba24d: Merge "Give the timer_create SIGEV_THREAD helper threads sensible names."
* commit 'c2bba24d0a6b906f00d7b9f20ac9d32d63bb2e9d':
  Give the timer_create SIGEV_THREAD helper threads sensible names.
2012-06-06 11:35:32 -07:00
Elliott Hughes
470631ed79 Give the timer_create SIGEV_THREAD helper threads sensible names.
Bug: 6609676
Change-Id: I286b197c75beee4d9930b0973f2d7dd47c14e91c
2012-06-06 10:32:56 -07:00
Nick Kralevich
204c6e5ff3 Merge "arm: rewrite crtbegin* as C files." 2012-06-06 08:54:22 -07:00
Nick Kralevich
0a2301598c libc: implement some FORTIFY_SOURCE functions
Add initial support for -D_FORTIFY_SOURCE to bionic for the
following functions:

* memcpy
* memmove
* strcpy
* strcat
* strncpy
* strncat

This change adds a new version of the above functions which passes
the size of the destination buffer to __builtin___*_chk.

If the compiler can determine, at compile time, that the destination
buffer is large enough, or the destination buffer can point to an object
of unknown size, then the check call is bypassed.

If the compiler can't make a compile time decision, then it calls
the __*_chk() function, which does a runtime buffer size check

These options are only enabled if the code is compiled with
-D_FORTIFY_SOURCE=1 or 2, and only when optimizations are enabled.

Please see
* http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
* http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html

for additional details on FORTIFY_SOURCE.

Testing: Compiled the entire Android tree with -D_FORTIFY_SOURCE=1,
and verified that everything appears to be working properly.
Also created a test buffer overflow, and verified that it was
caught by this change.

Change-Id: I4fddb445bafe92b16845b22458d72e6dedd24fbc
2012-06-05 15:44:31 -07:00
Iliyan Malchev
31431f454a am 252a5c85: resolved conflicts for merge of e1dd3c28 to jb-dev-plus-aosp
* commit '252a5c854a08e89fc7337ea679220161fe4ea98f':
  bionic: import heaptracker as chk_malloc
2012-06-02 08:35:07 -07:00
Iliyan Malchev
143ad4cf31 am f0ddaa2f: am 7d2e24eb: bionic: introduce libc.debug.malloc.program
* commit 'f0ddaa2fac00ac20059c0b2c142da9de2838a7b6':
  bionic: introduce libc.debug.malloc.program
2012-06-02 08:20:09 -07:00
Iliyan Malchev
252a5c854a resolved conflicts for merge of e1dd3c28 to jb-dev-plus-aosp
Change-Id: I58b9c13d20771aa39b703ec05cbff8aeaad38fe8
2012-06-02 08:14:36 -07:00
Iliyan Malchev
f0ddaa2fac am 7d2e24eb: bionic: introduce libc.debug.malloc.program
* commit '7d2e24eb167b6257f7935c7bd2023a708704ca1a':
  bionic: introduce libc.debug.malloc.program
2012-06-01 19:03:06 -07:00
Iliyan Malchev
e1dd3c287b bionic: import heaptracker as chk_malloc
This patch is a rewrite of libc.debug.malloc = 10 (chk_malloc).  It provides
the same features as the original (poison freed memory, detect heap overruns
and underruns), except that it provides more debugging information whenever it
detects a problem.

In addition to the original features, the new chk_malloc() implementation
detects multiple frees within a given range of the last N allocations, N being
configurable via the system property libc.debug.malloc.backlog.

Finally, this patch keeps track of all outstanding memory allocations.  On
program exit, we walk that list and report each outstanding allocation.

(There is support (not enabled) for a scanner thread periodically walks over
the list of outstanding allocations as well as the backlog of recently-freed
allocations, checking for heap-usage errors.)

Feature overview:

  1) memory leaks
  2) multiple frees
  3) use after free
  4) overrun

Implementation:

-- for each allocation, there is a:
  1) stack trace at the time the allocation is made
  2) if the memory is freed, there is also a stack trace at the point
  3) a front and rear guard (fence)
  4) the stack traces are kept together with the allocation

-- the following lists and maintained

  1) all outstanding memory allocations
  3) a backlog of allocations what are freed; when you call free(), instead of
     actually freed, the allocation is moved to this backlog;
  4) when the backlog of allocations gets full, the oldest entry gets evicted
     from it; at that point, the allocation is checked for overruns or
     use-after-free errors, and then actually freed.
  5) when the program exits, the list of outstanding allocations and the
     backlog are inspected for errors, then freed;

To use this, set the following system properties before running the process or
processes you want to inspect:

libc.malloc.debug.backlog # defaults to 100
libc.malloc.debug 10

When a problem is detected, you will see the following on logcat for a multiple
free:

E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 BYTES MULTIPLY FREED!
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 4009647c  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 FIRST FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096490  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9278 SIZE 10 NOW BEING FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c6ac  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964a0  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so

The following for a heap overrun and underrun:

E/libc    ( 7233): +++ REAR GUARD MISMATCH [10, 11)
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 HAS A CORRUPTED REAR GUARD
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096438  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9198 SIZE 10 FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 40096462  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 HAS A CORRUPTED FRONT GUARD
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964ba  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so
E/libc    ( 7233): +++ ALLOCATION 0x404b9358 SIZE 10 FREED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c7d2  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d94  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 400964e4  /system/bin/malloctest
E/libc    ( 7233):      #04  pc 00016f24  /system/lib/libc.so

The following for a memory leak:

E/libc    ( 7233): +++ THERE ARE 1 LEAKED ALLOCATIONS
E/libc    ( 7233): +++ DELETING 4096 BYTES OF LEAKED MEMORY AT 0x404b95e8 (1 REMAINING)
E/libc    ( 7233): +++ ALLOCATION 0x404b95e8 SIZE 4096 ALLOCATED HERE:
E/libc    ( 7233): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/libc    ( 7233):      #00  pc 0000c35a  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #01  pc 0000c658  /system/lib/libc_malloc_debug_leak.so
E/libc    ( 7233):      #02  pc 00016d80  /system/lib/libc.so
E/libc    ( 7233):      #03  pc 0001bc94  /system/lib/libc.so
E/libc    ( 7233):      #04  pc 0001edf6  /system/lib/libc.so
E/libc    ( 7233):      #05  pc 0001b80a  /system/lib/libc.so
E/libc    ( 7233):      #06  pc 0001c086  /system/lib/libc.so
E/libc    ( 7233):      #07  pc 40096402  /system/bin/malloctest
E/libc    ( 7233):      #08  pc 00016f24  /system/lib/libc.so

Change-Id: Ic440e9d05a01e2ea86b25e8998714e88bc2d16e0
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-01 15:54:34 -07:00
Nick Kralevich
9d40326830 arm: rewrite crtbegin* as C files.
Rewrite
 crtbegin.S     -> crtbegin.c
 crtbegin_so.S  -> crtbegin_so.c

This change allows us to generate PIC code without relying
on text relocations.

As a consequence of this rewrite, also rewrite
  __dso_handle.S    -> __dso_handle.c
  __dso_handle_so.S -> __dso_handle_so.c
  atexit.S          -> atexit.c

In crtbegin.c _start, place the __PREINIT_ARRAY__, __INIT_ARRAY__,
__FINI_ARRAY__, and __CTOR_LIST__ variables onto the stack, instead of
passing a pointer to the text section of the binary.

This change appears sorta wonky, as I attempted to preserve,
as much as possible, the structure of the original assembly.
As a result, you have C files including other C files, and other
programming uglyness.

Result: This change reduces the number of files with text-relocations
from 315 to 19 on my Android build.

Before:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  315

After:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  19

Change-Id: Ib9f98107c0eeabcb606e1ddc7ed7fc4eba01c9c4
2012-06-01 14:41:27 -07:00
Iliyan Malchev
7d2e24eb16 bionic: introduce libc.debug.malloc.program
libc.debug.malloc.program  provides an additional level of control over which
processes to enable libc.debug.malloc functionality for.  The string value of
libc.debug.malloc.program is matched against the program name; if the value of
libc.debug.malloc.program is a substring of the program name, then malloc debug
is applied to that program at whatever level libc.debug.malloc specifies.

If lib.debug.malloc.program is not specified, then libc.debug.malloc has the
same effect as before.

For example, to enable libc.deubug.malloc = 10 only to the mediaserver, do the
following:

   adb root # necessary for setprop
   adb setprop libc.debug.malloc.program mediaserver
   adb setprop libc.debug.malloc 10
   adb kill -9 $(pid mediaserver)

Change-Id: I6f01c12f033c8e2e015d73025369d7f1685ba200
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-05-30 20:03:47 -07:00
Nick Kralevich
857fc9eab9 Merge "crtbegin: eliminate duplicate code" 2012-05-30 13:29:58 -07:00
Nick Kralevich
83a73d1afe crtbegin: eliminate duplicate code
crtbegin_dynamic and crtbegin_static are essentially identical,
minus a few trivial differences (comments and whitespace).

Eliminate duplicates.

Change-Id: Ic9fae6bc9695004974493b53bfc07cd3bb904480
2012-05-30 11:45:12 -07:00
Geremy Condra
207d7673e5 am 5a095ef2: am 03539a36: Merge "Ensure that the port number and TXID are properly randomized." into jb-dev
* commit '5a095ef28716b54f86d9c1727b9a2493ba775255':
  Ensure that the port number and TXID are properly randomized.
2012-05-30 11:11:33 -07:00
Geremy Condra
5a095ef287 am 03539a36: Merge "Ensure that the port number and TXID are properly randomized." into jb-dev
* commit '03539a36b634bdfa61c06277cf25e0ca8e3105ba':
  Ensure that the port number and TXID are properly randomized.
2012-05-30 11:09:05 -07:00
Geremy Condra
03539a36b6 Merge "Ensure that the port number and TXID are properly randomized." into jb-dev 2012-05-30 11:06:54 -07:00
Ben Cheng
41c2a112c2 am d7b60b20: am c84ff11d: Print the corrupted address passed to free().
* commit 'd7b60b207be79513b99faf2ef576db333f9c7a78':
  Print the corrupted address passed to free().
2012-05-24 17:23:43 -07:00
Ben Cheng
d7b60b207b am c84ff11d: Print the corrupted address passed to free().
* commit 'c84ff11dad26435dc5760bceda18e8f1175a6061':
  Print the corrupted address passed to free().
2012-05-24 17:21:03 -07:00
Ben Cheng
c84ff11dad Print the corrupted address passed to free().
For example:

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0
Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942

The addr=0x5c3bfbd0 part is new.

Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
2012-05-24 17:06:43 -07:00
Geremy Condra
b23f193dcc Ensure that the port number and TXID are properly randomized.
This fix reads from /dev/urandom to get the required entropy.

Bug: 6535492
Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
2012-05-24 15:26:12 -07:00
Jean-Baptiste Queru
15ed08d065 am d155ba57: am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'd155ba57a32ce3182d8a5b79ff27bc5e7fa55df9':
  bionic: add clean kernel header ucontext.h
2012-05-21 12:41:30 -07:00
Elliott Hughes
7cce04381a resolved conflicts for merge of dc6c2b77 to master
Change-Id: Ifab4573a825cf5caa7158d8888243bb8d5d01148
2012-05-17 17:15:01 -07:00
Jean-Baptiste Queru
d155ba57a3 am c7882ab2: Merge "bionic: add clean kernel header ucontext.h"
* commit 'c7882ab2a99a74c8f772ab03fdfd9a3b53515e46':
  bionic: add clean kernel header ucontext.h
2012-05-17 13:28:10 -07:00
Jean-Baptiste Queru
c7882ab2a9 Merge "bionic: add clean kernel header ucontext.h" 2012-05-17 12:25:02 -07:00
Elliott Hughes
dc6c2b779b am 70cf0bc0: Merge "Remove the last references to SuperH."
* commit '70cf0bc0496a1d4c0e83fe3f1933f667ab66c148':
  Remove the last references to SuperH.
2012-05-16 17:18:23 -07:00
Elliott Hughes
e33af61c70 Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
2012-05-15 17:08:41 -07:00
Ying Wang
fc9e525fe0 Rename the misleading var name TARGET_OUT_STATIC_LIBRARIES
TARGET_OUT_STATIC_LIBRARIES is actually the same as
TARGET_OUT_INTERMEDIATE_LIBRARIES.

Change-Id: I11ac35256031d461d20156cd4c19ed7eae781d22
2012-05-15 15:15:11 -07:00
Nick Kralevich
6cdefd06c0 Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.

Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.

Bug: 5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
2012-05-15 09:56:32 -07:00
Kito Cheng
c425bc0532 bionic: add clean kernel header ucontext.h
Change-Id: I34fd0b0147fa33fd74c13480bc11827634233a41
2012-05-14 01:42:12 +08:00
Elliott Hughes
1b56aaa659 am f2f7bf76: am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit 'f2f7bf76dfd1d6014ed3baa1e27b221388e70a09':
  bionic/x86: Optimization for memcpy
2012-05-10 23:15:00 -07:00
Elliott Hughes
f2f7bf76df am 4f05d1c7: Merge "bionic/x86: Optimization for memcpy"
* commit '4f05d1c758ba141c617f25251a661ecb66627e9e':
  bionic/x86: Optimization for memcpy
2012-05-10 21:31:48 -07:00
Elliott Hughes
4f05d1c758 Merge "bionic/x86: Optimization for memcpy" 2012-05-10 10:14:44 -07:00
Iliyan Malchev
83a38b8c44 am 8034415d: resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
* commit '8034415ddd8404f8788199ed993af89692235dc5':
  bionic: add support for non-NEON memcpy() on NEON SoCs
2012-05-10 09:24:46 -07:00
Iliyan Malchev
8034415ddd resolved conflicts for merge of 08e72d01 to jb-dev-plus-aosp
Change-Id: If00e354a5953ed54b31963d4f8ea77e1603c321e
2012-05-10 09:19:59 -07:00
Elliott Hughes
537867aed8 am 804147cb: am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit '804147cb7d533f5635da6adc28fbca1467a3078b':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:12:40 -07:00
Elliott Hughes
804147cb7d am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."
* commit 'edb7cad9b764f029c5faac2750f749d3d84bd86a':
  Actually set the header guard in "linux-syscalls.h".
2012-05-09 20:10:14 -07:00
Elliott Hughes
1928523c87 Actually set the header guard in "linux-syscalls.h".
Spotted while merging a MIPS change.

Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
2012-05-09 16:34:11 -07:00
Elliott Hughes
2a5fab9a5f am dbd5ecad: resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
* commit 'dbd5ecad26e39281bb83f97664bc32555c5c071a':
  [MIPS] Add support for MIPS syscalls
2012-05-09 13:57:12 -07:00
Elliott Hughes
dbd5ecad26 resolved conflicts for merge of e5408907 to jb-dev-plus-aosp
Change-Id: If4c3f51bf87b28da8074be2e46ae772a374b266f
2012-05-09 13:53:37 -07:00
Prajakta Gudadhe
08e72d0161 bionic: add support for non-NEON memcpy() on NEON SoCs
Some SoCs that support NEON nevertheless perform better with a non-NEON than a
NEON memcpy().  This patch adds build variable ARCH_ARM_USE_NON_NEON_MEMCPY,
which can be set in BoardConfig.mk.  When ARCH_ARM_USE_NON_NEON_MEMCPY is
defined, we compile in the non-NEON optimized memcpy() even if the SoC supports
NEON.

Change-Id: Ia0e5bee6bad5880ffc5ff8f34a1382d567546cf9
2012-05-09 13:34:31 -07:00