Commit graph

4122 commits

Author SHA1 Message Date
Dan Albert
e612add051 Remove isascii_l(3).
Had intended to remove this one before submitting the locale changes,
but forgot. It isn't a standard ctype function, so we don't need it.

Change-Id: Ie9c09fa6c61b1101b5992fa06da30e373a0c6bf7
2014-07-14 15:48:02 -07:00
Elliott Hughes
a167eef548 Fix visibility for a bunch more symbols.
Bug: 11156955
Bug: 15291317
Change-Id: I664f25cce7c17085a101d6593d8e01525a1f6a90
2014-07-14 15:13:30 -07:00
Elliott Hughes
673bff01ae Merge "Implement rand/srand in terms of random/srandom." 2014-07-14 17:20:33 +00:00
Elliott Hughes
76c241b091 Implement rand/srand in terms of random/srandom.
Code developed for glibc or older versions of bionic might expect more
randomness than the BSD implementation provides.

Bug: 15829381
Change-Id: Ia5a908a816e0a5f0639f514107a6384a51ec157e
2014-07-14 12:02:22 -07:00
Elliott Hughes
4ae938698c Merge "Sync upstream-openbsd." 2014-07-14 17:15:23 +00:00
Elliott Hughes
4f0b67a8db Sync upstream-openbsd.
Change-Id: I5b9961a57e2ff05f63bd218c130bf8347850b9be
2014-07-14 11:22:59 -07:00
Dmitriy Ivanov
53c3c271dc Upstream atexit
Change-Id: Ia454a2181b5058ed9783dc02b6b1805d0e4d2715
2014-07-14 12:05:16 -07:00
Elliott Hughes
2ba2888cac Define SIOCKILLADDR which isn't in the common kernel uapi headers.
Change-Id: I8760950d13a9625aa543e76bc9d6cd86ac782c2e
2014-07-11 21:11:21 -07:00
Elliott Hughes
263325d4b0 Define three prctl constants that went missing from uapi.
Change-Id: Ib81846ddefe9a75e02151c6592ed99b1f8ec5858
2014-07-11 19:54:55 -07:00
Elliott Hughes
b8e82b5e72 Merge "EM_ARM and EM_AARCH64 are now in the uapi header." 2014-07-10 20:49:23 +00:00
Elliott Hughes
10cf0d8c1f EM_ARM and EM_AARCH64 are now in the uapi header.
Change-Id: Ice73403daff75ea45b24e02351269f6c012df6c1
2014-07-11 11:01:42 -07:00
Christopher Ferris
c6bc001776 Merge "Update kernel headers to v3.14." 2014-07-10 21:32:00 +00:00
Elliott Hughes
040e11877d Merge "Enable building libc with clang." 2014-07-11 16:35:27 +00:00
Elliott Hughes
c999f76977 Enable building libc with clang.
Bug: 16218205
Change-Id: I024de2044fe016412c7bead22c264e96be4cb39c
2014-07-11 09:28:53 -07:00
Dan Albert
dfb5ce42bc Revert "Revert "Add locale aware APIs.""
This reverts commit 063e20c269.

Change-Id: Ib8c9004efefe75a5346b3af50dfe37952d91eb21
2014-07-11 16:21:31 +00:00
Elliott Hughes
2f61fba72b The err family allow null format strings.
Also remove declarations for the _* variants that were never implemented in bionic (or glibc).

Change-Id: I4ea1f17bbb377e70632c10dd218f47110cabc27b
2014-07-11 02:53:27 +00:00
Christopher Ferris
385bb1eded Merge "Add optimized memchr implementation from newlib" 2014-07-10 20:49:23 +00:00
Bernhard Rosenkränzer
8c20c13100 Add optimized memchr implementation from newlib
Add NEON optimized memchr adapted from newlib

Change-Id: I91b2fafa243e4ab35fa56bb6171d48433c947cfd
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-07-11 00:17:07 +02:00
Christopher Ferris
8e32b7b354 Make jemalloc the default choice.
Change-Id: I5ff0cf0c396b7ae6278e6fcd5a0d50f8b966fb54
2014-07-11 11:01:30 -07:00
Christopher Ferris
38062f954c Update kernel headers to v3.14.
Other changes:
- Modify update_all.py to skip ion header files when importing into aosp.
- Fix generate_uapi_headers.sh to handle imports from a linux-stable kernel.

