Commit graph

448 commits

Author SHA1 Message Date
Christopher Ferris
29ddd78c21 Merge "Put all allocation functions into dispatch table." 2014-06-12 21:07:49 +00:00
Christopher Ferris
a403780538 Put all allocation functions into dispatch table.
Implement these new functions for all of the debug malloc types.

Fix a number of bugs in the debug malloc functions related to overflow
conditions.
Fix a bug in dlpvalloc due to an overflow condition.

Fix various other bugs in the debug malloc functions.

Add new tests for malloc functions.

Bug: 11225066

Change-Id: Idf50f389603e2157645565bc15cd9365eec2e9dd
2014-06-12 15:08:18 -07:00
Elliott Hughes
346fa721ca Merge "Get the full set of PRNG functions in <stdlib.h>" 2014-06-12 03:32:07 +00:00
Elliott Hughes
a0beeeabbc Get the full set of PRNG functions in <stdlib.h>
Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I435250bdae302e8bd7e29977d0fde7b9afbfca5e
2014-06-12 14:37:31 -07:00
Christopher Ferris
3d5e0b2045 Merge "Add/Remove mmap tests." 2014-06-12 03:32:07 +00:00
Christopher Ferris
eda26bc1ff Add/Remove mmap tests.
Remove the incorrect tests that use a negative offset for mmap without
a fd.

Add a small set of tests for mmap.

Bug: 15436969

Change-Id: Id537d33cd4cdc26dee6cdfa9bf9cf35754bce335
2014-06-12 13:16:36 -07:00
Dan Albert
37b845f9e4 Merge "Remove declaration for putw(3)/getw(3)." 2014-06-12 05:34:11 +00:00
Dan Albert
8e613cf342 Remove declaration for putw(3)/getw(3).
These were both removed from POSIX 2004, and we don't define an
implementation for getw(3). Keep the definition of put(3) on LP32 for
binary compatibility.

Bug: 13935372
Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56
2014-06-11 14:41:45 -07:00
Christopher Ferris
e9f7a9c340 Allow bionic-unit-tests-glibc to be built again.
When we switched to 64 bit host build be default, we no longer build
the glibc unit tests. Fix that, and also set all host targets to build
multilib.

This change also changes the name of bionic-unit-tests-glibc to add
the suffix of 32 or 64 depending on the host type built.

Change-Id: Ife13f9d80f351750ff02825b086d44bb0c2df828
2014-06-10 19:46:07 -07:00
Alexander Ivchenko
68b01665b3 Fix mbrtoc32 test from tests/uchar_test.cpp for x86.
Without that fix the test fails with:
"error: comparison between signed and unsigned integer expressions" on x86,
due to the fact that char is signed on x86.

Change-Id: I44462d67c15c7e9b730ad5da52eb9c05e207d34b
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
2014-06-11 15:57:57 -07:00
Serban Constantinescu
2aca7fe821 AArch64: Fix memcmp16() test
__memcmp16() should return an integer less than, equal to, or greater than
zero. However the tests looks for a specific value.

Change-Id: I06052f58f9ccc67146a3df9abb349c4bc19f090e
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2014-06-10 17:51:10 +01:00
Ying Wang
199e8638df Merge "Use PRIVATE_POST_INSTALL_CMD to create symlink." 2014-06-09 23:55:19 +00:00
Ying Wang
7f722b366a Use PRIVATE_POST_INSTALL_CMD to create symlink.
Bug: 15520908
Change-Id: Ib3349f7adb6def81abf07bfb9d37093e4a599d09
2014-06-09 16:32:51 -07:00
Elliott Hughes
18b17e9775 Add a regression test for two libm bugs we didn't have.
Reported on the OpenBSD list, but we already had the fix for one from FreeBSD,
and I think the other only affected ld80 anyway. Worth having tests thuogh.

Change-Id: Ic4bbeb2384fd578a3ef13e4907be83deda50815f
2014-06-06 21:55:27 -07:00
Elliott Hughes
c3bdc792be Merge "Fix the printf family for non-ASCII." 2014-06-06 18:06:44 +00:00
Elliott Hughes
69f05d291d Fix the printf family for non-ASCII.
The bug here turned out to be that we hadn't increased the constant
corresponding to the maximum number of bytes in a character to match
our new implementation, so any character requiring more than a byte
in UTF-8 would break our printf family.

Bug: 15439554
Change-Id: I693e5e6eb11c640b5886e848502908ec5fff53b1
2014-06-05 23:19:15 -07:00
Varvara Rainchik
fce861498c Fix for slm-tuned memmove (both 32- and 64-bit).
Introduce a test for memmove that catches a fault.
Fix both 32- and 64-bit versions of slm-tuned memmove.

