Commit graph

21327 commits

Author SHA1 Message Date
Elliott Hughes
0c44c05166 Merge "Add #defines for some key enums." 2017-06-16 20:56:06 +00:00
Christopher Ferris
f0ee60a434 Merge "Add benchmarks for strcpy and strcmp." 2017-06-16 16:40:03 +00:00
Elliott Hughes
ae837f2e59 Merge "libc: warn that cpu-features.h is deprecated" 2017-06-16 14:40:11 +00:00
Christopher Ferris
b33accf799 Merge "Update posix_memalign testing." 2017-06-15 23:11:50 +00:00
Elliott Hughes
8ad4093659 Add #defines for some key enums.
Building ruby actually trips over both of these:

* if the RTLD_ constants aren't #defined, it uses its own incorrect values.

* if the REG_ constants aren't #defined, it confuses x86 with x86-64.

In all other places where we have enums in our headers, we already match
existing glibc practice.

Bug: http://b/62531921
Test: builds
Change-Id: I5b3aab25a1a24611bdc58f2eda4104a78e9f841c
2017-06-15 15:12:29 -07:00
Elliott Hughes
0bd23e4706 Merge "Move a <wchar.h> implementation detail into the implementation." 2017-06-15 21:30:09 +00:00
Christopher Ferris
3a32d95e28 Update posix_memalign testing.
Move all tests into stdlib_test.cpp since that's where the definition lives
in bionic.

Add a sweep test and a various size test.

Test: Run new unit tests on glibc and angler.
Change-Id: Ief1301f402bea82ce90240500dd6a01636dbdbae
2017-06-15 14:18:08 -07:00
Christopher Ferris
6c2e8e0227 Merge "Add copy-only, seek-only, and copy-and-seek benchmarks for strcat" 2017-06-15 20:34:56 +00:00
Treehugger Robot
6202089778 Merge "MIPS64: move fstat64/fstatat64/_flush_cache syscalls to SECCOMP_WHITELIST.TXT" 2017-06-15 18:21:14 +00:00
Elliott Hughes
e2d4663b27 Move a <wchar.h> implementation detail into the implementation.
No other C library expose these, and I couldn't find any callers.

Bug: http://b/62531921
Test: builds
Change-Id: I4a3505bc0897286a4036c48066b98d16665b573a
2017-06-15 10:37:26 -07:00
Treehugger Robot
a09953e1a8 Merge "Expose pthread_mutex_lock_timeout_np to the NDK." 2017-06-15 16:15:24 +00:00
Elliott Hughes
112581a5e0 Merge "Don't use the overloadable attribute if we're not fortified." 2017-06-15 15:06:36 +00:00
Nicolas Geoffray
67f03e0687 Merge "Move libc/zoneinfo/ files to system/timezone" 2017-06-15 09:05:33 +00:00
Miodrag Dinic
a301e73475 MIPS64: move fstat64/fstatat64/_flush_cache syscalls to SECCOMP_WHITELIST.TXT
fstat64/fstatat64/_flush_cache were accidentally put in SYSCALLS.TXT in:
    https://android-review.googlesource.com/#/c/390454/

This patch just moves them to SECCOMP_WHITELIST.TXT because we do not
want stubs accidenatally generated for the mentioned syscalls using
gensyscalls.py script.

This commit does not introduce any functional changes to mips64_policy.cpp.

Test: Run genseccomp.py -> File seccomp/mips64_policy.cpp not changed.
Test: Run gensyscalls.py -> INFO:root:no changes detected!

Change-Id: I3b527b3d9f18715c44a4e6ddc6db6e49f48f4890
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
2017-06-15 10:25:09 +02:00
Treehugger Robot
3ad08dbe29 Merge "Add <sys/mtio.h>." 2017-06-15 02:40:35 +00:00
Anders Lewis
1c487e1036 Add benchmarks for strcpy and strcmp.
Test: Ran benchmarks and verified that runtimes were sensible.
Change-Id: I609e3261503a015bfd4982767fef3ce56141aebc
2017-06-14 17:51:54 -07:00
Elliott Hughes
af0c781cf4 Add <sys/mtio.h>.
In a similar style to some of our other "not really, but enough" headers
like <sys/vt.h>.

Bug: N/A
Test: build GNU dd or BSD dd with a standalone toolchain
Change-Id: I8fbd1aac1d97e24b05e7aae8a55666300b5bf1ed
2017-06-14 17:16:05 -07:00
Elliott Hughes
6fa8df9d3c Don't use the overloadable attribute if we're not fortified.
See code comment.

