Commit graph

8344 commits

Author SHA1 Message Date
Elliott Hughes
ec95a9cf11 Merge "MIPS64 syscall() arguments" 2014-09-02 20:53:31 +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
Dmitriy Ivanov
86f594b19b Merge "Encapsulate soinfo_link_image and soinfo_relocate" 2014-09-02 19:25:09 +00:00
Dmitriy Ivanov
29bbc9dd4c Encapsulate soinfo_link_image and soinfo_relocate
Also get rid of needed[] array for these functions

Change-Id: I8d12887dbec0724309bb171e6bbd9b9ceb32cc70
2014-09-02 11:47:23 -07:00
Elliott Hughes
4625dd751e Merge "Upgrade bionic to tzdata2014g." 2014-09-02 17:57:10 +00:00
Dmitriy Ivanov
e057b9fc82 Merge "Introduce size-based r/w allocators" 2014-09-02 17:21:51 +00:00
Dmitriy Ivanov
4cafa3ce80 Merge "Implement LinkedList::visit()" 2014-09-02 16:54:14 +00: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
Dmitriy Ivanov
a492605849 Implement LinkedList::visit()
Change-Id: Ibd9d133dddf1f2e6e65660e3cd2dacafcc0c84d9
2014-09-02 09:45:40 -07:00
Dmitriy Ivanov
0cd83ebb0e Introduce size-based r/w allocators
Change-Id: I75165fc392e5380124039e6db49b0f559c8a518e
2014-09-01 16:17:05 -07:00
Dmitriy Ivanov
5120bcf9f1 Merge "Look into ld_preloads before current library" 2014-09-01 21:16:42 +00:00
Dmitriy Ivanov
c2048944ff Look into ld_preloads before current library
Change lookup order during relocation so that
 ld_preloads always precede caller (unless caller
 is main executable).

 Asan needs this change in order to intercept libc->libc
 calls.

Bug: 15432753
(cherry picked from commit 05e190c093)

Change-Id: I5bfb58e18015b1ec5b77842dbb37fb122fa1fd1a
2014-09-01 14:14:09 -07:00
Dmitriy Ivanov
11387985d2 Merge "Erase elements in LinkedList::remove_if" 2014-09-01 21:06:32 +00:00
Hans Boehm
e505cc66a6 Merge "Make stdatomic.h work with gcc4.6 host compiler" 2014-08-30 00:49:51 +00:00
Dmitriy Ivanov
4bea498544 Erase elements in LinkedList::remove_if
Change-Id: I5119a78c73ffe780a81c53ab5ff0266d5c82d319
2014-08-29 17:09:24 -07: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
bbe06e0da1 Merge "Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc." 2014-08-29 23:08:01 +00: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
Dmitriy Ivanov
83b637fa28 Merge "Replace NULL with nullptr" 2014-08-29 22:30:07 +00:00
Dmitriy Ivanov
851135bf99 Replace NULL with nullptr
Change-Id: Iad50be617d318ca98883b843229c960ad5b9afa9
2014-08-29 14:13:48 -07:00
Elliott Hughes
1f39afc8d4 Merge "The host prebuilt glibc is 2.11, so remove workarounds for 2.9." 2014-08-29 18:12:36 +00:00
Chih-Hung Hsieh
cc4259ed92 Merge "Ignore all __weak_alias in OpenBSD libC." 2014-08-29 03:10:44 +00:00
Elliott Hughes
f6824b26ae The host prebuilt glibc is 2.11, so remove workarounds for 2.9.
Change-Id: I1072fcebc8b3018580a9d069fe6eca9c4e74e865
2014-08-28 19:28:35 -07:00
Elliott Hughes
29f06943a1 Merge "Add GNU-compatible strerror_r." 2014-08-29 02:26:34 +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
f4e721dd51 Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..." 2014-08-27 23:43:27 +00:00
Christopher Ferris
af9da4a343 Merge "Replace snprintf calls in linker." 2014-08-27 23:29:18 +00:00
Chih-Hung Hsieh
fbe9d3dfeb Merge "Fix strlen function type for mips." 2014-08-27 23:09:30 +00:00
Christopher Ferris
052fa3a34c Replace snprintf calls in linker.
When enabling debug malloc, the snprintf calls in the linker fails to
update the buffer.

The problem is that snprintf makes a call to pthread_getspecific that
returns a valid pointer, but the data it points to is zero. This should
never happen and causes the snprintf to stop and do nothing.

Temporarily replace snprintf with a different implementation to work
around this issue.

Bug: 16874447
Bug: 17302493

(cherry pick from commit 172955a4e3)

Change-Id: Idca9d417978403d61debfd0434aaa82fd770f33b
2014-08-27 16:01:57 -07: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
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
Chih-Hung Hsieh
34da32e7dd Merge "Add missing type casts before comparison." 2014-08-27 21:44:12 +00:00
Christopher Ferris
6ecd1cd195 Merge "Use the default unwind code." 2014-08-27 21:21:28 +00:00
Chih-Hung Hsieh
a2c6ae6f84 Add missing type casts before comparison.
BUG: 17300548
Change-Id: Ice9868f36c8fa8cd40bb13741b0e33c8f8d354fd
2014-08-27 13:45:37 -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
cb322a1168 Merge "call uselocale() before freelocale() to make sure that g_local_key has a valid locale." 2014-08-27 17:27:46 +00:00
Wally Yau
a40fdbd565 call uselocale() before freelocale() to make sure that g_local_key has a valid locale.
For tests that call uselocale(), the locale is stored in the
g_userlocale_key thread-specific key. If freelocale() is called later,
then g_uselocal_key points to a deleted pointer. CTS eventually calls
vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX
accesses the deleted locale stored in g_uselocale_key, causing unpredictable
errors.

Fixed the tests by calling uselocale() with the old locale before
calling freelocale.

(cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.)

Bug: 17299565
Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
2014-08-27 10:26:49 -07:00
Elliott Hughes
64ae11ab76 Merge "Switch to OpenBSD <err.h> implementation." 2014-08-27 17:26:03 +00:00
Elliott Hughes
cc7e5f489f Switch to OpenBSD <err.h> implementation.
Change-Id: Ia950d88871a30f68e74f9ac7dbd87788e128e02f
2014-08-26 17:00:37 -07: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
f1e64b5c17 Merge "More cases where libc should use O_CLOEXEC." 2014-08-26 23:23:59 +00: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
Elliott Hughes
59de803af9 Merge "libc should use O_CLOEXEC when opening files for its own use." 2014-08-26 23:11:46 +00:00
Dmitriy Ivanov
9f5dee55aa Merge "Remove unnecessary calls to LinkedList::clear()" 2014-08-26 23:00:44 +00:00