Change-Id: Ib416def2610a0972e32c3b9b6055b54967643dc3
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
2014-06-05 11:08:09 -07:00
Dan Albert
001f8f041b Removes wcswcs from bionic for LP64.
Bug: 13935372
Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
2014-06-04 12:01:56 -07:00
Dan Albert
452e091300 Merge "Adds functionality specified by uchar.h" 2014-06-04 16:10:50 +00:00
Dan Albert
7a7f9952c1 Adds functionality specified by uchar.h
mbrtoc32 and c32rtomb get their implementations from mbrtowc and wcrtomb. The
wc functions now simply call the c32 functions.

Bug: 14646575
Change-Id: I49d4b95fed0f9d790260c996c4d0f8bfd1686324
2014-06-04 08:39:24 -07:00
Elliott Hughes
d286796fce Turn on -Wunused and fix the mistakes it uncovers.
Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
2014-06-03 15:22:34 -07:00
Dmitriy Ivanov
214e64135e Make atexit.dlclose work for glibc
* build libtest_atexit.so
 * remove atexit(NULL) - glibc segfaults on it

Bug: 15350494
Change-Id: I27d79130c32c5691b0e8790a57d92f9710f5bf4a
2014-05-30 18:16:09 -07:00
Christopher Ferris
39036f655a Do not run dlclose test on glibc.
The support library for this test is not built for host by default.
Even if the support library is built, the test segfaults on glibc.

Change-Id: I9cb7a364c59b55d4bf5d8634293037cd9bae020b
2014-05-30 11:23:21 -07:00
Christopher Ferris
d178c83d45 Fix unwinding_through_signal_frame test.
I accidentally removed the compilcation of the test implementation file
with special flags needed for the test to work. This change creates the
impl as a library with those flags back.

Bug: 14819262
Change-Id: Ib84fd26a7f4d40a0267d3ed686185b0abc5a3706
2014-05-29 20:00:12 -07:00
Christopher Ferris
8bf50d5b72 Fix wmemmove test.
I accidentally copied over the nul terminator with the test.

Change-Id: I24a9aa05d4fba4f383fa38a3041bb6a6b179130c
2014-05-29 15:44:34 -07:00
Christopher Ferris
9e01ea63a7 Fix dprintf test.
Change-Id: Ied783d545b6a35a70a158249f3957a9d00971627
2014-05-29 13:17:40 -07:00
Christopher Ferris
1a57de713a Merge "Fix overflow testing in sbrk." 2014-05-29 18:03:28 +00:00
Christopher Ferris
738b0cc5e9 Fix overflow testing in sbrk.
Modify the overflow testing for sbrk.

Bug: 15188366

Change-Id: Ia83f85f7c1789454d872279bd41f38f1ce6b8a34
2014-05-29 10:51:22 -07:00
Dan Albert
6b3beb23d6 Fixes stdatomic.h test to match C11 spec
C11 defines the expected value to atomic_compare_exchange_* as being non-atomic
types. Using an atomic type is a syntax error in clang.

http://en.cppreference.com/w/c/atomic/atomic_compare_exchange

Change-Id: I74de1061fa1fc50d835451792d902000f368200e
2014-05-28 16:53:08 -07:00
Christopher Ferris
8a405b027a Merge "Add optimized AArch64 versions of bcopy and wmemmove based on memmove" 2014-05-28 21:35:04 +00:00
Elliott Hughes
e6c57fcb05 Add C11 <stdatomic.h>.
Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5
2014-05-23 20:06:03 -07:00
Bernhard Rosenkraenzer
6f2bde3441 Add optimized AArch64 versions of bcopy and wmemmove based on memmove
Add optimized versions of bcopy and wmemmove for AArch64 based on the
memmove implementation

Change-Id: I82fbe8a7221ce224c567ffcfed7a94a53640fca8
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-05-23 18:49:57 -07:00
Christopher Ferris
fd0ce866ce Revert "Add optimized AArch64 versions of bcopy and wmemmove based on memmove"
This reverts commit 8167dd7cb9.

For some reason I thought the bcopy change was bzero. The bcopy code doesn't pass our tests, so reverting until I can figure out what's wrong.

Change-Id: Id89fe959ea5105cd58dff6bba8d91a30cc4bcb07
2014-05-24 01:02:22 +00:00
Bernhard Rosenkraenzer
8167dd7cb9 Add optimized AArch64 versions of bcopy and wmemmove based on memmove
Add optimized versions of bcopy and wmemmove for AArch64 based on the
memmove implementation