Change-Id: I1ad81b9ccb063c21740f9875f2cc1238052cd4b3
2014-07-10 13:32:32 -07:00
Elliott Hughes
91570ce987 Slim down static binaries by avoiding stdio.
It's okay for a program to choose to drag in stdio, but it's unfortunate
if even the minimal "int main() { return 42; }" drags in stdio...

This brings the minimal static binary on ARM down from 78KiB to 46KiB.

Given that we don't have a separate -lpthread it's not obvious to me that
we can shave this down any further. I'm not sure whether this is a worthwhile
change for that reason. (And the fact that dynamic binaries, the usual case,
are unaffected either way.)

Change-Id: I02f91dcff37d14354314a30b72fed2563f431c88
2014-07-10 12:34:23 -07:00
Elliott Hughes
e959a3b315 Remove the global lock around thread stack creation.
This lock has been here since the original commits, but as far as I can tell
it never served any purpose. We've never had a free list of cached stacks or
anything like that.

Change-Id: I9d665c7eaa9c699ce0659ffb111402a0239fe1f5
2014-07-10 10:25:26 -07:00
Elliott Hughes
cd23370ca7 Merge "Remove the obsolete _thread_created_hook." 2014-07-10 16:05:36 +00:00
Elliott Hughes
e0f25dda3f Remove the obsolete _thread_created_hook.
gdb won't even try to use this on Android because it knows we don't
support old enough kernels to need it.

Bug: 15470251
Change-Id: Ia6d54585d888bbab8ee0490a148a1586b25437b9
2014-07-09 22:13:55 -07:00
Calin Juravle
f8408c58fa Move __cmsg_nxthdr to its proper file.
Change-Id: I095fb6bc5318f2d256baa97658bdfe679d235aec
2014-07-10 12:47:13 +01:00
Calin Juravle
e95d0fc34c Removed obsolete symbol cmsg_nxthdr.
Bug: 15822452
Change-Id: I5322fb29522fc58e9c3489ff86216e25a12ef970
2014-07-10 12:44:52 +01:00
Christopher Ferris
25fba981a1 Merge "Do not include libc_common in malloc debug code." 2014-07-09 22:27:32 +00:00
Christopher Ferris
dda1c6c466 Do not include libc_common in malloc debug code.
The inclusion of the static libc_common library in the malloc_debug_XXX.so
shared libraries causes constructors to be called twice. This doesn't seem
to have caused any issues when setting the libc.debug.malloc property.
However, jemalloc crashes because there are two jemalloc implementations,
one in the static libc_common library and one in the shared library. Each
implementation has created overlapping thread keys that are not the same.
The crash comes because one of the jemalloc keys is actually used by the
locale setting code. Thus if someone sets the locale, the jemalloc code
crashes trying to access the same key.

Change-Id: Iaac650a82d69064db148a6333e9403744f68b4a4
2014-07-09 21:27:15 -07:00
Elliott Hughes
30ab939496 update-tzdata.py needs to know where to find icu.
Change-Id: If5561b92c233276fb072da62be21f23df4781c41
2014-07-09 15:42:59 -07:00
Dmitriy Ivanov
3a8646fc5d Change android_dlextinfo flags to uint64_t
Change-Id: Id27e8f8e58dbcf6ae79644f2ad3af3dd0aef9ae7
2014-07-08 11:24:03 -07:00
Elliott Hughes
1558138315 Regenerate the bionic NOTICE files.
Also fix a few formatting issues in copyright headers that were confusing
the script (though obviously it would be better if the script were smarter).

Change-Id: I7f561bef4f84fdcbd84f375ee226bd65db0e507b
2014-07-07 15:42:06 -07:00
Elliott Hughes
2b2916d154 Merge "Remove some dead data." 2014-07-02 20:49:42 +00:00
Elliott Hughes
920d831ba1 Remove some dead data.
Clang doesn't like dead data, and this is just an LP32 compatibility turd.

