Commit graph

5134 commits

Author SHA1 Message Date
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
Elliott Hughes
7b87d441b0 Merge "Switch to OpenBSD res_random." 2014-08-26 23:18:04 +00: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
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