Commit Graph

5187 Commits

Author SHA1 Message Date
Dmitriy Ivanov
04ecc77df6 am 1737b159: Merge "Load libraries in breadth-first order"
* commit '1737b159374468a21859d97d8be70a726af0ec9e':
  Load libraries in breadth-first order
2014-09-04 01:48:48 +00:00
Dmitriy Ivanov
1737b15937 Merge "Load libraries in breadth-first order" 2014-09-04 00:59:23 +00:00
Dmitriy Ivanov
f851d60c13 am 8f3b8f52: Merge "Fix arm64 build"
* commit '8f3b8f523ed594b48d28ca0b9a2651d209f29e26':
  Fix arm64 build
2014-09-03 23:47:01 +00:00
Elliott Hughes
d05ad93003 am 58bb54c3: Merge "Add back a dummy arc4random_stir for compatibility."
* commit '58bb54c38bf31fa5cdad8ddbdc44bbed04aaf0cf':
  Add back a dummy arc4random_stir for compatibility.
2014-09-03 23:47:00 +00:00
Dmitriy Ivanov
8f3b8f523e Merge "Fix arm64 build" 2014-09-03 23:36:35 +00:00
Dmitriy Ivanov
5c1a7fdbd5 Fix arm64 build
Bug: 14611536
Change-Id: I4f7f4d1f5c0a37ef38fa0956778393f8d7668512
2014-09-03 16:33:08 -07:00
Elliott Hughes
5dea47221a Add back a dummy arc4random_stir for compatibility.
The current arc4random implementation stirs itself as needed, but we
need to keep an arc4random_stir symbol around for binary compatibility.

(cherry-pick of 1e010d60397db706cd3d1c4d5701a2bced441aa8.)

Bug: 17291075
Change-Id: Iaf6171c3ec65c39c1868364d5b35ea280e29a363
2014-09-03 16:30:22 -07:00
Dmitriy Ivanov
bd00ae8992 am 450aaa01: Merge "Register __libc_fini as early as possible."
* commit '450aaa018df19464cb4e01ea3059a2a075ebde52':
  Register __libc_fini as early as possible.
2014-09-03 22:44:15 +00:00
Dmitriy Ivanov
e880c736d6 Register __libc_fini as early as possible.
We want __libc_fini to be called after all the destructors.

Bug: 14611536
Change-Id: Ibb83a94436795ec178fd605fa531ac29608f4a3e
2014-09-03 15:27:29 -07:00
Dmitriy Ivanov
a3ad450a2e Load libraries in breadth-first order
This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: I4cf84c70dbaabe99310230dfda12385ae5401859
2014-09-03 15:06:14 -07:00
Hans Boehm
5c2c544382 am 9ac60bf8: Make stdatomic.h work with gcc4.6 host compiler
* commit '9ac60bf82b1f0e316666b862e9924f90caa60342':
  Make stdatomic.h work with gcc4.6 host compiler
2014-09-03 05:07:24 +00:00
Andreas Gampe
c16f0486fc resolved conflicts for merge of 2b10e2f1 to lmp-dev-plus-aosp
Change-Id: Ia41583773abbbe1f52d72d1e7f4b925e621d28ff
2014-09-02 22:02:48 -07:00
Elliott Hughes
6c69675423 am ec95a9cf: Merge "MIPS64 syscall() arguments"
* commit 'ec95a9cf11f7c4d2211c61da7ce05262a54409d1':
  MIPS64 syscall() arguments
2014-09-02 21:18:55 +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
Hans Boehm
9ac60bf82b 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
(cherry picked from commit 32429606bf)
2014-09-02 11:37:02 -07:00
Elliott Hughes
a5d70a4b15 am 4625dd75: Merge "Upgrade bionic to tzdata2014g."
* commit '4625dd751e5f7beb0a9b8ec6a768fc7a2c36367a':
  Upgrade bionic to tzdata2014g.
2014-09-02 18:29:15 +00:00
Hans Boehm
2b10e2f122 Undefine _Atomic before redefining
Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>.  This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

A functional stdatomic.h is a prerequisite for fixing the
following bugs.  This is the middle of 3 AOSP updates to
bionics stdatomic.h that are needded to get there.

Bug:16880454
Bug:16513433

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
(cherry picked from commit 3e4a0099a1)
2014-09-02 10:32:34 -07:00
Hans Boehm
c8cf3513ec 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.

Prerequisite for fixing b/16880454 and

