Commit Graph

5558 Commits

Author SHA1 Message Date
Christopher Ferris
2169e17482 Remove the unnecessary generic-neon code.
Change-Id: Ib75c33caafd76750ec1aca3a74dec5e4b881e965
2014-09-23 18:31:45 -07:00
Elliott Hughes
31165edf57 CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps.
Change-Id: I74ea88e0d4973d6ab3c57da7d8bb643c31592b14
2014-09-23 18:21:52 -07:00
Dan Albert
3c5037f1b3 Fix incorrect parameter types for locale funcs.
strtoll(3), strtoull(3), wcstoll(3), and wcstoull(3) all take an _int_
as a base, not a size_t. This is an ABI compatibility issue.

Bug: 17628622
Change-Id: I17f8eead34ce2112005899fc30162067573023ec
2014-09-23 15:32:24 -07:00
Elliott Hughes
0d44da9eb4 am 87b6906f: Merge "Pull in upstream fixes to reject invalid bases."
* commit '87b6906f6e0c17b2541535be8e054324cc2fef4a':
  Pull in upstream fixes to reject invalid bases.
2014-09-23 22:12:57 +00:00
Elliott Hughes
b05ec5ae93 Pull in upstream fixes to reject invalid bases.
Also add tests to make sure the full set works correctly.

Change-Id: I3e7f237f12c9c93e1185a97c9717803e7e55a73c
2014-09-23 14:53:10 -07:00
Elliott Hughes
3a86c0fd90 am 86421653: Merge "Sync with some upstream OpenBSD #include cleanup."
* commit '8642165344217877b8a70811d19e09b584a0e10a':
  Sync with some upstream OpenBSD #include cleanup.
2014-09-23 21:48:00 +00:00
Elliott Hughes
0c1008b9d8 am 0ab5fd9a: Merge "Switch to OpenBSD insque/remque/killpg."
* commit '0ab5fd9a5af4cd00572e4881f46c1e6f974f657c':
  Switch to OpenBSD insque/remque/killpg.
2014-09-23 21:48:00 +00:00
Elliott Hughes
8642165344 Merge "Sync with some upstream OpenBSD #include cleanup." 2014-09-23 21:27:29 +00:00
Elliott Hughes
49eed7db79 Switch to OpenBSD insque/remque/killpg.
Change-Id: Ie02290ad3187b1c1596dd776fd1c8a743a55f7ef
2014-09-23 14:06:56 -07:00
Elliott Hughes
08dc9d83a2 Sync with some upstream OpenBSD #include cleanup.
Change-Id: Ibcd7adb19e9a6b9ad8c24d77e23935f19f56a144
2014-09-23 13:55:15 -07:00
Elliott Hughes
c65a1d5ee0 am 93951cfa: Merge "Fix a couple more cases of missing CLOEXEC."
* commit '93951cfa96c3c7504a78f94e7ec408936e5db9bf':
  Fix a couple more cases of missing CLOEXEC.
2014-09-23 01:39:11 +00:00
Elliott Hughes
0dc39f9952 Fix a couple more cases of missing CLOEXEC.
The debuggerd case can probably never happen, because you're crashing at this
point anyway. The system property one seems possible though.

Change-Id: Idba6a4f1d68587ec5b320d1e25f0b6a987ea32a0
2014-09-22 17:43:09 -07:00
Elliott Hughes
1f2e845f9a am b2da4562: Merge "Clean up fpathconf(3)/pathconf(3)."
* commit 'b2da45625353336452112e28872310903dc70a8f':
  Clean up fpathconf(3)/pathconf(3).
2014-09-22 23:05:35 +00:00
Elliott Hughes
a186b2e0ca Clean up fpathconf(3)/pathconf(3).
fpathconf(3) and pathconf(3) can share code. There's no such
header file as <pathconf.h>. glibc/POSIX and BSD disagree about where
the _POSIX_* definitions should go.

Change-Id: I4a67f1595c9f5fbb26700a131178eedebd6bf712
2014-09-22 22:49:40 +00:00
Elliott Hughes
bb54a0d47a am 9f423c55: Merge "Use the uapi fs magic in <sys/vfs.h>."
* commit '9f423c554a0ffcee2e34472bf0bc1aef3621a822':
  Use the uapi fs magic in <sys/vfs.h>.
2014-09-22 17:08:51 +00:00
Elliott Hughes
c296e4f151 Use the uapi fs magic in <sys/vfs.h>.
Change-Id: I712b856a6d786bba400c9a8d08f596b826403731
2014-09-22 09:47:21 -07:00
Elliott Hughes
7d8796feaa am 413de5b0: Merge "Add semaphore tests, fix sem_destroy."
* commit '413de5b0d4ddcf039aaef8b40a5f02d41dbb06e6':
  Add semaphore tests, fix sem_destroy.
2014-09-20 20:06:21 +00:00
Elliott Hughes
413de5b0d4 Merge "Add semaphore tests, fix sem_destroy." 2014-09-20 01:34:11 +00:00
Christopher Ferris
1b0654f4a7 am e7160449: Merge "Remove references to MALLOC_LEAK_CHECK."
* commit 'e716044918d85cd3c34425779a09a24348f7f67a':
  Remove references to MALLOC_LEAK_CHECK.
2014-09-20 00:50:08 +00:00
Elliott Hughes
04303f5a8a Add semaphore tests, fix sem_destroy.
Bug: https://code.google.com/p/android/issues/detail?id=76088
Change-Id: I4a0561b23e90312384d40a1c804ca64ee98f4066
2014-09-19 17:37:06 -07:00
Christopher Ferris
6fe376d392 Remove references to MALLOC_LEAK_CHECK.
This define isn't really used any more.

Bug: 17378595
Change-Id: I39722b83cd98955a3a2514577de34a239524617f
2014-09-19 17:15:12 -07:00
Elliott Hughes
954782240e am adc01348: Merge "Add greg_t for arm64."
* commit 'adc01348ee51a4ad678b1c277f85cbbed5c2e728':
  Add greg_t for arm64.
2014-09-19 18:23:59 +00:00
Elliott Hughes
adc01348ee Merge "Add greg_t for arm64." 2014-09-19 18:01:23 +00:00
Elliott Hughes
8e4d371091 Add greg_t for arm64.
This was already present for the other architectures. I think we skipped
this because glibc seems to have an incorrect definition (int rather than
long), but the kernel has the sane definition (just not in a uapi header).

Change-Id: I0d47a424b505804389853dd8632693dad55a3907
2014-09-19 10:31:49 -07:00
Dan Albert
05ce5ff3f2 am 13d6023a: Merge "Exclude libstdc++ from linked libraries."
* commit '13d6023aac62091a7d1df1c1afa1e228515832cb':
  Exclude libstdc++ from linked libraries.
2014-09-19 00:05:23 +00:00
Dan Albert
13d6023aac Merge "Exclude libstdc++ from linked libraries." 2014-09-18 23:43:24 +00:00
Christopher Ferris
cbf33a9988 am d5e1c583: Merge "Move to v3.16.3 kernel headers."
* commit 'd5e1c583a66a821c7d7e8f43e1238a4569981b90':
  Move to v3.16.3 kernel headers.
2014-09-18 21:48:49 +00:00
Christopher Ferris
653676dde8 Move to v3.16.3 kernel headers.
Change-Id: Ife491bd7630b853a78532dd74e4644438256a3a1
2014-09-18 13:14:58 -07:00
Christopher Ferris
aac37784df am 0bd28a43: Merge "Update kernel uapi headers to v3.16.1."
* commit '0bd28a43dae87c808f6af61ad3dba042b35be7e7':
  Update kernel uapi headers to v3.16.1.
2014-09-18 00:41:24 +00:00
Christopher Ferris
ba8d4f460b Update kernel uapi headers to v3.16.1.
Other changes to support the new headers:

- Remove the flock64 structure it is defined in the new headers.
- Update the syscalls to correspond with the headers.

Change-Id: I49a6b07e8b2bfffb67be71b07b58e4e6848fcc09
2014-09-17 17:05:17 -07:00
Elliott Hughes
8fa377eb6a Fix an unintended difference between aosp/master and lmp-dev-plus-aosp.
Whitespace difference presumably introduced while fixing a merge conflict.

Bug: 17549448
Change-Id: If688330bf1dbaed23ba687d843d9744d6261023b
2014-09-17 15:25:35 -07:00
Elliott Hughes
2ad11a96a1 Fix some 32-bit-isms in <stdio.h>.
(cherry-pick of 2d80400a9e8454038a3ec29959436184be0c4c65.)

Bug: 17157793
Change-Id: I8290e240b92e5617f4c12c0eacad6e622e677b6a
2014-09-17 15:21:10 -07:00
Christopher Ferris
e2d86feb7b Pull input.h from v3.16.1 kernel headers.
(cherry-pick of 027d2717d067c3706f22bf84dc1226ede7c1566d.)

Bug: 17407564
Change-Id: Idcfc40a7254605280e3d5474c61ae1ab7b2b7b51
2014-09-17 15:18:21 -07:00
Elliott Hughes
21ce3f506f More cases where libc should use O_CLOEXEC.
Change-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0
(cherry picked from commit f73183f1a3)
2014-09-17 15:13:35 -07:00
Dan Albert
ebb6b4a4d3 Hide ScopedTrace.
(cherry-pick of f2c1e7ee78a167ff323b9f45d20532d064d6778d.)

Bug: 11156955
Change-Id: I6cddc868d1c6503e30f1ffcf460f45670631d64a
2014-09-17 15:11:25 -07:00
Elliott Hughes
9e87f2f876 Revert "Revert "Added a bionic systrace class and tracing to pthread_mutex.cpp.""
This reverts commit 26c1420fbb.
2014-09-17 14:59:24 -07:00
Dan Albert
3ec67de051 Exclude libstdc++ from linked libraries.
Also explicitly add libstdc++ includes for necessary targets.

Change-Id: If712ba0ae7908d8147a69e29da5c453a183d6540
2014-09-17 14:22:36 -07:00
Elliott Hughes
39f4686461 am 36a5aa05: Merge "Use the kernel\'s sa_restorer for aarch64."
* commit '36a5aa057cf1738577754a3fc16a14a5f817109f':
  Use the kernel's sa_restorer for aarch64.