Bug: N/A
Test: building bash and binutils with a standalone toolchain
Change-Id: I73b5d55716072ca1b03b1b0157d65cb1ceb22841
2017-06-14 16:54:32 -07:00
Anders Lewis
a99d052801 Add copy-only, seek-only, and copy-and-seek benchmarks for strcat
Test: Ran benchmarks and verified that runtimes were sensible.
Change-Id: I6da3aaea0ba4817662534b24873993589385e6c5
2017-06-14 15:13:50 -07:00
Neil Fuller
2b1ebb5724 Move libc/zoneinfo/ files to system/timezone
Move libc/zoneinfo/ files to system/timezone.

Bug: 31008728
Bug: 36882778
Test: make -j30 droid / boot device
Merged-In: I1d75b0be12b41258f89614b92c1ef68aa7ebfaf9
Change-Id: I1d75b0be12b41258f89614b92c1ef68aa7ebfaf9
2017-06-14 11:57:39 +00:00
Treehugger Robot
7f6bcc4780 Merge "Remove volatile from the __errno declaration." 2017-06-14 00:44:33 +00:00
Treehugger Robot
87d1df9f70 Merge "The bsd_signal declaration shouldn't be visible if API > 21." 2017-06-13 23:20:40 +00:00
Elliott Hughes
e452cb1ff3 Remove volatile from the __errno declaration.
This breaks code that declares `errno` itself for whatever crazy reason:

  b.c:22:12: error: conflicting types for '__errno'
  extern int errno;
             ^
  /usr/local/google/ndkports/toolchain/bin/../sysroot/usr/include/errno.h:47:20: note: expanded from macro 'errno'
  #define  errno   (*__errno())
                     ^
  /usr/local/google/ndkports/toolchain/bin/../sysroot/usr/include/errno.h:44:15: note: previous declaration is here
  volatile int* __errno(void) __attribute_const__;
                ^

