Commit graph

6971 commits

Author SHA1 Message Date
Calin Juravle
837abf0466 Merge "Fix bionic-unit-tests-glibc-run target" 2014-05-07 18:31:11 +00:00
Calin Juravle
0e9d7fccb9 Fix bionic-unit-tests-glibc-run target
Configure multilib for bionic-unit-tests-glibc-run target (the path to
the host executable was already patched to support multilib build but
the multilib itself wasn't configured).

Change-Id: If533fbdb19bc737e543cf85a0787505458f24579
2014-05-07 19:06:30 +01:00
Torne (Richard Coles)
35cff760df Merge "Test that relro sharing actually saves memory." 2014-05-07 15:25:44 +00:00
Calin Juravle
e292875cf5 Merge "Reserve some space in sem_t for the future." 2014-05-07 14:04:32 +00:00
Calin Juravle
b6c48b20e4 Merge "Allow for better utmp logging." 2014-05-07 14:04:22 +00:00
Calin Juravle
fc2af0ca47 Merge "Fix ino_t and suseconds_t" 2014-05-07 14:04:12 +00:00
Calin Juravle
764a888218 Merge "Leave more space for extensions in pthread_rwlockattr_t" 2014-05-07 14:04:01 +00:00
Elliott Hughes
6ad9cd41bc Merge "Change the interface for fatal logging." 2014-05-07 04:04:28 +00:00
Elliott Hughes
c78368f04f Change the interface for fatal logging.
This more general interface lets liblog give us any fatal log message,
regardless of source. This means we can remove the special case for
LOG_ALWAYS_FATAL with a simpler scheme that automatically works for
the VM too.

Change-Id: Ia6dbf7c3dbabf223081bd5159294835d954bb067
2014-05-06 20:37:22 -07:00
Elliott Hughes
e05df25145 Merge "Fix a gethnamaddr.c warning that's already fixed upstream." 2014-05-06 20:42:10 +00:00
Elliott Hughes
89ca3c5aec Merge "Sync with upstream OpenBSD wcsftime.c." 2014-05-06 20:21:03 +00:00
Elliott Hughes
3e5f0c9849 Fix a gethnamaddr.c warning that's already fixed upstream.
We're still way out of sync, but this cleans up a tiny corner.

Change-Id: I51e76601785bf351d6418841b56e08a900a84d82
2014-05-06 11:23:40 -07:00
Elliott Hughes
2716f3e805 Sync with upstream OpenBSD wcsftime.c.
They removed the code nobody wants rather than fix the ""/L"" mixup.
Even better!

Change-Id: Ib4333acf5e90d69586805a218d2894c5dffcb82f
2014-05-06 11:12:34 -07:00
Calin Juravle
6726862e9a Fix ino_t and suseconds_t
Align ino_t and suseconds_t definitions with kernel
and OpenBSD upstream.

Bug: 14583346
Bug: 12875898
Change-Id: I0d97c6b4fc85b261472575290e6f6f2df1c8a36a
2014-05-06 18:41:26 +01:00
Elliott Hughes
100168abff Merge "Fix <math.h> to quieten most of our warnings." 2014-05-06 17:18:16 +00:00
Calin Juravle
0686d5e26f Reserve some space in sem_t for the future.
Reserve 12 more bytes in sem_t to give room for future implementation
improvements. This gets us to a 16 bytes sem_t. Glibc uses 32 bytes (16
actual use + 16 reserved), while OpenBSD has 16 bytes (out of which 4
are for padding).

Bug: 14587103
Bug: 12875898
Change-Id: Id835cc5abf874c651e6b5ad5b8f29c9d6ab08d5a
2014-05-06 16:24:27 +01:00
Calin Juravle
7d8f303353 Allow for better utmp logging.
Increase (UT_NAMESIZE,UT_LINESIZE,UT_HOSTSIZE) to (32,32,256).

Nobody writes utmp on Android but it would be nice to be aligned
with others who use 32,32,256 (like glibc). If ever used it will produce
nicer logging. There is no consensus in BSDs for these values.

Bug: 14584341
Bug: 12875898

Change-Id: I94af10b982b8f9fcaea897c4cf968563f38403f9
2014-05-06 15:44:14 +01:00
Calin Juravle
7b1a95bc76 Merge "Add include guard to fileext.h" 2014-05-06 13:47:19 +00:00
Calin Juravle
7c435f2415 Leave more space for extensions in pthread_rwlockattr_t
Change pthread_rwlockattr_t from int to long. On LP64 this gives us more
room for extensibility since longs are 8 bytes. glibc also reserves 8
bytes for this.

Bug: 14582681
Bug: 12875898
Change-Id: I55d599be0fdbbf0cb55957ec0ea62ab042bdee94
2014-05-06 13:40:24 +01:00
Torne (Richard Coles)
2605261691 Test that relro sharing actually saves memory.
Spawn 20 child processes, have them all load the library, and compare
the total PSS used in the case where we use dlopen() and the case where
we use android_dlopen_ext() with relro sharing. We assume we will save
at least 10% of the memory; in practise this example saves 40% or more
so this should be a reasonable threshold.

Bug: 14299541
Change-Id: Idccf6b8b0eb137abae2200f1ce68fb76b3cbdd75
2014-05-06 11:38:53 +01:00
Torne (Richard Coles)
9b5ee4aa85 Merge "Handle empty relro segment or incorrectly sized file." 2014-05-06 10:16:18 +00:00
Elliott Hughes
9a5a3e8e74 Fix <math.h> to quieten most of our warnings.
I've reported the wcsftime bug upstream, but we really just want to use -D
to ensure the buggy code isn't built. (I've also brought our strftime a bit
closer to upstream now we have the right define.)