2014-09-17 17:17:14 +00:00
Elliott Hughes
36a5aa057c Merge "Use the kernel's sa_restorer for aarch64." 2014-09-17 17:04:40 +00:00
Elliott Hughes
0bbd77af89 am 56433ee2: Merge "Clean up the architecture-specific makefiles."
* commit '56433ee2a2ccc097ac3ad753168722b0fc76f3b1':
  Clean up the architecture-specific makefiles.
2014-09-17 17:00:39 +00:00
Elliott Hughes
7c02d9428c Clean up the architecture-specific makefiles.
Group things appropriately and name each group.

Change-Id: I0da45eb0ccde19c31d5e984d0e6eb3dad26630dc
2014-09-16 19:06:31 -07:00
Elliott Hughes
894f7f5819 am 17cc8e53: Merge "No arm source refers to SOFTFLOAT."
* commit '17cc8e539a578184662c1966a60f37c7d4fed65e':
  No arm source refers to SOFTFLOAT.
2014-09-17 00:07:22 +00:00
Elliott Hughes
b1a6c319c4 No arm source refers to SOFTFLOAT.
So why bother #defining it?

Change-Id: I539e91916cee082cacac594ddf628419b737fa9d
2014-09-16 16:27:35 -07:00
Elliott Hughes
1cff9a8964 Use the kernel's sa_restorer for aarch64.
gdb was happy with what we had, but libgcc and libunwind weren't.
libgcc is happy with the kernel's restorer (because of the extra nop),
though libunwind looks like it's going to need code changes regardless.

We could make our restorer more like the kernel's one, but why bother
when we can just let the kernel supply the canonical one?

Bug: 17436734
Change-Id: I330fa5e68f23b1cf8133aa552896657b0b873ed3
2014-09-16 15:49:50 -07:00
Elliott Hughes
67c12a8392 am 380a3be7: Merge "Fix 32-bit arm unwinding through signal frames."
* commit '380a3be757b04378edecad6ecb96017d2ec6a8b9':
  Fix 32-bit arm unwinding through signal frames.
2014-09-16 22:13:34 +00:00
Elliott Hughes
148dff3ec6 Fix 32-bit arm unwinding through signal frames.
gdb was already okay; libgcc and libunwind need a little extra help.

Bug: 17436734
Change-Id: I1f5108f9877373be078554a1ea4938aa4436204e
2014-09-16 14:10:53 -07:00
Elliott Hughes
ca2d1258fc am 5cba3c6f: Merge "Fix signal trampolines."
* commit '5cba3c6f8e571cd4e6e2468263b778a90331101f':
  Fix signal trampolines.
2014-09-16 19:42:51 +00:00
Elliott Hughes
36f451a6d9 Fix signal trampolines.
* LP32 should use sa_restorer too. gdb expects this, and future (>= 3.15) x86
  kernels will apparently stop supporting the case where SA_RESTORER isn't
  set.

* gdb and libunwind care about the exact instruction sequences, so we need to
  modify the code slightly in a few cases to match what they're looking for.

* gdb also cares about the exact function names (for some architectures),
  so we need to use __restore and __restore_rt rather than __sigreturn and
  __rt_sigreturn.

* It's possible that we don't have a VDSO; dl_iterate_phdr shouldn't assume
  that getauxval(AT_SYSINFO_EHDR) will return a non-null pointer.

This fixes unwinding through a signal handler in gdb for all architectures.
It doesn't fix libunwind for arm and arm64. I'll keep investigating that...

Bug: 17436734
Change-Id: Ic1ea1184db6655c5d96180dc07bcc09628e647cb
2014-09-15 15:04:14 -07:00
Elliott Hughes
b104f0c438 am 95b0c6a9: Merge "POSIX says <signal.h> gets you ucontext_t."
* commit '95b0c6a9407d7a4084d956e273ad1697550452d3':
  POSIX says <signal.h> gets you ucontext_t.
2014-09-15 22:02:31 +00:00
Elliott Hughes
95b0c6a940 Merge "POSIX says <signal.h> gets you ucontext_t." 2014-09-15 17:17:37 +00:00
Christopher Ferris
07ce976788 am 027d2717: Pull input.h from v3.16.1 kernel headers.
* commit '027d2717d067c3706f22bf84dc1226ede7c1566d':
  Pull input.h from v3.16.1 kernel headers.
2014-09-14 19:51:38 +00:00
Christopher Ferris
027d2717d0 Pull input.h from v3.16.1 kernel headers.
Bug: 17407564
Change-Id: Idcfc40a7254605280e3d5474c61ae1ab7b2b7b51
2014-09-14 12:08:37 -07:00
Elliott Hughes
35981194d8 am 85ef3b5b: Merge "Update NOTICE files."
* commit '85ef3b5b80da353afa24d0ab21c35be01951e0b7':
  Update NOTICE files.
2014-09-13 17:23:58 +00:00
Elliott Hughes
79f40ff929 am ae51accf: Merge "Remove an unused file."
* commit 'ae51accf22a897eecda329202431faa11e0f6015':
  Remove an unused file.
2014-09-13 17:23:57 +00:00
Elliott Hughes
85ef3b5b80 Merge "Update NOTICE files." 2014-09-13 17:01:08 +00:00
Elliott Hughes
5c2264a136 Update NOTICE files.
Change-Id: I37a2c297b318b8e1b1ce8b29a7ccc58ba214708a
2014-09-13 09:42:41 -07:00
Elliott Hughes
5681fe8eae Remove an unused file.
Also remove a reference to it and two other files that have already
been removed in a script --- these files were problematic because they
weren't UTF-8.

Change-Id: Ibf597bac1903c34d8d0fe0a09615c42f24d4f23d
2014-09-13 09:24:28 -07:00
Elliott Hughes
26a8eb50a8 POSIX says <signal.h> gets you ucontext_t.
POSIX also says that ucontext_t's uc_sigmask has type sigset_t.

MIPS64 strace needs this.

The #define is to keep chromium off our lawn; otherwise it tries to redefine
all this stuff itself. We should probably clean that up and remove the #define.

Change-Id: I765d6a765a33dca7db33cd8c40f408dc98e5c95b
2014-09-12 20:47:35 -07:00
Elliott Hughes
934028eba3 am 73d2059f: Merge "Explain why clock(3) isn\'t broken."
* commit '73d2059f9b3f53446e25d800d64a86efb3bf3f9f':
  Explain why clock(3) isn't broken.
2014-09-13 00:16:26 +00:00
Elliott Hughes
f83c208b82 Explain why clock(3) isn't broken.
Bug: 17441123
Change-Id: I6ee9b7f54bab55b1a8760ce9bcaaa6eab1dcc492
2014-09-12 16:33:37 -07:00
Elliott Hughes
ecd6be3bd2 am e39e47c6: Merge "Remove "private/bionic_pthread.h"."
* commit 'e39e47c6b377170d696c6b9b5b523a28c1382ca4':
  Remove "private/bionic_pthread.h".
2014-09-12 20:08:45 +00:00
Dmitriy Ivanov
bb5e2968ca am 66bbf159: Merge "Refactoring: C++11 style DISABLE_ bionic marcos"
* commit '66bbf1595c0fc25d4bc47457d8020b11e135996d':
  Refactoring: C++11 style DISABLE_ bionic marcos
2014-09-12 20:08:41 +00:00
Elliott Hughes
0f001b67fe Remove "private/bionic_pthread.h".
Bug: 17476168
Change-Id: Id642987e641de81e914a28daea4ffe9d11e090ed
2014-09-12 11:35:05 -07:00
Dmitriy Ivanov
66bbf1595c Merge "Refactoring: C++11 style DISABLE_ bionic marcos" 2014-09-12 16:50:05 +00:00
Dmitriy Ivanov
5a6e31c3cb am 6487f0d8: Merge "Add IFUNC support for arm64 and IRELATIVE reloc"
* commit '6487f0d8341b00b476995e0174dc92e5ae8efbbe':
  Add IFUNC support for arm64 and IRELATIVE reloc
2014-09-12 05:59:16 +00:00
Elliott Hughes
da7fe217d8 am 7e00b44e: Expose __swsetup for LP32 binary compatibility.
* commit '7e00b44e80d6e38b8ab86d0ebc86b666c0ac2ef6':
  Expose __swsetup for LP32 binary compatibility.
2014-09-12 05:48:54 +00:00
Elliott Hughes
66265e80a1 am 27efc488: Add pthread_gettid_np and re-expose __get_thread for LP32.
* commit '27efc48814b8153c55cbcd0af5d9add824816e69':
  Add pthread_gettid_np and re-expose __get_thread for LP32.
2014-09-12 05:48:52 +00:00
Elliott Hughes
5f35710fad Expose __swsetup for LP32 binary compatibility.
(cherry-pick of 7e00b44e80d6e38b8ab86d0ebc86b666c0ac2ef6.)

Bug: 17476127
Change-Id: I0ef1355ac913d782c268a638f88642d6cfc236c2
2014-09-11 18:23:46 -07:00
Dmitriy Ivanov
6487f0d834 Merge "Add IFUNC support for arm64 and IRELATIVE reloc" 2014-09-12 00:40:12 +00:00
Elliott Hughes
7e00b44e80 Expose __swsetup for LP32 binary compatibility.
Bug: 17476127
Change-Id: I0ef1355ac913d782c268a638f88642d6cfc236c2
2014-09-11 16:41:11 -07:00
Dmitriy Ivanov
9aea164457 Add IFUNC support for arm64 and IRELATIVE reloc
There are number of changes in the way IFUNC related relocations are done:
 1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
 2. IFUNC relocations are now relying on static linker to generate
    them in correct order - this removes necessety of additional
    relocation pass for ifuncs.
 3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
 4. Ifunc are resolved on symbol lookup this approach allowed to avoid
    mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284
Change-Id: I414dd3e82bd47cc03442c5dfc7c279949aec51ed
2014-09-11 16:30:45 -07:00
Elliott Hughes
a4831cb4a3 Add pthread_gettid_np and re-expose __get_thread for LP32.
A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.

(cherry-pick of 27efc48814b8153c55cbcd0af5d9add824816e69.)

Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
2014-09-11 16:22:50 -07:00
Elliott Hughes
27efc48814 Add pthread_gettid_np and re-expose __get_thread for LP32.
A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.

Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
2014-09-11 16:11:43 -07:00
Elliott Hughes
5691dcfc0d am ea66004c: Merge "Fix mips __fadvise64.S build failure."
* commit 'ea66004c4a051e40c49314d808e7359634f6c641':
  Fix mips __fadvise64.S build failure.
