Commit graph

21334 commits

Author SHA1 Message Date
Elliott Hughes
d7c52625f2 Shave another uninteresting stack frame off aborts.
With this, stack frame 0 is the abort, not tgkill.

arm:

     #00 pc 0001a41c  /system/lib/libc.so (abort+63)

arm64:

     #00 pc 000000000001d75c  /system/lib64/libc.so (abort+120)

Also "include what you use" for <sys/syscall.h>.

Bug: N/A
Test: ran `crasher abort` and `crasher64 abort`
Change-Id: I6517ac67b39b4133e890d52efc115071c812958b
2017-06-20 14:58:16 -07:00
Jaesung Chung
b1b7eda11e Merge "linker_config_test: allow search paths of systems without a vendor partition" 2017-06-19 00:13:09 +00:00
Jaesung Chung
9d97008a68 linker_config_test: allow search paths of systems without a vendor partition
linker_config#smoke and linker_config.asan_smoke are trying to find
paths under the /vendor directory. If there is no vendor partition,
the real path of them is started with /system/vendor.

This CL allows those paths in the tests by getting the resolved paths
for systems without a vendor partition.

Bug: http://b/62562515
Test: linker_config_test passes without a vendor partition.
Change-Id: Id6d16ef623efd81ab9083c3e819da2ad22a28bf8
2017-06-19 00:12:45 +00:00
Treehugger Robot
42edca036e Merge "Add sys/stat.h compatibility macros for old NDKs." 2017-06-16 22:52:01 +00:00
Treehugger Robot
fed32937eb Merge "Remove obsolete <machine/cpu-features.h>." 2017-06-16 21:04:15 +00:00
Elliott Hughes
0c44c05166 Merge "Add #defines for some key enums." 2017-06-16 20:56:06 +00:00
Elliott Hughes
899e8caf3b Remove obsolete <machine/cpu-features.h>.
This is no longer used in the platform, and shouldn't be used in NDK. Apps
should use the NDK's cpu-features module, which supports (a) more specific
queries and (b) all Android architectures, not just 32-bit ARM.

Bug: http://b/18556103
Test: builds
Change-Id: I544ef267a6d7d887223186180c77d9ad0321e605
2017-06-16 11:09:13 -07: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
Dan Albert
a4e774c2bb Add sys/stat.h compatibility macros for old NDKs.
Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/417
Change-Id: I04fdb2f31131e87907adab9f3264b783917de542
2017-06-14 14:03:14 -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