I don't think upstream is likely to fix all their sign-compare and
uninitialized warnings, so let's just silence them.

As for libm, again upstream isn't likely to fix all their warnings, and
silencing those made the ones that were our fault stand out. I've fixed
our <math.h> to fix the warnings caused by our lack of definitions for
the non-imprecise long-double functions. I checked the C99 standard, and
all these functions are there.

Change-Id: Iee8e1182c1db375058fb2c451eceb212bab47a37
2014-05-05 21:19:47 -07:00
Elliott Hughes
185dd72a2c Merge "bionic: make epoll_event structure packed" 2014-05-06 02:50:39 +00:00
Philip Hatcher
9ded07cff6 bionic: make epoll_event structure packed
Description: In the kernel the epoll_event structure is packed
in 64 bit kernel builds to allow the structure to be more easily
compatible with 32 bit user space.  As a result, when user space
is 64-bit the structure must be packed as well.

Add unit test to show the ptr alignment issue.

Change-Id: I2c4848d5e38a357219091f350f9b6e3da05090da
Signed-off-by: Philip Hatcher <philip.hatcher@intel.com>
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Reviewed-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
Tested-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
2014-05-05 19:48:55 -07:00
Elliott Hughes
4356adc3f4 Merge "Remove the non-standard time64 stuff for LP64." 2014-05-06 01:53:53 +00:00
Elliott Hughes
52defb7c70 Remove the non-standard time64 stuff for LP64.
We need a workaround in strftime as long as we still need to support
64-bit times on LP32.

Change-Id: I8ffb616f6312d4063fb9ea3c36b52653e8f4c5f8
2014-05-05 17:14:02 -07:00
Elliott Hughes
629d892d0b Merge "Update the NOTICE files and improve the script slightly." 2014-05-05 23:24:00 +00:00
Elliott Hughes
bfa582d032 Update the NOTICE files and improve the script slightly.
Change-Id: Ia131634cd97ca9523e1b63dce41f66247cbaa311
2014-05-05 16:23:15 -07:00
Elliott Hughes
6916166e10 Merge "Sync with upstream OpenBSD." 2014-05-05 22:10:48 +00:00
Elliott Hughes
e0a36f49a9 Sync with upstream OpenBSD.
These trivial differences are are only current differences from upstream
OpenBSD.