2014-09-11 17:32:03 +00:00
Elliott Hughes
9e833bf0cf Fix mips __fadvise64.S build failure.
Bug: 12449798

(cherry picked from commit 9990b3973b)

Change-Id: Iba92e2aa262666a59fc38b870dfd9f4082eeb628
2014-09-11 10:15:14 -07:00
Elliott Hughes
9990b3973b Fix mips __fadvise64.S build failure.
Bug: 12449798
Change-Id: I0663b741108ba2f1d286904d6414b3ff4d475551
2014-09-11 10:10:08 -07:00
Elliott Hughes
db1e958109 am 33df10f2: Merge "Add posix_fadvise(3)."
* commit '33df10f284a8adbf58f9734c0f43537db4206b2c':
  Add posix_fadvise(3).
2014-09-11 15:58:49 +00:00
Elliott Hughes
b587f339db Add posix_fadvise(3).
(cherry-pick of 00008263782e484020420c606f7d145fe7d0a4d8.)

Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
2014-09-11 08:45:46 -07:00
Elliott Hughes
176c32787c Merge "Add posix_fadvise(3)." into lmp-dev 2014-09-11 15:43:05 +00:00
Elliott Hughes
0000826378 Add posix_fadvise(3).
Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
2014-09-10 20:30:23 -07:00
Lorenzo Colitti
33a73bfa07 When comparing DNS server configs, also compare number of servers
Bug: 16070602
Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
2014-09-11 08:36:12 +09:00
Lorenzo Colitti
da0ed4cbfa am c71483c0: Merge "When comparing DNS server configs, also compare number of servers"
* commit 'c71483c0b38a6b4f2675f0bffa221dcf175c34ac':
  When comparing DNS server configs, also compare number of servers
2014-09-09 10:42:23 +00:00
Lorenzo Colitti
c71483c0b3 Merge "When comparing DNS server configs, also compare number of servers" 2014-09-09 10:22:18 +00:00
Lorenzo Colitti
bce18c9163 When comparing DNS server configs, also compare number of servers
Bug: 16070602
Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
2014-09-09 19:20:26 +09:00
Dmitriy Ivanov
06bd5e2d0a am 3c3624f3: Merge "Load libraries in breadth-first order"
* commit '3c3624f3df14590e7213d35c3b39a0a11c7d2d34':
  Load libraries in breadth-first order
2014-09-09 01:11:41 +00:00
Dmitriy Ivanov
d9ff722661 Refactoring: C++11 style DISABLE_ bionic marcos
Enable the -std=gnu++11 flag for libstdc++ static and
  dynamic libs.

  ScopeGuard uses DISABLE_ macros instead of '= delete';

Change-Id: I07e21b306f95fffd49345f7fa136cfdac61e0225
2014-09-08 17:51:31 -07:00
Dmitriy Ivanov
3c3624f3df Merge "Load libraries in breadth-first order" 2014-09-09 00:49:38 +00:00
Elliott Hughes
011e111d29 Ensure __set_errno is still visible on LP32.
The use of the .hidden directive to avoid going via the PLT for
__set_errno had the side-effect of actually making __set_errno
hidden (which is odd because assembler directives don't usually
affect symbols defined in a different file --- you can't even
create a weak reference to a symbol that's defined in a different
file).

This change switches the system call stubs over to a new always-hidden
__set_errno_internal and has a visible __set_errno on LP32 just for
binary compatibility with old NDK apps.

(cherry-pick of 7efad83d430f4d824f2aaa75edea5106f6ff8aae.)

Bug: 17423135
Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
2014-09-08 16:46:50 -07:00
Elliott Hughes
cf5fc80c3e Don't expose non-standard basename_r and dirname_r in LP64.
(cherry-pick of f0e9458ea596227720fa745df15f5357f6c0c8f6.)

Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
2014-09-08 16:44:48 -07:00
Elliott Hughes
938473a7f0 resolved conflicts for merge of 7efad83d to lmp-dev-plus-aosp
Change-Id: I3994c3c69e187e08d69642e097de14b5040c5b3b
2014-09-08 16:21:24 -07:00
Elliott Hughes
7efad83d43 Ensure __set_errno is still visible on LP32.
The use of the .hidden directive to avoid going via the PLT for
__set_errno had the side-effect of actually making __set_errno
hidden (which is odd because assembler directives don't usually
affect symbols defined in a different file --- you can't even
create a weak reference to a symbol that's defined in a different
file).

This change switches the system call stubs over to a new always-hidden
__set_errno_internal and has a visible __set_errno on LP32 just for
binary compatibility with old NDK apps.

Bug: 17423135
Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
2014-09-08 15:36:21 -07:00
Dmitriy Ivanov
14669a939d Load libraries in breadth-first order
This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
2014-09-08 13:02:50 -07:00
Elliott Hughes
08df25419f resolved conflicts for merge of c8f6b82f to lmp-dev-plus-aosp
Change-Id: I03a4645eb5fbb54e41da25018729b270ba0ed48e
2014-09-08 11:41:30 -07:00
Elliott Hughes
ffa8672bd5 am d3d89f0d: Merge "Add arc4random_addrandom binary compatibility."
* commit 'd3d89f0d28aba2db9f11cc0a9b3a865fa1d9d265':
  Add arc4random_addrandom binary compatibility.
2014-09-08 18:11:52 +00:00
Elliott Hughes
c8f6b82f87 Merge "Don't expose non-standard basename_r and dirname_r in LP64." into lmp-dev 2014-09-08 18:07:08 +00:00
Elliott Hughes
fc829736e1 Add arc4random_addrandom binary compatibility.
This was in <stdlib.h> in older releases. It's no longer used, but we can
preserve backwards compatibility by making it a no-op.

(cherry-pick of 51c8355d5cf4b83ccd2ad250ca4c61a616356c2b.)

Bug: 16205834
Change-Id: Idde7b46df4f253e39675600bcf82352879a716e7
2014-09-08 10:52:28 -07:00
Elliott Hughes
51c8355d5c Add arc4random_addrandom binary compatibility.
This was in <stdlib.h> in older releases. It's no longer used, but we can
preserve backwards compatibility by making it a no-op.

Bug: 16205834
Change-Id: Idde7b46df4f253e39675600bcf82352879a716e7
2014-09-08 10:47:45 -07:00
Christopher Ferris
eb1dd673ec am 47ed03f7: Merge "Add dlmalloc_usable_size for 32 bit arches." into lmp-dev
* commit '47ed03f70c6c9addc7f05e4ee4dc71c96d215105':
  Add dlmalloc_usable_size for 32 bit arches.
2014-09-06 20:14:17 +00:00
Christopher Ferris
f903558446 Add dlmalloc_usable_size for 32 bit arches.
Bug: 17337831

(cherry picked from commit 1c365cb494)

Change-Id: Ice100e42eeac4b9c3b77737a546ec33174adcb2f
2014-09-06 13:06:57 -07:00
Christopher Ferris
47ed03f70c Merge "Add dlmalloc_usable_size for 32 bit arches." into lmp-dev 2014-09-06 19:58:40 +00:00
Christopher Ferris
1c365cb494 Add dlmalloc_usable_size for 32 bit arches.
Bug: 17337831
Change-Id: I50c50559a5dfa083c85f064042bc0726718c988b
2014-09-05 18:37:30 -07:00
Dmitriy Ivanov
2a0105f95d am 320a01d5: Merge "Revert "Load libraries in breadth-first order""
* commit '320a01d51693408dad859094ca52e5f315ff1d15':
  Revert "Load libraries in breadth-first order"
2014-09-05 23:58:07 +00:00
Dmitriy Ivanov
498eb18b82 Revert "Load libraries in breadth-first order"
This reverts commit a3ad450a2e.

Change-Id: Ia2b838ad2159c643b80c514849582f4b4f4f40e5
2014-09-05 16:27:54 -07:00
Elliott Hughes
f0e9458ea5 Don't expose non-standard basename_r and dirname_r in LP64.
Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
2014-09-05 16:12:42 -07:00
Chih-Hung Hsieh
1325d50c72 am 8adace5f: Merge "Enable clang compilation with libc but not linker."
* commit '8adace5f2c185bd616f79159eaf90d2982157069':
  Enable clang compilation with libc but not linker.
2014-09-05 19:11:06 +00:00
Chih-Hung Hsieh
8adace5f2c Merge "Enable clang compilation with libc but not linker." 2014-09-05 18:54:48 +00:00
Chih-Hung Hsieh
b58db8b083 Enable clang compilation with libc but not linker.
Clang is still disabled for x86 and x86_64 long double code,
for x86_64 special assembly instruction, and the linker module.

BUG: 17163651
BUG: 17302991
BUG: 17403674
Change-Id: I43c5f5f0ddc0c2a31918f00b57150dadd8f3f26b
2014-09-05 11:18:35 -07:00
Elliott Hughes
5beddb7d64 Fix pthread_attr_getstack__main_thread.
There were two problems here:

* This would fail when run with unlimited stack, because it didn't know
  that bionic reports unlimited stacks as 8MiB.

* This would leave RLIMIT_STACK small, causing failures to exec (so the
  popen and system tests would fail).

(cherry-pick of 27a9aed819 plus the
new ScopeGuard.h from a3ad450a2e3fb6b3fe359683b247eba20896f646.)

Bug: 17394276
Change-Id: I5b92dc64ca089400223b2d9a3743e9b9d57c1bc2
2014-09-04 20:34:03 -07:00
Dmitriy Ivanov
4effe38ae6 am 44352f5f: Merge "Revert "Register __libc_fini as early as possible.""
* commit '44352f5f7f06ff9383d695b0a7d4243f5268f430':
  Revert "Register __libc_fini as early as possible."
2014-09-04 23:22:37 +00:00
Dmitriy Ivanov
24d40f2df0 am c0cd9ce5: Merge "Revert "Fix arm64 build""
* commit 'c0cd9ce5df753161aabb393420a8ada8f369b551':
  Revert "Fix arm64 build"
2014-09-04 23:22:37 +00:00
Elliott Hughes
ac5c111924 am 05f0bfd6: Merge "Don\'t mask out SA_RESTORER from sa_flags."
* commit '05f0bfd6c56746aa4f737804ebb62b555dc0d921':
  Don't mask out SA_RESTORER from sa_flags.
2014-09-04 22:20:50 +00:00
Dmitriy Ivanov
44352f5f7f Merge "Revert "Register __libc_fini as early as possible."" 2014-09-04 21:55:59 +00:00
Dmitriy Ivanov
c0cd9ce5df Merge "Revert "Fix arm64 build"" 2014-09-04 21:55:55 +00:00
Dmitriy Ivanov
4b41555ba5 Revert "Register __libc_fini as early as possible."
This reverts commit e880c736d6.