Change-Id: Ie43d0ff4f8ec4edba5b4fb5ccacd941f81ac6557
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-05-23 17:54:08 -07:00
Calin Juravle
92687e41bc Cleaned up pthread rwlocks implementation.
- used underscore_style_for_vars
- extracted time related functionality into a function
- cleaned up style
- removed unused fields from pthread_rwlock_t on LP64
- changed reservation in pthread_rwlock_t so that the size of the
structure equals glibc version

Bug: 8133149

Change-Id: I84ad3918678dc7f5e6b3db9b7e9b0899d3abe9cd
2014-05-23 00:22:58 +01:00
Dmitriy Ivanov
44adf93b8e Fix dlsym_failure NULL handle test
* RTLD_DEFAULT != (void*)0 only for bionic32

Change-Id: I3b3758835cf4085b0f899e2b62861591411aec13
2014-05-22 10:06:32 -07:00
Calin Juravle
eea59ea21e Merge "Add dprintf test" 2014-05-22 16:03:08 +00:00
Dmitriy Ivanov
3eb9f1f6ba Merge "Removed dlsym handle != NULL check for lp64" 2014-05-22 12:55:15 +00:00
Calin Juravle
6afb2a9a97 Add dprintf test
Change-Id: I0fe1b4d45c1312cf01deed6ce5db032d5513e908
2014-05-22 11:47:47 +01:00
Calin Juravle
172167163a Merge "Mutex-free implementation of pthread_rwlock" 2014-05-22 10:15:03 +00:00
Calin Juravle
76f352eec1 Mutex-free implementation of pthread_rwlock
Bug: 8133149
Change-Id: Id6775010d95f2634b173daa55d87a59a3cf4131b
2014-05-22 11:11:15 +01:00
Dmitriy Ivanov
ca1c80220e Removed dlsym handle != NULL check for lp64
* Removed unnecessary NULL check in dlsym
 * Fixed dlsym_failure test to account for
   correct RTLD_DEFAULT value
 * Added temporary check for legacy RTLD_DEFAULT
   value for non-yet-recompiled binaries

Bug: 15146875
Change-Id: I089fa673762629f5724b6e4fbca019d9cfc39905
2014-05-21 22:42:24 -07:00
Christopher Ferris
72bbd42357 Support for jemalloc to replace dlmalloc.
To use jemalloc, add MALLOC_IMPL = jemalloc in a board config file
and you get the new version automatically.

Update the pthread_create_key tests since jemalloc uses a few keys.
Add a new test to verify memalign works as expected.

Bug: 981363

Change-Id: I16eb152b291a95bd2499e90492fc6b4bd7053836
2014-05-20 14:47:33 -07:00
Christopher Ferris
afb89c2a01 Merge "denver: optimize memmove" 2014-05-20 19:56:13 +00:00
Shu Zhang
6c80ccdeed denver: optimize memmove
Optimize 32-bit denver memmove with reversal memcpy.

Change-Id: Iaad0a9475248cdd7e4f50d58bea9db1b767abc88
2014-05-20 12:31:38 -07:00
Dmitriy Ivanov
b648a8a57e Add RTLD_NOLOAD support and some related changes.
* Aligned RTLD_ values with glibc for lp64
 * dlopen supports RTLD_NOLOAD flag
 * soinfo_unload calls find_library(.., RTLD_NOLOAD)
   instead of naive find_loaded_library_by_name()
 * dlopen changed to add child to caller soinfo instead
   of somain.

Bug: https://code.google.com/p/android/issues/detail?id=64069
Change-Id: I1a65f2c34f3e0edc6d2c41a2e408b58195feb640
2014-05-20 12:02:24 -07:00
Elliott Hughes
de9ac71053 Use -fvisibility=hidden to build libm.
Bug: 11156955
Change-Id: I77b7772a44313a1eb3970f5d2c8e2af63690efa4
2014-05-19 16:58:52 -07:00
Ben Cheng
77338a2969 Merge "Address additional warnings found by GCC 4.9." 2014-05-19 22:28:10 +00:00
Ben Cheng
caff5f2e1a Address additional warnings found by GCC 4.9.
Change-Id: If668a6eb98a6ce7b2872f528b8e3527638814f68
2014-05-19 14:27:31 -07:00
Jingwei Zhang
568d64dc62 Accuracy tests for libm
This patch adds tests for 14 math functions to address coverage
issue of math functions discussed in:
https://android-review.googlesource.com/#/c/49653/

Change-Id: Ia7200b93d4f5c7928a3fb827ca6932226384a116
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
2014-05-16 15:31:55 -07:00