Commit graph

3770 commits

Author SHA1 Message Date
Calin Juravle
4d695bf560 Merge "Align struct passwd definition with other variations of libc" 2014-05-12 09:53:41 +00:00
Elliott Hughes
8eac9af24e Bring in google3-style DISALLOW_* macros.
I've been meaning to do this for a very long time...

Change-Id: Ia8c16eee7c026c3c9505399948485fb778fb0152
2014-05-09 19:12:08 -07:00
Elliott Hughes
0d236aa3f1 Align the child stack in clone(2).
Also let clone(2) set the TLS for x86.

Also ensure we initialize the TLS before we clone(2) for all architectures.

Change-Id: Ie5fa4466e1c9ee116a281dfedef574c5ba60c0b5
2014-05-09 17:06:51 -07:00
Calin Juravle
c768874c66 Align struct passwd definition with other variations of libc
Add pg_gecos ("real name") field to struct passwd.

Bug: 14679430
Bug: 12875898
Change-Id: I833ec2c46f6a6259b7232a8e3f7942968ef0b50d
2014-05-09 22:29:23 +01:00
Elliott Hughes
8fa5c2528c Merge "Align arm64 stacks to 16 bytes in __bionic_clone." 2014-05-09 21:28:05 +00:00
Elliott Hughes
fff3c0fdcf Align arm64 stacks to 16 bytes in __bionic_clone.
Also ensure that arm64/x86-64/x86 assembler uses local labels.
(There are are so many non-local labels in arm that fixing them
seems out of scope.)

Also synchronize the __bionic_clone.S comments.

Change-Id: I03b4f84780d996b54d6637a074638196bbb01cd4
2014-05-09 12:16:20 -07:00
Christopher Ferris
2146d142b2 Use larger neon instructions for moving data.
Included is a new target generic-neon that will use neon instructions
on 64 bit platforms where appropriate.

Change-Id: Iaf71b768780aa9240a24539cd87666ca9298e4c6
2014-05-09 11:29:37 -07:00
Elliott Hughes
954cf0d4e2 Hide the __bionic_clone and __bionic_clone_entry implementation details.
clone(2) is the public symbol.

Also switch a test from __bionic_clone to clone; testing public API
means the test now works on glibc too.

Change-Id: If59def26a00c3afadb8a6cf9442094c35a59ffde
2014-05-08 19:00:23 -07:00
Elliott Hughes
ae0a62b014 Fix LOG_ID_CRASH build failure.
Change-Id: I66517e30c568d7f36f6bf6b1e4507ecf14f01226
2014-05-07 17:12:40 -07:00
Elliott Hughes
011101905d Send bionic's fatal logging to the crash log.
Bug: 14159417
Change-Id: I7aa986fb8e11660035221f9bb4fe0bc40ac36c58
2014-05-07 16:35:59 -07:00
Elliott Hughes
4aa2e6a32a Give bionic's __ANDROID_API__ a more reasonable value.
This matches what frameworks/base does with Build.VERSION and means that
bionic's version number will always sort >= than any released version.
This should prevent confusion in code that builds both against bionic
and the NDK.

(Note that <sys/cdefs.h> drags this in, so it's always in the namespace.)

Bug: 14613709
Change-Id: I91fb745920e848a6b20f2f5797c0a7d6cde6c032
2014-05-07 12:57:51 -07: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
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
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
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
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
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
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
792ae72e41 Switch to current upstream OpenBSD fwrite.c.
Change-Id: Ife527aafc1e5438f477d711902efe6e6f59f3f8e
2014-05-02 18:22:23 -07: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
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
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
Elliott Hughes
568c86a489 Fix wchar.cpp signed/unsigned comparison build failure.
Change-Id: Id20b91f3d57c4430987b5cc88ac99c245801d73b
2014-05-01 16:49:55 -07:00
Elliott Hughes
f0291ca6b7 Merge "Switch to a working UTF-8 mb/wc implementation." 2014-05-01 23:12:41 +00:00
Elliott Hughes
5a0aa3dee2 Switch to a working UTF-8 mb/wc implementation.
Although glibc gets by with an 8-byte mbstate_t, OpenBSD uses 12 bytes (of
the 128 bytes it reserves!).

We can actually implement UTF-8 encoding/decoding with a 0-byte mbstate_t
which means we can make things work on LP32 too, as long as we accept the
limitation that the caller needs to present us with a complete sequence
before we'll process it.

Our behavior is fine when going from characters to bytes; we just
update the source wchar_t** to say how far through the input we got.

I'll come back and use the 4 bytes we do have to cope with byte sequences
split across multiple input buffers. The fact that we don't support
UTF-8 sequences longer than 4 bytes plus the fact that the first byte of
a UTF-8 sequence encodes the length means we shouldn't need the other
fields OpenBSD used (at the cost of some recomputation in cases where a
sequence is split across buffers).

This patch also makes the minimal changes necessary to setlocale(3) to
make us behave like glibc when an app requests UTF-8. (The difference
being that our "C" locale is the same as our "C.UTF-8" locale.)

Change-Id: Ied327a8c4643744b3611bf6bb005a9b389ba4c2f
2014-05-01 14:46:54 -07:00
Elliott Hughes
fddbafdc0a Keep the kernel header scrubber's data structures in sync.
If you rewrite the tokens of a #if you need to rewrite the expression to match
because either might be used later. This was showing up as SIGRTMAX being
rewritten in a #define but not in the #ifndef that guarded it, for which case
I've added a unit test.

Change-Id: I6929675461a1afe272edd667594529fd84a3dc4d
2014-05-01 10:27:49 -07:00
Elliott Hughes
0990d4fda8 Make SIGRTMIN hide the real-time signals we use internally.
__SIGRTMIN will continue to tell the truth. This matches glibc's
behavior (as evidenced by the fact that we don't need a special case
in the strsignal test now).

Change-Id: I1abe1681d516577afa8cd39c837ef12467f68dd2
2014-04-30 10:06:09 -07:00
Calin Juravle
77473e4085 Merge "Fix cpu_set_t" 2014-04-30 16:09:08 +00:00