Change-Id: Ide83e442eb5dbfef5298a15bc602c3fe1dda1862
2014-09-04 21:54:34 +00:00
Dmitriy Ivanov
f0d8970435 Revert "Fix arm64 build"
This reverts commit 5c1a7fdbd5.

Change-Id: Ia5fea0d6a8f59700edce0742e2271b5f02a5d87c
2014-09-04 21:53:14 +00:00
Elliott Hughes
afe58ad989 Don't mask out SA_RESTORER from sa_flags.
glibc doesn't do this, and we probably shouldn't either.

Bug: 16703540
Change-Id: Id5b93c3782e34024a9916463348e8f3caff191bf
2014-09-04 13:54:42 -07:00
Elliott Hughes
32dc56a1ca am 071bed80: Merge "_GNU_SOURCE implies _BSD_SOURCE and the latest _POSIX_C_SOURCE."
* commit '071bed8091cab4e070a1f5e6b2eb0dd1141f0498':
  _GNU_SOURCE implies _BSD_SOURCE and the latest _POSIX_C_SOURCE.
2014-09-04 17:16:01 +00:00
Elliott Hughes
fc8974b7aa _GNU_SOURCE implies _BSD_SOURCE and the latest _POSIX_C_SOURCE.
This showed up as open_memstream not being visible in <stdio.h>
if only _GNU_SOURCE was defined.

Bug: 17361504
Change-Id: I38f9843f4e6ee770a6325ad50f779bda5495ffca
2014-09-04 08:53:16 -07:00
Dmitriy Ivanov
04ecc77df6 am 1737b159: Merge "Load libraries in breadth-first order"
* commit '1737b159374468a21859d97d8be70a726af0ec9e':
  Load libraries in breadth-first order
2014-09-04 01:48:48 +00:00
Dmitriy Ivanov
1737b15937 Merge "Load libraries in breadth-first order" 2014-09-04 00:59:23 +00:00
Dmitriy Ivanov
f851d60c13 am 8f3b8f52: Merge "Fix arm64 build"
* commit '8f3b8f523ed594b48d28ca0b9a2651d209f29e26':
  Fix arm64 build
2014-09-03 23:47:01 +00:00
Elliott Hughes
d05ad93003 am 58bb54c3: Merge "Add back a dummy arc4random_stir for compatibility."
* commit '58bb54c38bf31fa5cdad8ddbdc44bbed04aaf0cf':
  Add back a dummy arc4random_stir for compatibility.
2014-09-03 23:47:00 +00:00
Dmitriy Ivanov
8f3b8f523e Merge "Fix arm64 build" 2014-09-03 23:36:35 +00:00
Dmitriy Ivanov
5c1a7fdbd5 Fix arm64 build
Bug: 14611536
Change-Id: I4f7f4d1f5c0a37ef38fa0956778393f8d7668512
2014-09-03 16:33:08 -07:00
Elliott Hughes
5dea47221a Add back a dummy arc4random_stir for compatibility.
The current arc4random implementation stirs itself as needed, but we
need to keep an arc4random_stir symbol around for binary compatibility.

(cherry-pick of 1e010d60397db706cd3d1c4d5701a2bced441aa8.)

Bug: 17291075
Change-Id: Iaf6171c3ec65c39c1868364d5b35ea280e29a363
2014-09-03 16:30:22 -07:00
Elliott Hughes
1e010d6039 Add back a dummy arc4random_stir for compatibility.
The current arc4random implementation stirs itself as needed, but we
need to keep an arc4random_stir symbol around for binary compatibility.

Bug: 17291075
Change-Id: Iaf6171c3ec65c39c1868364d5b35ea280e29a363
2014-09-03 15:53:11 -07:00
Dmitriy Ivanov
bd00ae8992 am 450aaa01: Merge "Register __libc_fini as early as possible."
* commit '450aaa018df19464cb4e01ea3059a2a075ebde52':
  Register __libc_fini as early as possible.
2014-09-03 22:44:15 +00:00
Dmitriy Ivanov
e880c736d6 Register __libc_fini as early as possible.
We want __libc_fini to be called after all the destructors.

Bug: 14611536
Change-Id: Ibb83a94436795ec178fd605fa531ac29608f4a3e
2014-09-03 15:27:29 -07:00
Dmitriy Ivanov
a3ad450a2e Load libraries in breadth-first order
This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: I4cf84c70dbaabe99310230dfda12385ae5401859
2014-09-03 15:06:14 -07:00
Hans Boehm
5c2c544382 am 9ac60bf8: Make stdatomic.h work with gcc4.6 host compiler
* commit '9ac60bf82b1f0e316666b862e9924f90caa60342':
  Make stdatomic.h work with gcc4.6 host compiler
2014-09-03 05:07:24 +00:00
Andreas Gampe
c16f0486fc resolved conflicts for merge of 2b10e2f1 to lmp-dev-plus-aosp
Change-Id: Ia41583773abbbe1f52d72d1e7f4b925e621d28ff
2014-09-02 22:02:48 -07:00
Elliott Hughes
cb093d1f55 Merge "Upgrade bionic to tzdata2014g." into lmp-dev 2014-09-02 21:39:03 +00:00
Elliott Hughes
6c69675423 am ec95a9cf: Merge "MIPS64 syscall() arguments"
* commit 'ec95a9cf11f7c4d2211c61da7ce05262a54409d1':
  MIPS64 syscall() arguments
2014-09-02 21:18:55 +00:00
Chris Dearman
296895f1a9 MIPS64 syscall() arguments
The seventh argument for syscall is passed in a register, not on the stack

Change-Id: Idb69fac77d1f710cff5a3ab4ae1259feb61ae69d
2014-09-02 12:41:01 -07:00
Hans Boehm
9ac60bf82b Make stdatomic.h work with gcc4.6 host compiler
This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea3645 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations.  These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation.  Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

    Bug:16880454
    Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
(cherry picked from commit 32429606bf)
2014-09-02 11:37:02 -07:00
Elliott Hughes
b519ea4903 Upgrade bionic to tzdata2014g.
From the release notes:

  Changes affecting future time stamps

    Turks & Caicos is switching from US eastern time to UTC-4 year-round,
    modeled as a switch from EST/EDT to AST on 2014-11-02 at 02:00.

  Changes affecting past time stamps

    Time in Russia or the USSR before 1926 or so has been corrected by
    a few seconds in the following zones: Asia/Irkutsk,
    Asia/Krasnoyarsk, Asia/Omsk, Asia/Samarkand, Asia/Tbilisi,
    Asia/Vladivostok, Asia/Yakutsk, Europe/Riga, Europe/Samara.  For
    Asia/Yekaterinburg the correction is a few minutes.  (Thanks to
    Vladimir Karpinsky.)

    The Portuguese decree of 1911-05-26 took effect on 1912-01-01.
    This affects 1911 time stamps in Africa/Bissau, Africa/Luanda,
    Atlantic/Azores, and Atlantic/Madeira.  Also, Lisbon's pre-1912
    GMT offset was -0:36:45 (rounded from -0:36:44.68), not -0:36:32.
    (Thanks to Stephen Colebourne for pointing to the decree.)

    Asia/Dhaka ended DST on 2009-12-31 at 24:00, not 23:59.

    A new file 'backzone' contains data which may appeal to
    connoisseurs of old time stamps, although it is out of scope for
    the tz database, is often poorly sourced, and contains some data
    that is known to be incorrect.  The new file is not recommended
    for ordinary use and its entries are not installed by default.
    (Thanks to Lester Caine for the high-quality Jersey, Guernsey, and
    Isle of Man entries.)

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Africa/Bangui, Africa/Brazzaville,
    Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda,
    Africa/Malabo, Africa/Niamey, and Africa/Porto-Novo.

Bug: 17277574

(cherry picked from commit 9685c30a23)

Change-Id: I6120be3a0ec76af2d07ca6f9ea6f83d81d215803
2014-09-02 11:33:16 -07:00
Elliott Hughes
a5d70a4b15 am 4625dd75: Merge "Upgrade bionic to tzdata2014g."
* commit '4625dd751e5f7beb0a9b8ec6a768fc7a2c36367a':
  Upgrade bionic to tzdata2014g.
2014-09-02 18:29:15 +00:00
Hans Boehm
2b10e2f122 Undefine _Atomic before redefining
Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>.  This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

A functional stdatomic.h is a prerequisite for fixing the
following bugs.  This is the middle of 3 AOSP updates to
bionics stdatomic.h that are needded to get there.

Bug:16880454
Bug:16513433

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
(cherry picked from commit 3e4a0099a1)
2014-09-02 10:32:34 -07:00
Hans Boehm
c8cf3513ec Fix, generalize stdatomic.h; improve test.
We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing.  This generalizes the bionic header so that it
can be used directly as the prebuilt header as well.  So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Prerequisite for fixing b/16880454 and

Bug:16513433

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
(cherry picked from commit 00aaea3645)
2014-09-02 10:32:33 -07:00
Elliott Hughes
9685c30a23 Upgrade bionic to tzdata2014g.
From the release notes:

  Changes affecting future time stamps

    Turks & Caicos is switching from US eastern time to UTC-4 year-round,
    modeled as a switch from EST/EDT to AST on 2014-11-02 at 02:00.

  Changes affecting past time stamps

    Time in Russia or the USSR before 1926 or so has been corrected by
    a few seconds in the following zones: Asia/Irkutsk,
    Asia/Krasnoyarsk, Asia/Omsk, Asia/Samarkand, Asia/Tbilisi,
    Asia/Vladivostok, Asia/Yakutsk, Europe/Riga, Europe/Samara.  For
    Asia/Yekaterinburg the correction is a few minutes.  (Thanks to
    Vladimir Karpinsky.)

    The Portuguese decree of 1911-05-26 took effect on 1912-01-01.
    This affects 1911 time stamps in Africa/Bissau, Africa/Luanda,
    Atlantic/Azores, and Atlantic/Madeira.  Also, Lisbon's pre-1912
    GMT offset was -0:36:45 (rounded from -0:36:44.68), not -0:36:32.
    (Thanks to Stephen Colebourne for pointing to the decree.)

    Asia/Dhaka ended DST on 2009-12-31 at 24:00, not 23:59.

    A new file 'backzone' contains data which may appeal to
    connoisseurs of old time stamps, although it is out of scope for
    the tz database, is often poorly sourced, and contains some data
    that is known to be incorrect.  The new file is not recommended
    for ordinary use and its entries are not installed by default.
    (Thanks to Lester Caine for the high-quality Jersey, Guernsey, and
    Isle of Man entries.)

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Africa/Bangui, Africa/Brazzaville,
    Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda,
    Africa/Malabo, Africa/Niamey, and Africa/Porto-Novo.