Bug:16513433

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
(cherry picked from commit 00aaea3645)
2014-09-02 10:32:33 -07: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
Hans Boehm
94ea04c50a am e505cc66: Merge "Make stdatomic.h work with gcc4.6 host compiler"
* commit 'e505cc66a6e03f4ba460de3500f8b272421482c1':
  Make stdatomic.h work with gcc4.6 host compiler
2014-08-30 01:25:10 +00: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
e21a624269 am bbe06e0d: Merge "Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc."
* commit 'bbe06e0da1742e9bdc52d3246ffa9f2ab3ce999a':
  Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
2014-08-29 23:30:14 +00:00
Elliott Hughes
b2eb09a9ed Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.
Bug: 16874785

(cherry picked from commit e0c56efddf)

Change-Id: I9c922ba019f648766fc399d1c4e35e789e25acd4
2014-08-29 16:10:57 -07: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
Chih-Hung Hsieh
46623c1cc7 am cc4259ed: Merge "Ignore all __weak_alias in OpenBSD libC."
* commit 'cc4259ed9254ae66f63cacc3ad50963c4058eb1c':
  Ignore all __weak_alias in OpenBSD libC.
2014-08-29 11:39:56 +00:00
Elliott Hughes
cd6657f9ea am 29f06943: Merge "Add GNU-compatible strerror_r."
* commit '29f06943a19ef2271a08f4223f597a3383f0d9c0':
  Add GNU-compatible strerror_r.
2014-08-29 11:39:55 +00:00
Chih-Hung Hsieh
cc4259ed92 Merge "Ignore all __weak_alias in OpenBSD libC." 2014-08-29 03:10:44 +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
9560aaba8f am f4e721dd: Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..."
* commit 'f4e721dd519db89c504c8944763811a3df956b32':
  Have pthread_attr_getstack for the main thread report RLIMIT_STACK...
2014-08-28 00:00:07 +00:00
Elliott Hughes
67f1f3b171 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

(cherry picked from commit 9e4ffa7032)

Change-Id: I73f219a569917b2e4546c09436d7ef5231facc07
2014-08-27 16:50:53 -07:00
Elliott Hughes
a0eeb0b69f Merge "Fix pthread_getattr_np for the main thread." into lmp-dev 2014-08-27 23:49:56 +00:00
Elliott Hughes
f4e721dd51 Merge "Have pthread_attr_getstack for the main thread report RLIMIT_STACK..." 2014-08-27 23:43:27 +00:00
Chih-Hung Hsieh
2c449617c3 am fbe9d3df: Merge "Fix strlen function type for mips."
* commit 'fbe9d3dfeb0e09c0e4aa3221aace8249c0efe881':
  Fix strlen function type for mips.
2014-08-27 23:24:27 +00:00
Chih-Hung Hsieh
fbe9d3dfeb Merge "Fix strlen function type for mips." 2014-08-27 23:09:30 +00: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
e561e5db73 am 4f8268e3: Merge "Replace ambiguous cmp instruction with cmpl."
* commit '4f8268e38f151724722bcb489c32185a93fd86ba':
  Replace ambiguous cmp instruction with cmpl.
2014-08-27 23:00:09 +00: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
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
7a9471d815 am 64ae11ab: Merge "Switch to OpenBSD <err.h> implementation."
* commit '64ae11ab766421fe2c49ebdecb14c36fe0a047fe':
  Switch to OpenBSD <err.h> implementation.
2014-08-27 17:39:28 +00:00
Christopher Ferris
7bad1a90f1 am 3f7635f4: Use the default unwind code.
* commit '3f7635f4906c53fa744731efc35235456b7d93bf':
  Use the default unwind code.
2014-08-27 04:46:05 +00:00
Hans Boehm
3b32ba0e2c am 6bfcefe0: Merge "Undefine _Atomic before redefining"
* commit '6bfcefe02f8fbeec1f6790bd5ebb1fdd5dba1e33':
  Undefine _Atomic before redefining
2014-08-27 00:01:46 +00:00
Elliott Hughes
d961078f2d am 07401c71: Merge "Switch to OpenBSD daemon(3)."
* commit '07401c7136af113304a22f4a8245ef3fc1b6929b':
  Switch to OpenBSD daemon(3).
2014-08-27 00:01:45 +00:00
Elliott Hughes
cc7e5f489f Switch to OpenBSD <err.h> implementation.
Change-Id: Ia950d88871a30f68e74f9ac7dbd87788e128e02f
2014-08-26 17:00:37 -07:00
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
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