Bug: N/A
Test: built various bits of GNU source
Change-Id: I27c03bf3bde419a001f98f1ea6c267c847f31271
2017-06-13 16:02:07 -07:00
Elliott Hughes
583ef362c8 The bsd_signal declaration shouldn't be visible if API > 21.
This causes GNU make to fail to build:

  main.o:main.c:(.text+0x18c): more undefined references to `bsd_signal' follow

Bug: N/A
Test: built GNU make with a hacked standalone toolchain
Change-Id: Icdfb4cf674df8abed44f6671454bed9f8d68e74b
2017-06-13 14:29:15 -07:00
Treehugger Robot
017ee76b15 Merge "libc: Sync qsort(3) with FreeBSD revision r318515." 2017-06-13 20:33:50 +00:00
Xin Li
4b1a3992de libc: Sync qsort(3) with FreeBSD revision r318515.
r279663: enhance to handle 32-bit aligned data on 64-bit systems

r279666: qsort(3): small style(9) cleanups.

r288030: Use ANSI C prototypes.  Eliminates -Wold-style-definition
warnings.

r318514: Use size_t.

r318515: Reduce the possible recursion level to log2(N) by always
recursing on the smaller partition instead.

Bug: 38450217
Test: builds, ./tests/run-on-host.sh 64
Change-Id: Ieb622e6f54f8f6d6f62e1bdb491d3b5c8e2f9965
2017-06-13 18:49:54 +00:00
Christopher Ferris
2d36be5912 Merge "Split memmove benchmark into separate overlapping (src before dst and dst before src) and non-overlapping tests." 2017-06-13 18:05:02 +00:00
Dan Albert
8c67f1e617 Expose pthread_mutex_lock_timeout_np to the NDK.
The proper API for this isn't available until L, so expose this for
API levels earlier than that.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/420
Change-Id: I382b8f557be9530f3e13aaae353b4a6e7f9301ab
2017-06-12 16:46:01 -07:00
Anders Lewis
271be9bb7d Split memmove benchmark into separate overlapping (src before dst and dst before src) and non-overlapping tests.
Test: Ran benchmarks and verified that runtimes were sensible.
Change-Id: Ia7fbc5596dfdc162fff2364f4ef6dafe5549b907
2017-06-09 13:30:34 -07:00
Josh Gao
4f61181428 Merge "Explain why we have a test that FALLOC_FL_PUNCH_HOLE is missing." 2017-06-09 06:01:26 +00:00
Christopher Ferris
5c76fec282 Merge "Use libdemangle for function names." 2017-06-02 22:02:55 +00:00
Josh Gao
24ed8b5fbf Explain why we have a test that FALLOC_FL_PUNCH_HOLE is missing.
Change-Id: I7388f2e0bc419f195247a1d3e73195cb4d199d5c
Test: none
2017-06-02 14:58:44 -07:00
Christopher Ferris
a625ee2063 Use libdemangle for function names.
Bug: 62141808

Test: Ran unit tests, ran malloc debug with leaks and verified functions
Test: are demangled.
Change-Id: I1900632e9a55bb818b1aabc798224ff3eebc1fca
2017-06-02 10:10:24 -07:00
Jake Weinstein
576a7e9fb2 libc: warn that cpu-features.h is deprecated
Test: mm

Change-Id: I39668fc75e72004224e35ac9e7d6ffc858df2169
2017-06-02 04:30:20 +00:00
Treehugger Robot
498b4de964 Merge "Fix boost build with unified headers." 2017-06-01 23:30:57 +00:00
Elliott Hughes
2eab77e503 Fix boost build with unified headers.
boost (1.64.0 at least) assumes that if you have POSIX_MADV_NORMAL, you have
posix_madvise. With unified headers, this isn't true. Rather than make life
harder for projects that don't use configure, just make it so. We already
applied similar workarounds for epoll_create1 and inotify_init1.

Bug: https://github.com/android-ndk/ndk/issues/395
Test: built boost (long story!)
Change-Id: I5d2d8de7b30921dde913251d35dcd249a2876f94
2017-06-01 14:08:58 -07:00
Treehugger Robot
72c8fce6c9 Merge "MIPS: 32/64-bit VDSO support" 2017-06-01 17:44:42 +00:00
Goran Ferenc
996f6decfa MIPS: 32/64-bit VDSO support
File libc/SYSCALLS.TXT is updated to generate bionic's system call wrappers
for clock_gettime() & gettimeofday() that will be called if kernel vdso
implementations fail to execute.
The system call wrappers are generated using a python script gensyscalls.py.

Since all architectures support vdso now, there is no more need for conditional
statements regarding supported architectures in libc/bionic/vdso.cpp &
libc/private/bionic_vdso.h files.

Test: builds
Change-Id: I7213f29c179a7929851499d78a72900638ae861a
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
2017-06-01 08:50:57 -07:00
Treehugger Robot
533cf06474 Merge "Make dl_iterate_phdr return correct name for first entry" 2017-06-01 07:16:12 +00:00
Dimitry Ivanov
cd510cbed9 Make dl_iterate_phdr return correct name for first entry
Test: bionic-unit-tests --gtest_filter=link*
Change-Id: Ib3f1e0fbc76fed9a5f27ffdd9bbf847a3e8d3665
2017-05-31 23:45:15 +00:00
Christopher Ferris
15eaaddef9 Merge "Move mallopt to correct section." 2017-05-31 20:07:31 +00:00
Christopher Ferris
8f7a987cd0 Merge "Revert "Make mallopt available in the future."" 2017-05-31 18:15:11 +00:00
Christopher Ferris
488eb8b7d2 Move mallopt to correct section.
Bug: 62202823

Test: Built and built unit tests.
Change-Id: Icefc152eb756fd60ce8f51d694f22923a41a9cd1
2017-05-31 11:00:18 -07:00
Christopher Ferris
8f6f70db45 Merge "Add mallopt to canonical list of exports." 2017-05-31 17:40:33 +00:00
Christopher Ferris
ca84fe3be7 Add mallopt to canonical list of exports.
Bug: 62202823

Test: Ran script and verified that none of the other map files are modified.
Change-Id: Ib890ce77c60b877434fbb65a5add8f6c4603d3d0
2017-05-30 17:38:52 -07:00
Christopher Ferris
7c08c7910d Revert "Make mallopt available in the future."
This reverts commit 083923d96a.

Reason for revert: No longer correct, this will be in API 26.

Change-Id: Iaf82d797405135fcd30455fd750b23fc57e9623a
2017-05-31 00:15:00 +00:00
Elliott Hughes
6be65c135b Merge "Enable exporting the non-uapi scsi headers." 2017-05-26 18:04:28 +00:00
Christopher Ferris
f6a5afcb62 Merge "Add offset to backtrace_string printing." 2017-05-26 16:58:00 +00:00
Elliott Hughes
5059939c87 Enable exporting the non-uapi scsi headers.
Callers are supposed to #include <scsi/sg.h> but if we tell soong to add
bionic/libc/kernel/android/ to the include path, the uapi headers in there
would be (unintentionally) accessible as either <linux/name.h> or
<uapi/linux/name.h>.

Bug: N/A (hit while upgrading strace to 4.17)
Test: builds
Change-Id: I8d47dd51da688c38f747a255d401dfb2c209c805
2017-05-25 19:17:55 -07:00
Christopher Ferris
c0352bbd5f Add offset to backtrace_string printing.
The libmemunreachable code uses backtrace_string to print out the backtrace
information. However, when the offset of the map that a frame is in is
non-zero, no information is printed. This means that when a frame comes from
a shared library loaded from an apk, it's impossible to tell which
shared library the frame is really coming from.

Add the offset display when it's non-zero. This means this can now be fed
to development/scripts/stack to decode the frame.

Bug: 37276041

Test: Ran dumpsys meminfo --unreachable on an app that leaks from a
Test: shared library and verified the offset output is present.
Change-Id: I61d34ae3f617622d354cc099eff520a64782b6e2
2017-05-25 18:38:45 -07:00