Bug: 17277574
Change-Id: Idff4a68e927d49bef1e787af534e1b23b5b8a7fb
2014-09-02 09:51:04 -07:00
Hans Boehm
94ea04c50a am e505cc66: Merge "Make stdatomic.h work with gcc4.6 host compiler"
* commit 'e505cc66a6e03f4ba460de3500f8b272421482c1':
  Make stdatomic.h work with gcc4.6 host compiler
2014-08-30 01:25:10 +00:00
Hans Boehm
32429606bf Make stdatomic.h work with gcc4.6 host compiler
This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea3645 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations.  These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation.  Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

    Bug:16880454
    Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
2014-08-29 17:03:26 -07:00
Elliott Hughes
e21a624269 am bbe06e0d: Merge "Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc."
* commit 'bbe06e0da1742e9bdc52d3246ffa9f2ab3ce999a':
  Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
2014-08-29 23:30:14 +00:00
Elliott Hughes
b2eb09a9ed Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
Bug: 16874785

(cherry picked from commit e0c56efddf)

Change-Id: I9c922ba019f648766fc399d1c4e35e789e25acd4
2014-08-29 16:10:57 -07:00
Elliott Hughes
e0c56efddf Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
Bug: 16874785
Change-Id: I8512f8be3fd149d8720c5c3b4657bedd5ce2b1d1
2014-08-29 15:54:11 -07:00
Chih-Hung Hsieh
46623c1cc7 am cc4259ed: Merge "Ignore all __weak_alias in OpenBSD libC."
* commit 'cc4259ed9254ae66f63cacc3ad50963c4058eb1c':
  Ignore all __weak_alias in OpenBSD libC.
2014-08-29 11:39:56 +00:00
Elliott Hughes
cd6657f9ea am 29f06943: Merge "Add GNU-compatible strerror_r."
* commit '29f06943a19ef2271a08f4223f597a3383f0d9c0':
  Add GNU-compatible strerror_r.
2014-08-29 11:39:55 +00:00
Chih-Hung Hsieh
cc4259ed92 Merge "Ignore all __weak_alias in OpenBSD libC." 2014-08-29 03:10:44 +00:00
Elliott Hughes
416d7ddaff Add GNU-compatible strerror_r.
We already had the POSIX strerror_r, but some third-party code defines
_GNU_SOURCE and expects to get the GNU strerror_r instead.

This exposed a bug in the libc internal logging functions where unlike
their standard brethren they wouldn't return the number of bytes they'd
have liked to have written.

Bug: 16243479
Change-Id: I1745752ccbdc569646d34f5071f6df2be066d5f4
2014-08-28 16:37:09 -07:00
Chih-Hung Hsieh
b6b5cb5389 Ignore all __weak_alias in OpenBSD libC.
GCC assembler allows xyz to be redeclared as weak,
by __weak_alias(xyz, _xyz), while _xyz is undefined.
Clang does not like that but silently generates no code.
It will reject its own .s file if the assembly code is saved first.
Since we have no reason to define xyz or _xyz as weak symbol now,
and _xyz is a macro to xyz, we simplify libC to have only
xyz defined as global.

BUG: 17186746
Change-Id: I24b154425838683cae69248cc750c59e26fd5467
2014-08-28 15:10:01 -07:00
Elliott Hughes
9560aaba8f am f4e721dd: Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..."
* commit 'f4e721dd519db89c504c8944763811a3df956b32':
  Have pthread_attr_getstack for the main thread report RLIMIT_STACK...
2014-08-28 00:00:07 +00:00
Elliott Hughes
67f1f3b171 Have pthread_attr_getstack for the main thread report RLIMIT_STACK...
...rather than just what's already mapped in. This seems somewhat
contrary to POSIX's "All pages within the stack described by stackaddr
and stacksize shall be both readable and writable by the thread", but
it's what glibc does.

Bug: 17111575

(cherry picked from commit 9e4ffa7032)

Change-Id: I73f219a569917b2e4546c09436d7ef5231facc07
2014-08-27 16:50:53 -07:00
Elliott Hughes
a0eeb0b69f Merge "Fix pthread_getattr_np for the main thread." into lmp-dev 2014-08-27 23:49:56 +00:00
Elliott Hughes
f4e721dd51 Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..." 2014-08-27 23:43:27 +00:00
Chih-Hung Hsieh
2c449617c3 am fbe9d3df: Merge "Fix strlen function type for mips."
* commit 'fbe9d3dfeb0e09c0e4aa3221aace8249c0efe881':
  Fix strlen function type for mips.
2014-08-27 23:24:27 +00:00
Chih-Hung Hsieh
fbe9d3dfeb Merge "Fix strlen function type for mips." 2014-08-27 23:09:30 +00:00
Chih-Hung Hsieh
15b914c8f3 Fix strlen function type for mips.
Clang complains about incompatible-library-redeclaration.

BUG: 17302369
Change-Id: I3ae36f24846408c6464b84b5bddb1747e1e4a971
2014-08-27 16:00:46 -07:00
Chih-Hung Hsieh
e561e5db73 am 4f8268e3: Merge "Replace ambiguous cmp instruction with cmpl."
* commit '4f8268e38f151724722bcb489c32185a93fd86ba':
  Replace ambiguous cmp instruction with cmpl.
2014-08-27 23:00:09 +00:00
Chih-Hung Hsieh
4f8268e38f Merge "Replace ambiguous cmp instruction with cmpl." 2014-08-27 22:46:07 +00:00
Elliott Hughes
9e4ffa7032 Have pthread_attr_getstack for the main thread report RLIMIT_STACK...
...rather than just what's already mapped in. This seems somewhat
contrary to POSIX's "All pages within the stack described by stackaddr
and stacksize shall be both readable and writable by the thread", but
it's what glibc does.

Bug: 17111575
Change-Id: If9e2dfad9a603c0d0615a8123aacda4946e95b2c
2014-08-27 15:32:01 -07:00
Chih-Hung Hsieh
857fa6b2a3 Replace ambiguous cmp instruction with cmpl.
Clang assembler rejects ambiguous cmp instruction.

BUG: 17302482
Change-Id: I74f49de87464541f9fe6fa288e4093a9fbf37120
2014-08-27 15:04:23 -07:00
Christopher Ferris
b78e60e7b7 Use the default unwind code.
This speeds up the debug malloc code by using the original unwinding code.
The only catch is that it has to link in the libc++ arm unwind code or
there will be crashes when attempting to unwind through libc++ compiled
code.

Bug: 16874447

(cherry picked from commit 3f7635f490)

Change-Id: If8a3821cdd95ed481bb496bf2daab449d13790f8
2014-08-27 13:13:21 -07:00
Elliott Hughes
7a9471d815 am 64ae11ab: Merge "Switch to OpenBSD <err.h> implementation."
* commit '64ae11ab766421fe2c49ebdecb14c36fe0a047fe':
  Switch to OpenBSD <err.h> implementation.
2014-08-27 17:39:28 +00:00
Christopher Ferris
7bad1a90f1 am 3f7635f4: Use the default unwind code.
* commit '3f7635f4906c53fa744731efc35235456b7d93bf':
  Use the default unwind code.
2014-08-27 04:46:05 +00:00
Hans Boehm
3b32ba0e2c am 6bfcefe0: Merge "Undefine _Atomic before redefining"
* commit '6bfcefe02f8fbeec1f6790bd5ebb1fdd5dba1e33':
  Undefine _Atomic before redefining
2014-08-27 00:01:46 +00:00
Elliott Hughes
d961078f2d am 07401c71: Merge "Switch to OpenBSD daemon(3)."
* commit '07401c7136af113304a22f4a8245ef3fc1b6929b':
  Switch to OpenBSD daemon(3).
2014-08-27 00:01:45 +00:00
Elliott Hughes
cc7e5f489f Switch to OpenBSD <err.h> implementation.
Change-Id: Ia950d88871a30f68e74f9ac7dbd87788e128e02f
2014-08-26 17:00:37 -07:00
Elliott Hughes
f975bc2d59 am 7b87d441: Merge "Switch to OpenBSD res_random."
* commit '7b87d441b0f2aa3ad5021ab6bd879a995a1bc2ce':
  Switch to OpenBSD res_random.
2014-08-26 23:41:23 +00:00
Elliott Hughes
06b033942a am 59de803a: Merge "libc should use O_CLOEXEC when opening files for its own use."
* commit '59de803af98a284378303489f614be3e53800b3f':
  libc should use O_CLOEXEC when opening files for its own use.
2014-08-26 23:41:23 +00:00
Hans Boehm
6bfcefe02f Merge "Undefine _Atomic before redefining" 2014-08-26 23:34:49 +00:00
Elliott Hughes
07401c7136 Merge "Switch to OpenBSD daemon(3)." 2014-08-26 23:33:43 +00:00
Elliott Hughes
e5055179fd Switch to OpenBSD daemon(3).
Change-Id: I1fd0be09fdb24aa6f1d945410eba5987f8a949b4
2014-08-26 16:25:19 -07:00
Elliott Hughes
f73183f1a3 More cases where libc should use O_CLOEXEC.
Change-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0
2014-08-26 16:20:59 -07:00
Elliott Hughes
7b87d441b0 Merge "Switch to OpenBSD res_random." 2014-08-26 23:18:04 +00:00
Christopher Ferris
3f7635f490 Use the default unwind code.
This speeds up the debug malloc code by using the original unwinding code.
The only catch is that it has to link in the libc++ arm unwind code or
there will be crashes when attempting to unwind through libc++ compiled
code.

Bug: 16874447
Change-Id: Ifdbbcbd4137d668b25cf3c2bd59535e06ebfa5a7
2014-08-26 16:02:51 -07:00
Hans Boehm
3e4a0099a1 Undefine _Atomic before redefining
Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>.  This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
2014-08-26 15:58:15 -07:00
Elliott Hughes
c674edbf27 libc should use O_CLOEXEC when opening files for its own use.
Change-Id: I159f1d57e0ca090d837f57854fcef5879b8b8248
2014-08-26 15:56:54 -07:00
Elliott Hughes
05409dedcd am c764fb24: Merge "Fix pthread_getattr_np for the main thread."
* commit 'c764fb24ccb47e05d8e140cde5b4111225790ef1':
  Fix pthread_getattr_np for the main thread.