Change-Id: I3832748a4e773b254877f4438b5340e7d4c1ce70
2014-07-07 09:46:11 -07:00
Elliott Hughes
6917e6c2ae Fix recv.cpp so it can build with clang.
Change-Id: Iac3e676aa256837333240219bcadbdc31985b5dd
2014-07-02 16:46:34 -07:00
Elliott Hughes
ab4fc82315 Merge "Fix all resolv warnings and turn on -Werror." 2014-07-02 21:12:58 +00:00
Elliott Hughes
37b1b5bbcd Fix all resolv warnings and turn on -Werror.
The res_init.c changes bring us a bit closer to upstream too, though
there's still work to be done there. Some of the remaining differences
look like bugs we'd want to fix, so we should definitely try to come
back to that.

Change-Id: I50baa148e967c90d55d711e9904ad54c7d724d4d
2014-07-02 16:27:20 -07:00
Dmitriy Ivanov
950a435fc0 Merge "Load library using file handle." 2014-07-02 20:52:43 +00:00
Elliott Hughes
db42a9f5a3 Merge "Fix three clang complaints about the DNS code." 2014-07-02 20:49:42 +00:00
Elliott Hughes
68c2755d71 Fix three clang complaints about the DNS code.
These are all already fixed upstream in the same way.

Change-Id: I2881b6d0fbd0237fffc0f00563bc14750dcce0d9
2014-07-07 09:44:17 -07:00
Elliott Hughes
4d763df324 Merge "Fix a broken boolean test found by clang." 2014-07-05 03:01:43 +00:00
Elliott Hughes
29edbfd64f Fix a broken boolean test found by clang.
This was only on the failure case, so this probably never caused
any real trouble.

Change-Id: Id983689772102cbb9171693b927e544fb0b584fb
2014-07-07 09:45:15 -07:00
Elliott Hughes
1ee1bfdeec Merge "Use __unused rather than self assignment for unused parameters." 2014-07-02 20:49:53 +00:00
Elliott Hughes
668da74ef1 Use __unused rather than self assignment for unused parameters.
Clang, reasonably enough, doesn't like self assignment.

Change-Id: Ie5843287802949dad148a1a815231035678e1306
2014-07-07 09:46:54 -07:00
Dan Albert
2d94ee29f4 Merge "Revert "Revert "Hide _tolower_tab_ and _toupper_tab_ on LP64.""" 2014-07-02 20:51:20 +00:00
Nick Kralevich
bae5b1dbd8 libc_logging: Set SOCK_CLOEXEC on socket
Socket file descriptors remain open across exec unless
SOCK_CLOEXEC is set. Enable this option, to avoid leaking
file descriptors.

In practice, this isn't a big deal, since the socket only remains
open for a very short period to write a message. However, this
socket might leak for for multithreaded programs if an exec occurs
between the open and close.

Change-Id: Ica2e71fe28657c32d56de1431c8f7f1f5c7b7c58
2014-07-02 22:39:14 -07:00
Dmitriy Ivanov
04dc91ae76 Load library using file handle.
* This patch enables dlopen by file descriptor
   instead of path/name.

Bug: 15984217
Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
2014-07-02 13:20:47 -07:00
Elliott Hughes
6593597931 Switch to upstream OpenBSD mktemp.c.
Almost all of our stdio is actually OpenBSD, so although this isn't
really a core part of stdio (it doesn't touch struct FILE, for example)
it probably makes sense for it to come from the same upstream. My
actual motivation though is that it's the only FreeBSD file we have
compiler warnings from.

This patch moves us over to -Werror by default, with only the DNS code
having -Wno-error.

Change-Id: Id244a5b445cba41b0a1ca30298ca7b1ed177810c
2014-07-02 11:22:26 -07:00
Dan Albert
f79ee064b6 Revert "Revert "Hide _tolower_tab_ and _toupper_tab_ on LP64.""
This reverts commit 715242fd0f.

Change-Id: Ia9892fa3b03287129aa72a49974cef9fd94ae735
2014-07-01 22:41:50 +00:00
Elliott Hughes
e997598790 Merge "Quiten warnings in semaphore.c." 2014-07-01 19:22:04 +00:00
Elliott Hughes
95d3cd0b85 Quiten warnings in semaphore.c.
Change-Id: I30aff82174f789ab407d2282c07e6207123d4d5b
2014-07-01 17:07:43 -07:00