Change-Id: Iddbee2c803911915a25e1da8b246e8403fa72daf
2014-05-05 14:57:23 -07:00
Elliott Hughes
ad534985ec Merge "Disable %n in printf and vfwprintf." 2014-05-05 21:49:22 +00:00
Elliott Hughes
e2341d08fa Disable %n in printf and vfwprintf.
Bug: 14492135
Change-Id: If190bede29e5f68a65043ddbe8e878c660933d03
2014-05-05 14:43:17 -07:00
Elliott Hughes
8ec21d9ded Merge "Switch to current upstream OpenBSD wsetup.c." 2014-05-05 21:33:22 +00:00
Elliott Hughes
53b24382f5 Switch to current upstream OpenBSD wsetup.c.
Change-Id: I2c1123f3e1d3c4af7fd7bf354e763934a39b78c0
2014-05-05 14:31:20 -07:00
Dmitriy Ivanov
580b246917 Merge "Fixes for __cxa_finalize" 2014-05-05 21:04:33 +00:00
Dmitriy Ivanov
6b56691a67 Fixes for __cxa_finalize
* Ability to register atexit handler from atexit handler
  * Correct way to handle both forms of atexit handler

Bug: https://code.google.com/p/android/issues/detail?id=66595
Bug: 4998315
Change-Id: I39529afaef97b6e1469c21389d54c0d7d175da28
2014-05-05 11:36:57 -07:00
Elliott Hughes
a334c1ec13 Merge "Fix iswctype." 2014-05-04 03:25:45 +00:00
Elliott Hughes
640b4a5a64 Merge "Switch to current upstream OpenBSD fwrite.c." 2014-05-04 03:20:31 +00:00
Dmitriy Ivanov
2d822ebe7a Merge "Disallow dlopen("egl/blah.so") on LP64" 2014-05-03 01:39:09 +00:00
Elliott Hughes
792ae72e41 Switch to current upstream OpenBSD fwrite.c.
Change-Id: Ife527aafc1e5438f477d711902efe6e6f59f3f8e
2014-05-02 18:22:23 -07:00
Dmitriy Ivanov
5ca7ed9005 Disallow dlopen("egl/blah.so") on LP64
Change-Id: I9a563a9dada6522129b1890bc1292667230e80a5
2014-05-02 18:18:50 -07:00
Elliott Hughes
e987803c35 Merge "Sync with current OpenBSD stdio." 2014-05-03 00:59:06 +00:00
Elliott Hughes
f1ada79a83 Sync with current OpenBSD stdio.
We'd fallen a little behind.

Bug: 14492135
Change-Id: Ic1137ef10bffccecebd5ce51086c23db006d0ea3
2014-05-02 17:56:56 -07:00
Elliott Hughes
c42f5c6fe6 Fix iswctype.
This doesn't matter until we fix the other isw* functions, of course.

Change-Id: I0baed1c933259cf22444da391bc4a56446d66773
2014-05-02 16:25:59 -07:00
Elliott Hughes
d6ff0dcef6 Merge "Use the OpenBSD wcsftime." 2014-05-02 23:00:06 +00:00
Elliott Hughes
efaa461bd6 Use the OpenBSD wcsftime.
Change-Id: I81929355d245ba1e58b4a464ca6cf45915e0238e
2014-05-02 15:57:50 -07:00
Calin Juravle
9287223674 Add include guard to fileext.h
Change-Id: I89b0e3bf0b15989727b5903b40bec92d49e122d9
2014-05-02 17:34:58 +01:00
Torne (Richard Coles)
26ec9679ff Handle empty relro segment or incorrectly sized file.
If the file has no relro segment, the generated relro file will have
length 0, which caused mmap to fail. If the relro file has nonzero size,
but is too short (e.g. because it's for the wrong version of the
library), the linker would segfault while comparing the data. Fix both
these issues: don't try to map a zero length file, and don't try to
compare data that would be beyond the end of the file.

Improve test to explicitly generate two versions of the library: one
with -z relro, and one with -z norelro, so we can test both cases; also
explicitly test the case where the relro file has length 0.

Bug: 14299541
Change-Id: Id8b95585edda90e8bb5de452a35b70ed2d224934
2014-05-02 14:25:45 +01:00
Elliott Hughes
790890fd5c Merge "Fix wchar_t signedness problems found on x86-64." 2014-05-02 02:31:23 +00:00
Elliott Hughes
0d0ccfe2ce Fix wchar_t signedness problems found on x86-64.
The existing tests caught this.

Change-Id: I6269844ae4301fd2c596241a59e97eb67ef166fa
2014-05-01 19:03:18 -07:00