2014-08-26 20:08:44 +00:00
Elliott Hughes
6421823410 Fix pthread_getattr_np for the main thread.
On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>

(cherry picked from commit 57b7a6110e)

Change-Id: I87e679ee1c0db8092f2d1221c8e7c1461545c5a4
2014-08-26 12:55:01 -07:00
Elliott Hughes
c764fb24cc Merge "Fix pthread_getattr_np for the main thread." 2014-08-26 19:53:40 +00:00
Elliott Hughes
57b7a6110e Fix pthread_getattr_np for the main thread.
On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)

It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.

This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.

Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
2014-08-26 10:36:38 -07:00
Chih-Hung Hsieh
a9c435e072 am 9e307af9: Merge "Add standard throw() spec to delete operators."
* commit '9e307af982ea9030849293b5e3307733289e3c2c':
  Add standard throw() spec to delete operators.
2014-08-25 22:29:24 +00:00
Chih-Hung Hsieh
ae558d6b4b Add standard throw() spec to delete operators.
Without these specs, clang will reports mismatch between standard definitions and these declarations/definitions. These specs are ignored when compiled with -fno-exceptions.

BUG: 17136236
Change-Id: I386c712a61dc4fc74dfde45f9ec2d3d037f2e9f1
2014-08-25 21:16:14 +00:00
Hans Boehm
685c722d32 am a4a8c4fe: Merge "Fix, generalize stdatomic.h; improve test."
* commit 'a4a8c4feb8cf3cebf8aceace70e699e128095b5c':
  Fix, generalize stdatomic.h; improve test.
2014-08-22 23:15:54 +00:00
Hans Boehm
a4a8c4feb8 Merge "Fix, generalize stdatomic.h; improve test." 2014-08-22 22:52:31 +00:00
Hans Boehm
00aaea3645 Fix, generalize stdatomic.h; improve test.
We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing.  This generalizes the bionic header so that it
can be used directly as the prebuilt header as well.  So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
2014-08-22 15:50:17 -07:00
Dan Albert
740cf634f7 am 0b9fa4c9: Merge "Fix dlmalloc build."
* commit '0b9fa4c9bff5d3128f120a2008aa6997c7363b49':
  Fix dlmalloc build.
2014-08-22 18:25:06 +00:00
Dan Albert
ef619cc083 Fix dlmalloc build.
Change-Id: Ied542c40867ab443cdd2076bd2e535b00c4854e4
2014-08-22 11:05:48 -07:00
Dan Albert
a2dcd9449e am 4756afe3: Merge "Implement malloc_info(3)."
* commit '4756afe3d5017b50c89761c47f0da17a6799c81e':
  Implement malloc_info(3).
2014-08-22 18:04:08 +00:00
Dan Albert
4756afe3d5 Merge "Implement malloc_info(3)." 2014-08-22 17:39:18 +00:00
Dan Albert
4caa1f0977 Implement malloc_info(3).
Expose jemalloc stats through the malloc_info(3) interface.

Bug: 16874689
Change-Id: I4358ac283002e60ff161107028d1a3fb1e9afb0a
2014-08-22 10:23:12 -07:00
Dan Albert
ab537ae574 am 2e6c5fc4: Merge "Remove _flush_cache(2) for mips64."
* commit '2e6c5fc4e903b6ef58bd94e13e51b3f0aa4689b3':
  Remove _flush_cache(2) for mips64.
2014-08-21 22:12:30 +00:00
Dan Albert
2e6c5fc4e9 Merge "Remove _flush_cache(2) for mips64." 2014-08-21 21:51:42 +00:00
Dmitriy Ivanov
87c5f24e4e am 2bd88d45: Merge "Run constructors before resolving ifunc functions"
* commit '2bd88d450ead2ad8b44a76126c720cf4a9772002':
  Run constructors before resolving ifunc functions
2014-08-21 21:45:24 +00:00
Dmitriy Ivanov
9598b8c415 Run constructors before resolving ifunc functions
Bug: 17177284
Change-Id: I5714b9bc2d1ca8f8711806bfb68da3d524213e99
2014-08-21 14:24:13 -07:00
Dan Albert
47793d6a29 Remove _flush_cache(2) for mips64.
Also remove declaration.

The only user is compiler-rt, and they can replace that call with one to
syscall(2). compiler-rt doesn't currently build on mips64 anyway.

Bug: 11156955
Change-Id: Ieae0ba49c8e7aa50253401fc1d7c2d17bc867d39
2014-08-21 13:32:37 -07:00
Dan Albert
ba8dede858 am 31572118: Merge "__gnu_basename(3) is accounted for."
* commit '3157211849f808f89a7f1465fd60d6b41917ee4f':
  __gnu_basename(3) is accounted for.
2014-08-21 19:33:19 +00:00
Dan Albert
2320b02c7d __gnu_basename(3) is accounted for.
Change-Id: I3836b14a797c4a8d121c6d29d95791ac768257da
2014-08-21 11:36:07 -07:00
Elliott Hughes
d00ce65a16 am 2d80400a: Fix some 32-bit-isms in <stdio.h>.
* commit '2d80400a9e8454038a3ec29959436184be0c4c65':
  Fix some 32-bit-isms in <stdio.h>.
2014-08-21 18:25:59 +00:00
Elliott Hughes
1fa71e6cbb am d5fbc371: Merge "Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream."
* commit 'd5fbc37119ef6cd757ceb449cb071ee03c66590e':
  Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.
2014-08-21 03:11:32 +00:00
Elliott Hughes
6b841db2ba Add POSIX-2008 fmemopen, open_memstream, and open_wmemstream.
Bug: 17164505
Change-Id: I59e28a08ff8b6ab632230b11a5807cfd5278aeb5
2014-08-20 17:03:46 -07:00
Elliott Hughes
ff3adf1632 am b6ed5407: Merge "Simplify _ALIGN_TEXT."
* commit 'b6ed54076abdd337150d7a92a661247b69d26cb4':
  Simplify _ALIGN_TEXT.
2014-08-20 20:54:13 +00:00
Elliott Hughes
1b6b56a9a6 am 7134fc30: Merge "Regenerate "services.h" from /etc/services."
* commit '7134fc30892bff763e7c24ac722151e0777b5409':
  Regenerate "services.h" from /etc/services.
2014-08-20 20:49:21 +00:00
Elliott Hughes
28bd4fd080 am 3bcd414b: Merge "Clean up some of our python scripts."
* commit '3bcd414b78e515482139c7dc3dad8cad3357b374':
  Clean up some of our python scripts.
2014-08-20 20:49:21 +00:00
Elliott Hughes
c64b680066 am 55244a9b: Merge "Add <stdio_ext.h> for elfutils."
* commit '55244a9bdbc661212999655644c374352ae92040':
  Add <stdio_ext.h> for elfutils.
2014-08-20 20:49:14 +00:00
Hans Boehm
c4b55c1221 am b61c5064: Merge "Work around atomic_load(const T*) issues."
* commit 'b61c50647b85b3c33af8ca155e88ec098d9e8cb0':
  Work around atomic_load(const T*) issues.
2014-08-20 20:48:45 +00:00
Elliott Hughes
0e7f8a9e52 Simplify _ALIGN_TEXT.
Bug: 16872067
Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a
2014-08-20 13:11:58 -07:00
Elliott Hughes
2d80400a9e Fix some 32-bit-isms in <stdio.h>.
Bug: 17157793
Change-Id: I8290e240b92e5617f4c12c0eacad6e622e677b6a
2014-08-20 12:14:21 -07:00
Hans Boehm
b61c50647b Merge "Work around atomic_load(const T*) issues." 2014-08-19 22:32:42 +00:00
Elliott Hughes
d61f102bf8 am b9d674c8: Merge "Implement the GNU basename(3) in addition to the POSIX one."
* commit 'b9d674c8ada9c1e9c22b41bc7c89e35f11f4eb1e':
  Implement the GNU basename(3) in addition to the POSIX one.
2014-08-19 22:19:07 +00:00
Hans Boehm
1e8587a479 Work around atomic_load(const T*) issues.
Bug:17067219
Change-Id: I78e753bcf03464f5f05c3f37e394f2727d282589
2014-08-19 14:50:54 -07:00
Elliott Hughes
b8a8d1d68e am c5d6df6f: Merge "Add in_port_t and move it and in_addr_t to the correct header file."
* commit 'c5d6df6f2fe57fd5aadbd9ebb131023234c30a0c':
  Add in_port_t and move it and in_addr_t to the correct header file.
2014-08-19 20:26:45 +00:00
Elliott Hughes
59b5f58522 am 6f4220c4: Merge "Move the meat of <features.h> into <sys/cdefs.h>."
* commit '6f4220c49e90b18a50d36e47cc9287c7593af939':
  Move the meat of <features.h> into <sys/cdefs.h>.
2014-08-19 19:04:24 +00:00
Dan Albert
1506fc178e Expose android_set_abort_message().
Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.

Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab
(cherry picked from commit ce6b1abbb1)
(cherry picked from commit 3a25ab952b)
2014-08-19 18:46:45 +00:00
Dan Albert
f01d69e9de am 2222eae6: Merge "Missing #include <sys/cdefs.h>."
* commit '2222eae61e723d946029899edaf7afcbaa160bb7':
  Missing #include <sys/cdefs.h>.
2014-08-19 18:39:11 +00:00
Elliott Hughes
f00e86209d am 17f83c93: Merge "Remove unused defines from <features.h>."
* commit '17f83c93cbbde3e38a03182931f40b7390061a7d':
  Remove unused defines from <features.h>.
2014-08-19 17:50:01 +00:00
Dan Albert
d971171dfb am 934c8015: Merge "Expose android_set_abort_message()."
* commit '934c8015d515f96c1f97255b48357da922cf626a':
  Expose android_set_abort_message().
2014-08-19 17:32:53 +00:00
Elliott Hughes
ecd48356e3 am e4fcc3ad: Merge "Fix _BSD_SOURCE/__USE_BSD."
* commit 'e4fcc3ad2b2965858571f5fb7d485ceb7e4a8266':
  Fix _BSD_SOURCE/__USE_BSD.
2014-08-19 17:11:21 +00:00
Elliott Hughes
35d226e05d Add in_port_t and move it and in_addr_t to the correct header file.
No one's reported this, but I saw it in an Android port of fuser(1).

We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.

Change-Id: If15edf0cfc32716fa312d7ed97c48321b760d979
2014-08-19 12:43:50 -07:00
Elliott Hughes
2b021e1066 Add <stdio_ext.h> for elfutils.
Bug: 17139679
Change-Id: I1605ac382dbb6f23b2d874dbb9769f3cde4a6a99
2014-08-20 10:23:52 -07:00
Elliott Hughes
09c39d6df0 Implement the GNU basename(3) in addition to the POSIX one.
Code like perf(1) needs this.

Bug: 11860789
Change-Id: I907eb448052a7b165e4012d74303330d32328cb2
2014-08-19 14:30:30 -07:00
Elliott Hughes
6f4220c49e Merge "Move the meat of <features.h> into <sys/cdefs.h>." 2014-08-19 02:44:29 +00:00
Elliott Hughes
f4c948a9e9 Move the meat of <features.h> into <sys/cdefs.h>.
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).

Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
2014-08-19 11:18:20 -07:00
Elliott Hughes
17f83c93cb Merge "Remove unused defines from <features.h>." 2014-08-19 02:44:29 +00:00
Elliott Hughes
f800969d35 Remove unused defines from <features.h>.
Bug: 14659579
Change-Id: I2ab02b13cafe3faad31248b843d39ab2cdbfeb91
2014-08-19 10:07:00 -07:00
Elliott Hughes
b810462028 Fix _BSD_SOURCE/__USE_BSD.
Bug: 14659579
Change-Id: I80ec9584f054c02d1078828f6bca759c42bc1d4c
2014-08-19 09:18:03 -07:00
Elliott Hughes
38ba927c35 am 0baf2ca3: Merge "Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE)."
* commit '0baf2ca34c7d9ec067b1f33bad69782c2dedc231':
  Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
2014-08-19 00:41:14 +00:00
Elliott Hughes
c228979648 am 205cc415: Merge "Improve <sys/cdefs.h>."
* commit '205cc41556d44b104a21bc6839b7ea44f72df9ba':
  Improve <sys/cdefs.h>.
2014-08-18 22:28:12 +00:00
Dan Albert
247e441b0c Resolved conflicts for merge of 6df7b609 to lmp-dev-plus-aosp.
Change-Id: I204e5701031c9ba9cd783c0db58cd51d93a5dc61
2014-08-18 14:58:13 -07:00
Elliott Hughes
205cc41556 Merge "Improve <sys/cdefs.h>." 2014-08-18 21:31:43 +00:00
Elliott Hughes
2cfb4e8e2e Improve <sys/cdefs.h>.
Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.

Lose a bunch of macros that weren't being used.

Lose three dead files from the DNS code.

Change-Id: I3ef645c566b16a52217bc2e68c7d54b37c7c9522
2014-08-18 14:45:42 -07:00
Dan Albert
6df7b60998 Hide C++ stuff in libc. Put it back in libstdc++.
Bug: 17062445
Change-Id: I027b186719654c2865b08c3fa83f90fa00c1e838
(cherry picked from commit fd5ee9aebc)
2014-08-18 13:56:07 -07:00
Dan Albert
2b91cf32e6 am db2e0247: Merge "Hide C++ stuff in libc. Put it back in libstdc++."
* commit 'db2e0247ed67dfdf6e16eb47348db81dc8ccd04d':
  Hide C++ stuff in libc. Put it back in libstdc++.
2014-08-18 20:14:48 +00:00
Christopher Ferris
3d7f92e914 am 9e56ce4c: Merge "Fix leak_realloc, copy entire allocation." into lmp-dev
* commit '9e56ce4cd387cfa45de3a71dcccedd061e09d2f5':
  Fix leak_realloc, copy entire allocation.
2014-08-18 19:33:55 +00:00
Elliott Hughes
c4a1de1ae2 Regenerate "services.h" from /etc/services.
Change-Id: Iec118f9a342b5c1f6ce6d48965798b12a7159ad3
2014-08-20 12:11:31 -07:00
Elliott Hughes
dc1fb7000a Clean up some of our python scripts.
Change-Id: Ifa75345db43434298cfb6113fbe2f7a33b88c79d
2014-08-20 11:16:11 -07:00
Dan Albert
3a25ab952b Missing #include <sys/cdefs.h>.
Needed for __BEGIN_DECLS/__END_DECLS. Currently fine because it's being
included after other files that do this.

Change-Id: I1f12368fc461f6ef5ca90992cf19f317f0b5d7af
2014-08-19 11:08:02 -07:00
Dan Albert
934c8015d5 Merge "Expose android_set_abort_message()." 2014-08-16 04:20:19 +00:00
Dan Albert
ce6b1abbb1 Expose android_set_abort_message().
Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.

Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab
2014-08-18 14:37:42 -07:00
Christopher Ferris
54d24e099c Merge "Fix leak_realloc, copy entire allocation." 2014-08-16 04:08:14 +00:00
Christopher Ferris
6d40d34908 Fix leak_realloc, copy entire allocation.
Bug: 16874447

(cherry picked from commit 5df0839cea)

Change-Id: I9280505c0c1c3b5da24ba590448dcd6e7a230406
2014-08-18 13:10:47 -07:00
Christopher Ferris
5d9e145c62 malloc_usable_size returns the original size.
Bug: 16874447

(cherry picked from commit 59c1ee44d0)

Change-Id: I70839632974367c8b9893fb1f9c5ee4364608470
2014-08-18 13:10:16 -07:00
Christopher Ferris
3c7c9a8d3f Merge "malloc_usable_size returns the original size." 2014-08-16 04:09:33 +00:00
Dan Albert
fd5ee9aebc Hide C++ stuff in libc. Put it back in libstdc++.
Bug: 17062445
Change-Id: I027b186719654c2865b08c3fa83f90fa00c1e838
2014-08-18 12:01:01 -07:00
Elliott Hughes
5f5cc45cf0 Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).

Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
2014-08-18 16:04:03 -07:00
Christopher Ferris
9e56ce4cd3 Merge "Fix leak_realloc, copy entire allocation." into lmp-dev 2014-08-16 04:01:11 +00:00
Christopher Ferris
5df0839cea Fix leak_realloc, copy entire allocation.
Bug: 16874447
Change-Id: Ie54a73fd75529961195fa5173d9116d0ae897b03
2014-08-15 18:55:53 -07:00
Hans Boehm
f0f66c0264 Have stdatomic.h punt to C++ atomic when possible
This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another.  We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.

Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc
(cherry picked from commit 019d395811)
2014-08-15 11:42:36 -07:00
Hans Boehm
e9c7a4528c am 7d05f741: Merge "Have stdatomic.h punt to C++ atomic when possible"
* commit '7d05f741e7885ad42f853b5fe2b1d31cdc756b5c':
  Have stdatomic.h punt to C++ atomic when possible
2014-08-15 18:27:38 +00:00
Christopher Ferris
c3731ea8fd am 0533195e: Merge "malloc_usable_size returns the original size." into lmp-dev
* commit '0533195e16b86794f14dfb1800ca170ce2548b9f':
  malloc_usable_size returns the original size.
2014-08-15 11:36:56 +00:00
Hans Boehm
7d05f741e7 Merge "Have stdatomic.h punt to C++ atomic when possible" 2014-08-15 05:01:31 +00:00
Hans Boehm
019d395811 Have stdatomic.h punt to C++ atomic when possible
This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another.  We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.

Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc
2014-08-15 10:38:20 -07:00
Dan Albert
3dbab7a709 am d0cce143: Merge "Move mtctxres.c to libc_dns.a."
* commit 'd0cce1436435bfcb477f2c5a670ea6675473c2f8':
  Move mtctxres.c to libc_dns.a.
2014-08-14 23:28:19 +00:00
Dan Albert
49af4264ab am 0d4ccee3: Merge "Change name of MB_CUR_MAX implementation function."
* commit '0d4ccee35101c6bcd6cc28c23fe79d7b48a98dd0':
  Change name of MB_CUR_MAX implementation function.
2014-08-14 21:31:21 +00:00
Dan Albert
72de50139d am 104a4729: Merge "Add more functionality to glibc symbol checker."
* commit '104a472958f86eafafe0c1d9e2c58ba6403f99e7':
  Add more functionality to glibc symbol checker.
2014-08-14 21:31:20 +00:00
Dan Albert
e2050ae1aa Merge "Change name of MB_CUR_MAX implementation function." into lmp-dev 2014-08-14 19:49:28 +00:00
Dan Albert
bafee43161 Change name of MB_CUR_MAX implementation function.
Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down
on differences between bionic and glibc.

Bug: 11156955
Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73
2014-08-14 14:01:44 -07:00
Dan Albert
0d4ccee351 Merge "Change name of MB_CUR_MAX implementation function." 2014-08-14 19:41:13 +00:00
Dan Albert
224ff048ef Change name of MB_CUR_MAX implementation function.
Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down
on differences between bionic and glibc.

Bug: 11156955
Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73
2014-08-14 13:56:51 -07:00
Dan Albert
104a472958 Merge "Add more functionality to glibc symbol checker." 2014-08-14 19:41:13 +00:00
Dan Albert
76212eeb53 Add more functionality to glibc symbol checker.
Also scan NDK's unwanted symbols list (to show the things that we're
exporting but the NDK isn't. Symbols hidden in the NDK will be marked
with a *.

Add a -u (--unwanted) flag to disable the first two printed groups
(all symbols in bionic, all symbols in glibc). This is helpful when
wanting to grep in the list of unwanted symbols.

Finally, update the list of known differences between us and glibc.

Change-Id: I6fdb4126823098430454763c391bd8cd369a75bb
2014-08-14 14:02:34 -07:00
Christopher Ferris
0533195e16 Merge "malloc_usable_size returns the original size." into lmp-dev 2014-08-14 16:46:52 +00:00
Christopher Ferris
59c1ee44d0 malloc_usable_size returns the original size.
Bug: 16874447
Change-Id: Ie3ce683fd1f58b837b8ea91dc798e561b8593356
2014-08-14 12:48:04 -07:00
Dan Albert
553c0ea52b Merge "Move mtctxres.c to libc_dns.a." into lmp-dev 2014-08-14 16:46:52 +00:00
Dan Albert
9f533972ae Move mtctxres.c to libc_dns.a.
Has the effect of making ___mtctxres hidden.

Bug: 11156955
Change-Id: I5aa5f49344ad5ecb33f48737430561b329bcbb0d
(cherry picked from commit 891ec7a6e4)
2014-08-14 16:46:22 -07:00
Hans Boehm
faa0a7b788 am 4f85c6ff: Merge "Add memory ordering constraint, convert to C11 atomics"
* commit '4f85c6ffd31d1f8cc000ab326edd8edb7ecd55a9':
  Add memory ordering constraint, convert to C11 atomics
2014-08-14 01:21:44 +00:00
Dmitriy Ivanov
4bea4c631f Label pages mapped by linker_allocator
(cherry picked from commit 51a22a12ab)

Bug: 17013324
Change-Id: I345c9d0fecc29d3626c5be01cc3c0ed1583ac361
2014-08-13 18:15:29 -07:00
Dmitriy Ivanov
63ea43de8f am e942b3ed: Merge "Added test for ifunc support in dynamic linker."
* commit 'e942b3ed81ad4e0161f3ffa4f8d0017bfbb750e2':
  Added test for ifunc support in dynamic linker.
2014-08-14 00:36:41 +00:00
Dan Albert
0733727194 am 9a74e4c1: Merge "Hide __libc_init_vdso()."
* commit '9a74e4c15c17b9126ad348d865002880fc36bd12':
  Hide __libc_init_vdso().
2014-08-13 23:05:11 +00:00
Dan Albert
25b55a09f6 am 6e3823d3: Merge "Hide __libc_malloc_dispatch."
* commit '6e3823d37e54929558990d7c475bc30d381098fe':
  Hide __libc_malloc_dispatch.
2014-08-13 00:02:04 +00:00
Dan Albert
d332bc6878 Hide __libc_malloc_dispatch.
Now that -Bsymbolic is fixed, we can hide __libc_malloc_dispatch without
breaking ASAN.

Bug: 11156955
Change-Id: Ia2fc9b046a74e666b33aa6c6c5435f70a63b8021
2014-08-12 16:54:24 -07:00
Dan Albert
9a74e4c15c Merge "Hide __libc_init_vdso()." 2014-08-12 23:11:16 +00:00
Dan Albert
b3aaf398e1 Hide __libc_init_vdso().
Bug: 11156955
Change-Id: I7ee31e1ee2ce479c5746b374a239637d582815fe
2014-08-13 13:11:58 -07:00
Dan Albert
891ec7a6e4 Move mtctxres.c to libc_dns.a.
Has the effect of making ___mtctxres hidden.

Bug: 17007799
Change-Id: I5aa5f49344ad5ecb33f48737430561b329bcbb0d
2014-08-14 22:50:45 +00:00
Hans Boehm
4f85c6ffd3 Merge "Add memory ordering constraint, convert to C11 atomics" 2014-08-12 19:23:43 +00:00
Dmitriy Ivanov
e942b3ed81 Merge "Added test for ifunc support in dynamic linker." 2014-08-12 19:23:43 +00:00
Dan Albert
edd81faff0 Hide __libc_malloc_dispatch.
Now that -Bsymbolic is fixed, we can hide __libc_malloc_dispatch without
breaking ASAN.

Bug: 11156955
Change-Id: Ia2fc9b046a74e666b33aa6c6c5435f70a63b8021
2014-08-12 16:53:14 -07:00
Dan Albert
f2c1e7ee78 Hide ScopedTrace.
Bug: 11156955
Change-Id: I6cddc868d1c6503e30f1ffcf460f45670631d64a
2014-08-13 11:25:01 -07:00
Dmitriy Ivanov
ab63b6b067 am 00c16c1b: Merge "Label pages mapped by linker_allocator"
* commit '00c16c1b921dfeab42eb92ac53c6d79addc9f549':
  Label pages mapped by linker_allocator
2014-08-11 16:42:25 +00:00
Elliott Hughes
cd2cd65c5f am 4d0f742a: Merge "Fix our x86 PIC_PROLOGUE."
* commit '4d0f742afe4867a0064d46a5b55df33e07c02c9d':
  Fix our x86 PIC_PROLOGUE.
2014-08-10 08:36:55 +00:00
Elliott Hughes
72d7e667c7 Fix our x86 PIC_PROLOGUE.
The old definition only worked for functions that didn't use numbered
local labels. Upstream uses '666' not only as some kind of BSD in-joke,
but also because there's little likelihood of any function having
labels that high.

There's a wider question about whether we actually want to go via the
PLT at all in this code, but that's a question for another day.

Bug: 16906712
Change-Id: I3cd8ecc448b33f942bb6e783931808ef39091489
2014-08-09 18:45:55 -07:00
Elliott Hughes
ca5b6a74a7 Fix our x86 PIC_PROLOGUE.
The old definition only worked for functions that didn't use numbered
local labels. Upstream uses '666' not only as some kind of BSD in-joke,
but also because there's little likelihood of any function having
labels that high.

There's a wider question about whether we actually want to go via the
PLT at all in this code, but that's a question for another day.

(cherry-pick of 72d7e667c7e926cb120c4edb53cbf74c652ab915.)

Bug: 16906712
Change-Id: I3cd8ecc448b33f942bb6e783931808ef39091489
2014-08-09 22:18:33 -07:00
Dmitriy Ivanov
00c16c1b92 Merge "Label pages mapped by linker_allocator" 2014-08-09 00:45:41 +00:00
Dmitriy Ivanov
51a22a12ab Label pages mapped by linker_allocator
Change-Id: I7e0bf29bc1a480e9be0d1ae573ca1063d90d82ff
2014-08-11 09:22:48 -07:00
Dan Albert
f4d21fba06 Merge "Make __set_errno hidden in asm." into lmp-dev 2014-08-09 00:45:27 +00:00
Dan Albert
21588d1f2e am a0db4641: Merge "Make __set_errno hidden in asm."
* commit 'a0db46418757dd1b399acb97ff42083cc274e8ae':
  Make __set_errno hidden in asm.
2014-08-08 22:46:15 +00:00
Dan Albert
287762edb7 am 3788a1ee: Merge "Revert "Fix incorrect relocations for x86.""
* commit '3788a1ee8eae4180117010bb9302334acfe1d218':
  Revert "Fix incorrect relocations for x86."
2014-08-08 22:42:29 +00:00
Dan Albert
e35fd48a83 Make __set_errno hidden in asm.
This fixes the build after the -Bsymbolic change.

Bug: 16853291
Change-Id: I989c9fec3c32e0289ea257a3bd2b7fd2709b6ce2
(cherry picked from commit bc9f9f25bf)
2014-08-08 15:37:50 -07:00
Hans Boehm
30214b901e Add memory ordering constraint, convert to C11 atomics
Add an ordering constraint/fence to __system_property_serial.
This slows down a read on a Nexus 5 from about 50 to about 70 ns,
but avoids the possibility of seeing an inconsistent property value.
Use C11 atomic operations where easy and appropriate.
This code remains not fully C++11 memory model conformant, but
I would now expect the generated code to now be correct with current compilers.

Bug:14970171
Change-Id: I0891ff1d0f914ae5c3857e3d76b6a7c8a4a07d83
2014-08-08 11:34:25 -07:00
Brigid Smith
c5a13efa9b Added test for ifunc support in dynamic linker.
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.

Bug:6657325
Change-Id: Ic0c48b1b0a76cb90f36c20c79f68294cc3fd44a1
2014-08-08 11:29:35 -07:00
Dan Albert
bc9f9f25bf Make __set_errno hidden in asm.
This fixes the build after the -Bsymbolic change.

Bug: 16853291
Change-Id: I989c9fec3c32e0289ea257a3bd2b7fd2709b6ce2
2014-08-08 15:35:47 -07:00
Christopher Ferris
f18203517e am 49de01a5: Add a way to disable backtracing in malloc debug.
* commit '49de01a5be7bfb07baaea7415647d838383e1b59':
  Add a way to disable backtracing in malloc debug.
2014-08-08 16:35:57 +00:00
Elliott Hughes
b763b7d6d5 am f2d8c357: Merge "Remove misleading arm/arm64 PIC_SYM."
* commit 'f2d8c357eec1bbc4e7441942dfc338ad1d9a207a':
  Remove misleading arm/arm64 PIC_SYM.
2014-08-08 16:21:23 +00:00
Christopher Ferris
e2005cdae0 am 92f0c91b: Merge "Create a distinct temp directory for each run."
* commit '92f0c91b82c60788b14062ca032ccc732f0fba4c':
  Create a distinct temp directory for each run.
2014-08-08 07:17:17 +00:00
Christopher Ferris
49de01a5be Add a way to disable backtracing in malloc debug.
The property libc.debug.malloc.nobacktrace set to non-zero disables
getting backtracing when using mode 1 or mode 10.

Bug: 16874447

Change-Id: I7650ba9f4385b5110b743cab01e877fc69545b3c
2014-08-08 00:16:29 -07:00
Dan Albert
d17047ffd6 am cdd2f072: Merge "Fix incorrect relocations for x86."
* commit 'cdd2f072af5c22750e06d1613b72336ecda7e71f':
  Fix incorrect relocations for x86.
2014-08-08 00:23:54 +00:00
Dan Albert
3726f9c38b Revert "Fix incorrect relocations for x86."
Bug: 16853291
This reverts commit 512bc52326.
2014-08-08 22:26:47 +00:00
Elliott Hughes
1636f80b7d am d994622e: Merge "Android is all-PIC/PIE."
* commit 'd994622ebf2c4b7e918d9e1f1840f9df88ee7222':
  Android is all-PIC/PIE.
2014-08-07 18:33:33 +00:00
Elliott Hughes
43227c0b40 Android is all-PIC/PIE.
Clean up the x86/x86_64 assembler. The motivator (other than reducing
confusion) was that asm.h incorrectly checked PIC rather than __PIC__.

Bug: 16823325

(cherry picked from commit 6b6364a7fc)

Change-Id: I89ca57fa0eb34a36de6cb11ea85f71054fce709d
2014-08-07 11:28:34 -07:00
Christopher Ferris
88a1f520d2 Add a way to disable backtracing in malloc debug.
The property libc.debug.malloc.nobacktrace set to non-zero disables
getting backtracing when using mode 1 or mode 10.

Bug: 16874447

(cherry picked from 49de01a5be)

Change-Id: I6bbefe5420b14991fe84c2f849222dcd7cb592bf
2014-08-08 09:40:17 -07:00