Commit Graph

5745 Commits

Author SHA1 Message Date
Elliott Hughes
cb4c615bb9 Remove __ARM_HAVE_VFP.
Bug: 18556103
Change-Id: I6d4cc6a1b359ad2df1ce6687fd26f392059f6efd
2014-12-03 17:07:01 -08:00
Elliott Hughes
6cbc56b84b Merge "Implement <pty.h>." 2014-12-04 00:45:42 +00:00
Elliott Hughes
65f0df7873 Implement <pty.h>.
Based on the package/apps/Terminal implementation. I'll switch them over
shortly. This also lets us build the toybox version of netcat.

Change-Id: Ia922a100141a67409264b43b937eeca07b21f344
2014-12-03 15:55:34 -08:00
Yabin Cui
1898967e41 Merge "change argument type in madvise" 2014-12-03 19:57:50 +00:00
Yabin Cui
efbb6fb3f7 change argument type in madvise
Make madvise prototype the same as linux man page.

Bug: 18539500
Change-Id: If3fd0e1d9539b9e10531ab9087bc4040e32b6e9b
2014-12-03 11:11:50 -08:00
Elliott Hughes
91a61f77e2 Merge "Switch x86 and x86-64 to __builtin_bswap*." 2014-12-03 16:20:06 +00:00
Elliott Hughes
12f35ada43 Switch x86 and x86-64 to __builtin_bswap*.
Bug: 18597513
Change-Id: I0781208efb3b560d7c6fa48f41be7bc6fc83521e
2014-12-02 20:16:05 -08:00
Elliott Hughes
1de2548c8e Switch aarch64 to __builtin_bswap16.
It generates the same code.

Bug: 18597513
Change-Id: I164296da8c676668983dd93697c6dfa05f10ec56
2014-12-02 19:55:38 -08:00
Elliott Hughes
a5602c566e Remove __ARM_HAVE_HALFWORD_MULTIPLY.
Bug: 18556103
Change-Id: I17e498539f77ddf7d1fb980ee93155d3c3ccd85e
2014-12-02 16:58:17 -08:00
Elliott Hughes
6651aa6bc1 Remove __ARM_HAVE_LDREXD.
No one uses this.

Bug: 18556103
Change-Id: Icecc3a7b5cb0a36960f27d030d8f4f8ee471f86c
2014-12-03 00:57:07 +00:00
Elliott Hughes
b514026eb2 Kill <machine/exec.h>.
Bug: 18546535
Change-Id: I479e003deab21e31eb5caa5393067ed1dc558387
2014-12-02 16:16:29 -08:00
Elliott Hughes
20841a137b Avoid pathological behavior in OpenBSD's fread.
Bug: https://code.google.com/p/android/issues/detail?id=81155
Bug: 18556607
Change-Id: Idc60976b79610e2202cc42dc393dcb4ca6c42e05
2014-12-02 14:22:02 -08:00
Yabin Cui
8574a0670b Use mmap to create the pthread_internal_t.
Bug: 16847284
Change-Id: I488fa236f57aa3acb29b4ffbbab2fab51b0653be
2014-12-02 10:39:25 -08:00
Christopher Ferris
8374a54813 Merge "Specify .cpu cortex-a15" 2014-12-02 02:29:52 +00:00
Elliott Hughes
212e0e3824 Build our benchmarks against glibc too.
Bug: 18556607
Change-Id: I455ac8b93c0835836180e549486bc52d393ee6a6
2014-12-01 16:43:51 -08:00
Yabin Cui
3e6ef3f902 Merge "support _POSIX_CPUTIME" 2014-12-01 17:06:02 +00:00
David 'Digit' Turner
aad1a39dfb libc: Fix headers to allow direct inclusion.
These headers are missing a few #includes to allow their direct
inclusion from C

http://b.android.com/79841

Change-Id: Ifc712c17f4da70b26adb67d4d49ed659f53c3621
2014-12-01 15:44:24 +01:00
Bernhard Rosenkränzer
ce46f5576a Specify .cpu cortex-a15
When building with clang without this change, as errors out saying pldw
is an unsupported instruction (because it isn't part of the ARMv7 core
instruction set).
Let as know using pldw is fine.

Change-Id: Ie1f9c4b873e93ab2b3b374d2d46e476a4e581710
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-11-30 22:17:30 +01:00
Robert Alm
3638a83657 Add error-check when mapping socket to fd
The call to fdopen can fail in several ways.
The fprintf on the next line will then dereference a
NULL-pointer FILE*.
Added a NULL-check, closed the socket, returned system error
and added a comment about it.

Change-Id: I7a6b26aa3c79452b1fdd76af12dfa75da88cbad7
2014-11-27 11:01:50 -08:00
Elliott Hughes
1b66f6e9d7 Move a private x86-64 header file out of the limelight.
Currently this is on everyone's include path and is getting exported
via the NDK.

Change-Id: Ia417839fb65c7e0afddcd9fae3438665dae8e752
2014-11-26 19:31:19 -08:00
Yabin Cui
d5c652756b support _POSIX_CPUTIME
Bug: 18490039
Change-Id: I01fa83b48e1b908de1f227b6e4f98e280bcd50ee
2014-11-26 17:14:50 -08:00
Nicolas Geoffray
5b8ceff5f8 Revert "Use mmap to create the pthread_internal_t."
Unfortunately, this change provokes random crashes for ART, and
I have seen libc crashes on the device that might be related to it.

Reverting it fixes the ART crashes. there is unfortunately no
stack trace for the crashes, but just a "Segmentation fault" message.


This reverts commit cc5f6543e3.

Change-Id: I68dca8e1e9b9edcce7eb84596e8db619e40e8052
2014-11-26 11:56:54 +00:00
Duane Sand
3a4786348e [MIPS] Rewrite of setjmp/longjmp for mips64 and mipsr6
Change-Id: Idcd13413520dd503bc9cf782553675313e500a83
2014-11-25 17:33:10 -08:00
Yabin Cui
cc5f6543e3 Use mmap to create the pthread_internal_t.
Bug: 16847284
Change-Id: Ic8c85f95afac1d8422ecb69674c688d1fecb6a44
2014-11-25 15:25:06 -08:00
Yabin Cui
eb3a5e026e Merge "flesh out sysconf(3) and the _POSIX_* constants" 2014-11-24 01:59:23 +00:00
Elliott Hughes
95a02366f2 Merge "Sync with upstream OpenBSD fts.c." 2014-11-23 18:06:29 +00:00
Dan Albert
806dd9f90c Merge "Move some pthread functions to signal.h." 2014-11-22 22:38:51 +00:00
Elliott Hughes
2818279ace Sync with upstream OpenBSD fts.c.
Change-Id: Ia7e26b603f6461095b5a8d7e8a6cdf4f8279fa84
2014-11-21 19:27:28 -08:00
Yabin Cui
1c19194c9d flesh out sysconf(3) and the _POSIX_* constants
Bug: 17571891
Change-Id: I81036615486bde65969ae5662587fcc88348474e
2014-11-21 19:10:52 -08:00
Elliott Hughes
ee369fb319 Bring our <machine/endian.h> files back in sync.
They'd drifted slightly which led to a compilation error in toybox,
which was assuming pid_t was defined. arm and arm64 were picking it
up via <endian.h> but x86 wasn't.

Change-Id: I58401e6c0066959dfc3b305b020876aaf7074bbf
2014-11-21 18:34:36 -08:00
Dmitriy Ivanov
4ae178f81d Mips: remove arch-specific atexit.h
Change-Id: I687ff4ead6c5e81db44782bf851cb84f87bfe085
2014-11-21 14:42:53 -08:00
Dmitriy Ivanov
e3e8d15f23 Mips: Remove unused files
Change-Id: If98b832ee32f6dcd9f5d7ae21c601c210adfad6b
2014-11-21 14:29:43 -08:00
Dmitriy Ivanov
c619603a31 Mips: Reuse atexit.h from libc/arch-common
Change-Id: Ica1670e6d3d1b6b0c64df93720efa65586e67727
2014-11-21 13:07:36 -08:00
Dan Albert
75ef63d6cf Move some pthread functions to signal.h.
POSIX specifies that pthread_kill(3) and pthread_sigmask(3) are
supposed to live in signal.h rather than pthread.h.

Since signal.h now needs pthread_t and pthread_attr_t, I've moved
those defintions into include/machine/pthread_types.h to keep the
namespace clean. I also sorted some includes. The combination of these
two things seems to have exploded into a cascade of missing includes,
so this patch also cleans up all those.

Change-Id: Icfa92a39432fe83f542a797e5a113289d7e4ad0c
2014-11-21 10:26:09 -08:00
Dan Albert
f664034887 Revert "<sched.h> should offer both __sched_priority and sched_priority."
This was only ever added to keep strace compiling, but strace has
since (actually, prior) fixed their source to use the less ugly name,
so we don't need this anymore (good riddance, #define!).

This reverts commit bbb34f9536.
2014-11-21 10:24:40 -08:00
Elliott Hughes
5313c3ff89 Merge "Fix flockfile(3) and friends for stdin/stdout/stderr too." 2014-11-19 23:48:19 +00:00
Elliott Hughes
c48c3e4bb3 Fix flockfile(3) and friends for stdin/stdout/stderr too.
stdin/stdout/stderr are special; their mutexes are initialized by
__sinit. There's no unit test for this, because __sinit has already
been called by the time the first unit test runs, but you could
reproduce this failure with a trivial main() that calls flockfile
or ftrylockfile on one of the standard streams before otherwise
using stdio.

Bug: 18208568
Change-Id: I28d232cf05a9f198a2bed61854d8047b23d2091d
2014-11-19 15:16:51 -08:00
David 'Digit' Turner
c9278b8a17 Merge "libc: Move <sgidefs.h> to libc/arch-mips/" 2014-11-19 14:49:52 +00:00
Yabin Cui
649f78df79 Merge "fix shared gid support in getpwnam/getgrnam" 2014-11-19 04:25:24 +00:00
Yabin Cui
a04c79b9d3 fix shared gid support in getpwnam/getgrnam
Bug: 18374693
Change-Id: I5353403cbbead6f6abac87bee2cf53a60dba408c
2014-11-18 19:58:04 -08:00
David 'Digit' Turner
6e50cb4544 libc: Move <sgidefs.h> to libc/arch-mips/
This is a MIPS-only header, and should not be part of the common
headers. See http://b.android.com/79841 for context.

Change-Id: I610bc3ff626b57e7854dad15a4a2f67e1e5ded75
2014-11-18 20:13:10 +01:00
Elliott Hughes
8eda0a6d69 Merge "libc: Fix mktime returns an uncorrect time in empty TZ case" 2014-11-17 23:14:58 +00:00
Elliott Hughes
bfbf7a4300 Remove remaining bionic support for TARGET_CPU_SMP being false.
Change-Id: I02a0a1c0ae55ccb5c45d17fb99a09c374d71def4
2014-11-17 10:06:20 -08:00
Satoru Takeuchi
154e2026c8 libc: Fix mktime returns an uncorrect time in empty TZ case
The mktime API returned an uncorrect time when TZ is set as empty.
A timezone UTC/GMT+0 should be implied in the empty case. However
mktime keeps previous information about timezone. If mktime was called
with a timezone which has DST before, the "defaulttype" member of
"state" structure wouldn't be 0. Then it would be used next time,
even though UTC/GMT+0 doesn't have DST.

Added initialization of the "defaulttype" in the empty TZ case.

Change-Id: Ic480c63c548c05444134e0aefb30a7b380e3f40b
2014-11-14 18:13:07 -08:00
Yabin Cui
9d93986481 Add functions in sysinfo.h.
Bug: 17703902

Change-Id: I699d12d76a8fc483c919be730c2ac63641b71a1d
2014-11-14 16:22:48 -08:00
Yabin Cui
661423a453 Merge "Increase support of pathconf options." 2014-11-14 23:45:45 +00:00
Yabin Cui
b5e581abfe Increase support of pathconf options.
Bug: 18206366
Change-Id: Ie770e49f5af3631eb9fbd2cd5174edf004c81e00
2014-11-14 23:45:24 +00:00
Elliott Hughes
60d84af172 sysconf(3) returns long.
On LP32, this makes no difference. Not an ABI change.

On LP64, results are going to be in %rax or x0 whether they're 32- or 64-bit,
and the only difference is going to be whether the top bits are clobbered.

Bug: 18390956
Change-Id: I0bd4496231bdded34c1fa03e895021ac0df7f8e1
2014-11-14 15:14:44 -08:00
Elliott Hughes
168667c972 Add non-macro stdin/stdout/stderr too.
Various C and C++ standards explicitly say that stdin/stdout/stderr
should be macros, but glibc makes them global variables too. This
means it's possible to write code that uses those names as locals,
but that code (toybox being an example) won't build on bionic.

If we'd done this earlier, we could have hidden __sF for LP64, but
it's too late now.

Change-Id: I90cf8c73f52b66e1760b8fa2e135b9f9f9651230
2014-11-14 14:42:59 -08:00
Christopher Ferris
59b1dea882 Merge "Add missing function prototypes wcpcpy/wcpncpy." 2014-11-14 03:23:35 +00:00
Christopher Ferris
5c7d9584d9 Add missing function prototypes wcpcpy/wcpncpy.
Also add smoke tests for a few of the wchar functions.

Change-Id: Id1be522f55a6708564d444941f42097548f16497
2014-11-13 18:56:12 -08:00
Elliott Hughes
e3c4acf1e3 Fix our <mntent.h> implementation.
Used by toybox.

Change-Id: I36a5053423e5cc54ae02a68f4fe110d75134accd
2014-11-13 15:51:36 -08:00
Elliott Hughes
288fa03a5a Merge "Assume glibc >= 2.15." 2014-11-13 18:11:00 +00:00
Elliott Hughes
6229798a7c Merge "Don't receive structs containing pointers over sockets." 2014-11-13 17:56:08 +00:00
Hans Boehm
854c98d636 Merge "Allow stdatomic.h to be included from mingw prebuilt." 2014-11-13 17:49:53 +00:00
Elliott Hughes
55293c1dad Don't receive structs containing pointers over sockets.
Fixes x86-64 netd.

Change-Id: Iee5ef802ebbf2e000b2593643de4eec46f296c04
2014-11-12 22:06:35 -08:00
Elliott Hughes
68d98d832b Assume glibc >= 2.15.
This catches one trivial difference between us and glibc --- the error
returned by pthread_setname_np for an invalid pthread_t.

Change-Id: If4c21e22107c6488333d11184f8005f8669096c2
2014-11-12 21:03:26 -08:00
Dmitriy Ivanov
16db1ae108 Merge "Add support for hash-style=gnu" 2014-11-13 02:10:30 +00:00
Hans Boehm
95f197f998 Allow stdatomic.h to be included from mingw prebuilt.
Define __GNUC_PREREQ if it isn't already defined.
This is a bit ugly, but it seems to be easiest to make this header as
context-independent as possible.  Together with the addition of a symbolic
link to this file from the mingw prebuilt, this appears to unblock
commit e9fa6be333e35d9e7ae435aeb32532875b95fe22.

Change-Id: I97e39cda8d8f9aa108aa61c4121da09eb9739062
2014-11-12 18:08:25 -08:00
Dmitriy Ivanov
ec18ce06f2 Add support for hash-style=gnu
Change-Id: I171434a587420895feac8a9b1ad2342087197568
2014-11-12 16:38:12 -08:00
Christopher Ferris
5d05d025b5 Merge "Add 64-bit slm optimized strlcpy and srlcat." 2014-11-12 23:18:00 +00:00
Yabin Cui
e5cabca516 Merge "implement missing seekdir and telldir" 2014-11-12 20:36:26 +00:00
Elliott Hughes
bbdfa51883 Merge "gethostname.c: change to report ENAMETOOLONG error when buflen is less" 2014-11-12 20:09:59 +00:00
Yongqin Liu
2f954bab2d gethostname.c: change to report ENAMETOOLONG error when buflen is less
change to behaviour the same as glibc for the check about buflen

Change-Id: I98265a8fe441df6fed2527686f89b087364ca53d
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-11-12 12:07:33 -08:00
Varvara Rainchik
2e7145c048 Add 64-bit slm optimized strlcpy and srlcat.
Change-Id: Ic948934d91c83bbfdfd00c05ee8b14952e012549
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
2014-11-12 17:32:28 +03:00
Elliott Hughes
b11d8e057c Upgrade bionic to tzdata2014j.
From the release notes:

   Changes affecting current and future time stamps

     Turks & Caicos' switch from US eastern time to UTC-4 year-round
     did not occur on 2014-11-02 at 02:00.  It's currently scheduled
     for 2015-11-01 at 02:00.  (Thanks to Chris Walton.)

   Changes affecting past time stamps

     Many pre-1989 time stamps have been corrected for Asia/Seoul and
     Asia/Pyongyang, based on sources for the Korean-language Wikipedia
     entry for time in Korea.  (Thanks to Sanghyuk Jung.)  Also, no
     longer guess that Pyongyang mimicked Seoul time after World War II,
     as this is politically implausible.

     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/Addis_Ababa, Africa/Asmara,
     Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
     Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and
     Indian/Mayotte.

Bug: 18330681
Change-Id: I4b6939b4dcf08c47df5595ae445b6f44f4a03418
2014-11-11 16:44:21 -08:00
Elliott Hughes
440c80ad47 Merge "Fix tzdata update tools for 'backzone'." 2014-11-12 00:42:50 +00:00
Elliott Hughes
2c2463bd30 Fix tzdata update tools for 'backzone'.
To maintain the status quo, we need to pull in backzone file. This file
can't be built on its own, so the easiest fix is to give zic(1) all the
files at once.

We also now have a situation where we have links to links, so we need to
dereference them until we find actual data.

Bug: 18330681
Change-Id: I03f4aa8e6e23802dc35cbff2f74f325eb17d7b2b
2014-11-11 16:30:18 -08:00
Daniel Rosenberg
71d220c1de bionic: libc: Added path to vendor build properties file.
Change-Id: Ia9fc257a82fdd592751cbcde3fcf453a49856f62
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-11-11 12:18:22 -08:00
Andreas Gampe
00bbc7f69f Bionic: Make DISALLOW_COPY_AND_ASSIGN conditional
Make the definition of DISALLOW_COPY_AND_ASSIGN conditional. This is
so that the projects that include libnativehelper and bionic macros
do not have to be careful in which order those projects are included.

Bug: 18334516
Change-Id: Ib12a2c2b7ad2e360edcf3b26cb1be626540fadc1
2014-11-11 11:16:57 -08:00
Elliott Hughes
8c79b4ebb5 Add the <dirent.h> feature macros glibc uses.
Change-Id: I4da92b67d410839ea4ef0beaaa6c5cca06b74c0d
2014-11-10 15:17:28 -08:00
Elliott Hughes
e6ac9bb8a0 Remove temporary compatibility hack.
The callers have been fixed.

Bug: 18298106
Change-Id: I65e24032d0a82c4b118abace854d2dcdada881fb
2014-11-10 11:24:51 -08:00
Elliott Hughes
0ac0df84c7 Fix struct stat to match POSIX 2008.
Our representation of sub-second times matched the Linux kernel, and we
provided macros for glibc source compatibility. This change switches us
over to match POSIX 2008, adds the macros they insist on (for compatibility
with earlier versions of POSIX), and also adds macros for compatibility
with any code that expects the kernel or old bionic names.

Unfortunately this breaks strace which defines its own structures using
the kernel names, and thus implicitly assumes that there are no macros with
those names, but this does allow the rest of the tree to build.

Bug: 18298106
Change-Id: Ibfa8c21cb2a2566091ef3dc2019a9f78d2de2991
2014-11-07 19:15:10 -08:00
Elliott Hughes
b86a4c7f65 Add sethostname(2).
Not very useful, but helps building stuff like toybox out of the box.

Change-Id: I110e39030452bd093a84278e019c5752d293718d
2014-11-07 16:48:27 -08:00
Yabin Cui
5ca4a9e2da implement missing seekdir and telldir
Bug: 18266863
Change-Id: I189ee949d4f7ccee099f3341e349cd969d25480f
2014-11-07 10:20:32 -08:00
The Android Open Source Project
2ed9ee1e93 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2014-11-06 17:43:39 -08:00
Elliott Hughes
cd30cb3633 am 08a70184: Merge "Add POSIX lcong48."
* commit '08a70184b42ef2963794a56233b0253e0b367253':
  Add POSIX lcong48.
2014-11-07 00:58:34 +00:00
Elliott Hughes
b20c24456e Implement all the POSIX _l functions.
Strictly speaking, this only implements the _l variants of the functions
we actually have. We're still missing nl_langinfo_l, for example, but we
don't have nl_langinfo either.

Change-Id: Ie711c7b04e7b9100932a13f5a5d5b28847eb4c12
2014-11-06 15:52:22 -08:00
Elliott Hughes
274afe8f0e Add POSIX lcong48.
Change-Id: I821046816661d77275cb02c8c99d526bb41afb9c
2014-11-06 14:14:37 -08:00
Elliott Hughes
fa7e13b3af am a80f11ba: Merge "Add support for listing missing POSIX 2013 symbols."
* commit 'a80f11ba99a078515aa7e06dc99db62a475a7b53':
  Add support for listing missing POSIX 2013 symbols.
2014-11-06 06:08:32 +00:00
Elliott Hughes
6370aedd0e Add support for listing missing POSIX 2013 symbols.
Change-Id: Ic51787890f837f74a22ca63d64a5710474d00cbc
2014-11-05 16:54:53 -08:00
Elliott Hughes
eac625a210 am c13a2044: Merge "Fix newlocale with a NULL locale name."
* commit 'c13a2044e3b4d6084ef7ed32fb35e63e4157a96a':
  Fix newlocale with a NULL locale name.
2014-11-05 02:42:07 +00:00
Chih-Hung Hsieh
45f736b323 am 6c8f2475: Merge "Fix warning of missing field initializer."
* commit '6c8f247581890a25fb899767db220a8245859f71':
  Fix warning of missing field initializer.
2014-11-05 02:41:55 +00:00
Elliott Hughes
c13a2044e3 Merge "Fix newlocale with a NULL locale name." 2014-11-05 02:20:55 +00:00
Elliott Hughes
7e0d0f8572 Fix newlocale with a NULL locale name.
Bug: https://code.google.com/p/android/issues/detail?id=78567
Change-Id: I272dabc12ab186b44a525c7e8ac1846e62334e85
2014-11-04 18:03:44 -08:00
Chih-Hung Hsieh
dc6599e20f Fix warning of missing field initializer.
BUG: 18241135
Change-Id: I91304eb608bc3336ce5fcd5744fbe080d64f1cc2
2014-11-04 12:09:35 -08:00
Elliott Hughes
90138639a5 am e76ea9bb: Merge "Ensure we initialize stdin/stdout/stderr\'s recursive mutexes."
* commit 'e76ea9bbe0a8bccf97b88d09af13a84fd34a6a76':
  Ensure we initialize stdin/stdout/stderr's recursive mutexes.
2014-11-04 00:53:16 +00:00
Elliott Hughes
6a03abcfd2 Ensure we initialize stdin/stdout/stderr's recursive mutexes.
Bug: 18208568
Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
2014-11-03 12:32:17 -08:00
Elliott Hughes
25f4bb984c am e38bf839: Merge "limits.h: add define for HOST_NAME_MAX"
* commit 'e38bf839837d11542e7d1deb00d81542a0ef55b7':
  limits.h: add define for HOST_NAME_MAX
2014-10-30 16:02:29 +00:00
Elliott Hughes
e38bf83983 Merge "limits.h: add define for HOST_NAME_MAX" 2014-10-30 15:56:44 +00:00
Yongqin Liu
0589777a33 limits.h: add define for HOST_NAME_MAX
according to the rules defined here:
    http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
add the definition for HOST_NAME_MAX to limits.h file,
and set the default value to _POSIX_HOST_NAME_MAX as 255

Change-Id: Iddd5c6c569f4e0a14994c7a7c54985f3e7809fc4
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-30 10:59:24 +08:00
Elliott Hughes
4c29b1c266 am f362e9fb: Merge "Remove an unused file."
* commit 'f362e9fb33722f89cebe65ddf2f07d2b07e4390e':
  Remove an unused file.
2014-10-29 20:51:27 +00:00
Elliott Hughes
39cd0fa24a Remove an unused file.
We don't have any FreeBSD stdio left.

Bug: 17154680
Change-Id: I145627f564364ac8d4707d431d451cc3115c1c6a
2014-10-29 13:42:23 -07:00
Yabin Cui
63edd69e57 am cbb4606a: Merge "change unsigned int to uint32_t for api arc4random/arc4random_uniform"
* commit 'cbb4606ad00f084f984c92a8674400a112ea200e':
  change unsigned int to uint32_t for api arc4random/arc4random_uniform
2014-10-29 12:32:36 +00:00
Elliott Hughes
91bfaed26a am 13dcb88b: Merge "Disable tzdata in ."
* commit '13dcb88b0f8ce238456059fdc0b6c946caed1e3a':
  Disable tzdata in $ANDROID_DATA.
2014-10-29 12:32:23 +00:00
Elliott Hughes
912fe0a6df am f96eaf62: Merge "[x86,x86_64] Fix libgcc unwinding through signal"
* commit 'f96eaf6202351a1b5153cfaad3137e4b63846f8f':
  [x86,x86_64] Fix libgcc unwinding through signal
2014-10-29 12:31:52 +00:00
Yabin Cui
a39f939e0d change unsigned int to uint32_t for api arc4random/arc4random_uniform
Bug: 17894480
Change-Id: Ia4b5a7cd2b2c6002ed70955f86f7780d26d15e26
2014-10-28 13:44:48 -07:00
Elliott Hughes
7dbb1cff0b am 021b6412: Merge "Fix the type of u_ar0 in <sys/user.h>."
* commit '021b6412f7b7ce73b383480b25a8e5d69323f78c':
  Fix the type of u_ar0 in <sys/user.h>.
2014-10-28 19:28:34 +00:00
Elliott Hughes
ee8faa5e74 am 7f164f60: Merge "POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK."
* commit '7f164f6052b6dcee1c2cc70accdfac4b2c790b19':
  POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK.
2014-10-28 19:28:32 +00:00
Elliott Hughes
e24bf5d7b9 Disable tzdata in $ANDROID_DATA.
(cherry picked from 4c30130a2155c37e80af4c3b53bf4f6ce832e760.)

Bug: 18139284
Change-Id: I2670dc1791d635139a5d39a438dc08777439476b
2014-10-28 09:34:09 -07:00
Elliott Hughes
3f5d8a00e4 am cad8d226: Merge "Use mxcr_mask instead of mxcsr_mask to match glibc."
* commit 'cad8d226c3589a65775fda972d4cd3ebd3877dab':
  Use mxcr_mask instead of mxcsr_mask to match glibc.
2014-10-28 04:51:25 +00:00
Elliott Hughes
43ec1fb76c am a4c0b756: Merge "Add mkfifoat(3)."
* commit 'a4c0b7567190968d263bedd1073ea633510f9a45':
  Add mkfifoat(3).
2014-10-28 04:49:11 +00:00
Elliott Hughes
ac5df33e09 am 6c5694b6: Merge "Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3)."
* commit '6c5694b6c8343d740c36adbe904442cecd8030a6':
  Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
2014-10-28 04:33:09 +00:00
Pavel Chupin
50321e2e66 [x86,x86_64] Fix libgcc unwinding through signal
This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.

Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).

Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.

Bug: 17436734
Change-Id: I2f06814e82c8faa732cb4f5648868dc0fd2e5fe4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-10-27 16:14:55 -07:00
Elliott Hughes
021b6412f7 Merge "Fix the type of u_ar0 in <sys/user.h>." 2014-10-27 17:41:00 +00:00
Elliott Hughes
e03950fa0c Fix the type of u_ar0 in <sys/user.h>.
Change-Id: I9332dea60f7c60b45bc80026686c266bfa7a782c
2014-10-24 20:57:09 -07:00
Elliott Hughes
5b1111a694 POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK.
Found by unit test.

Change-Id: Iffbd2f04213616927fbd7b5419460031f7a078e9
2014-10-24 19:33:11 -07:00
Elliott Hughes
96a6f40163 am e516321d: Merge "Update bionic to tzdata2014i."
* commit 'e516321d78162479a4ce17bd5a9ba8c0834abf18':
  Update bionic to tzdata2014i.
2014-10-24 13:01:54 +00:00
Christopher Ferris
274f5e737d am efd2ec8f: Merge "Fix race condition in timer disarm/delete."
* commit 'efd2ec8fbddb99a7a2d7da8e1024655fa08153ca':
  Fix race condition in timer disarm/delete.
2014-10-24 13:01:53 +00:00
Elliott Hughes
f485547b92 Use mxcr_mask instead of mxcsr_mask to match glibc.
Bug: 18097559
Change-Id: Iaca301d7d4c4902989d4699117f72b88d5c4bd78
2014-10-23 20:29:42 -07:00
Elliott Hughes
ca8e84c6ff Add mkfifoat(3).
Looks like I missed one of the *at functions when I added the rest.

Change-Id: If16de82dbf6f9a3ea7bfdcba406ca1c74a3f2279
2014-10-23 19:10:54 -07:00
Derek Xue
ba811120ae Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
This change is to migrate the getaddrinfo tests defined in the old file
system/extras/tests/bionic/libc/common/test_getaddrinfo.c
to the new place bionic/tests/netdb_test.cpp.

The test here is more thorough, and catches a bug in getservbyname(3)
that was breaking getaddrinfo(3)'s ability to look up services by name
without a hint that would cause it to ask for a specific protocol.

Change-Id: Ief5ebd0869496d1bc6a97861dfefa04bdf24bab1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-22 22:23:10 -07:00
Elliott Hughes
e516321d78 Merge "Update bionic to tzdata2014i." 2014-10-22 20:41:44 +00:00
Christopher Ferris
62d84b1935 Fix race condition in timer disarm/delete.
When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727

(cherry pick from commit 0724132c32)

Change-Id: I135726ea4038a47920a6c511708813b1a9996c42
2014-10-22 13:20:39 -07:00
Elliott Hughes
a05c2a2a70 Update bionic to tzdata2014i.
From the release notes:

   Changes affecting future time stamps

     Pacific/Fiji will observe DST from 2014-11-02 02:00 to
     2015-01-18 03:00.  (Thanks to Ken Rylander for the heads-up.)
     Guess that future years will use a similar pattern.

     A new Zone Pacific/Bougainville, for the part of Papua New
     Guinea that plans to switch from UTC+10 to UTC+11 on
     2014-12-28 at 02:00.  (Thanks to Kiley Walbom for the
     heads-up.)

   Changes affecting time zone abbreviations

     Since Belarus is not changing its clocks even though Moscow
     is, the time zone abbreviation in Europe/Minsk is changing
     from FET to its more-traditional value MSK on 2014-10-26 at
     01:00.  (Thanks to Alexander Bokovoy for the heads-up about
     Belarus.)

     The new abbreviation IDT stands for the pre-1976 use of UT+8
     in Indochina, to distinguish it better from ICT (UT+7).

   Changes affecting past time stamps

     Many time stamps have been corrected for Asia/Ho_Chi_Minh
     before 1976 (thanks to Trần Ngọc Quân for an indirect pointer
     to Trần Tiến Bình's authoritative book).  Asia/Ho_Chi_Minh has
     been added to zone1970.tab, to give tzselect users in Vietnam
     two choices, since north and south Vietnam disagreed after our
     1970 cutoff.

     Asia/Phnom_Penh and Asia/Vientiane have been turned into
     links, as they differed from existing zones only for older
     time stamps.  As usual, these changes affect pre-1970 time
     stamps only.  Their old contents have been moved to the
     'backzone' file.

Bug: 18085936
Change-Id: I89c065b4788b10ed7530cc4e8cfbc1b65c05c1b7
2014-10-22 12:31:02 -07:00
Bill Yi
4b8c96d6cd Merge commit 'bc8745cc3dd94331d008d553a374e733df978963' into HEAD 2014-10-22 08:45:57 -07:00
Chih-Hung Hsieh
c89ee272fb Replace ambiguous cmp operator with cmpl.
Clang assembler rejects ambiguous cmp instruction.

BUG: 17302482
Change-Id: Ie8dca7e4f46e0906c47076bba21c1941482ba6b3
2014-10-21 16:25:35 -07:00
Dmitriy Ivanov
54d76360eb Merge "Rename library_offset to library_fd_offset" 2014-10-21 21:06:18 +00:00
Dmitriy Ivanov
a6c1279098 Rename library_offset to library_fd_offset
replace lseek() and use pread() instead
 add test for library_fd_offset > file_size case

Bug: 17762003
Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
2014-10-21 13:51:08 -07:00
Dan Albert
ad136624b2 Merge "Never use ASAN." 2014-10-21 18:28:19 +00:00
Dan Albert
5ba672ebcb Never use ASAN.
Unless we completely redo how we build bionic (so that the object
files for libc.so get built separately from libc.a), we can't enable
ASAN here, as libc.a gets linked into static executables.

Change-Id: I2ce4f51248bd51c4213a555ff481b6faabbf53f8
2014-10-21 11:22:26 -07:00
Christopher Ferris
bc8745cc3d am 8f41d3d3: Merge "Fix generic __memcpy_chk implementation."
* commit '8f41d3d3bc7cf2375e5dd9202da619fd67a5928f':
  Fix generic __memcpy_chk implementation.
2014-10-20 18:38:27 +00:00
Christopher Ferris
8f41d3d3bc Merge "Fix generic __memcpy_chk implementation." 2014-10-20 18:21:22 +00:00
Chih-Hung Hsieh
042319b908 am 9a740482: Merge "Add -no-integrated-as at local level."
* commit '9a7404824b3dfaad6ba14a41aab5f14132392a92':
  Add -no-integrated-as at local level.
2014-10-20 17:02:32 +00:00
Chih-Hung Hsieh
a371750681 Add -no-integrated-as at local level.
Later we will enable integrated-as as default at the global level.

BUG: 17820427
BUG: 17302991
Change-Id: I233204ca04d7222b2cb1fbd0fa48a482f8b63f6f
2014-10-20 09:09:25 -07:00
Christopher Ferris
7123d4371a Fix generic __memcpy_chk implementation.
- Clean up the labels (add .L to make them local).
- Change to using cfi directives.
- Fix unwinding of the __memcpy_chk fail path.

Bug: 18033671
Change-Id: I12845f10c7ce5e6699c15c558bda64c83f6a392a
2014-10-17 14:44:36 -07:00
Dan Albert
96def860ae am 90aa7e37: Merge "Only use <atomic> for C++11 and newer."
* commit '90aa7e374f9000577cde64c4fb88c5dab8dac62e':
  Only use <atomic> for C++11 and newer.
2014-10-16 16:27:37 +00:00
Dan Albert
3ce0769aa5 Only use <atomic> for C++11 and newer.
Any pre-C++11 clients of stdatomic.h that use libc++ are being forced
over to <atomic>, which they don't have the language support to use.

Change-Id: I62445c1f2541410a1569498c09433c7196635537
2014-10-16 07:52:51 -07:00
Dan Albert
8d87796d19 am 71cbcdcf: Merge "We don\'t actually need all of libc++ here."
* commit '71cbcdcf947835076241b9dd72099f28997eb290':
  We don't actually need all of libc++ here.
2014-10-15 20:10:06 +00:00
Dan Albert
71cbcdcf94 Merge "We don't actually need all of libc++ here." 2014-10-15 19:59:09 +00:00
Dan Albert
a7c2e0bad6 We don't actually need all of libc++ here.
All we're actually interested in is the unwinder. Since that's now a
separate library, just use that.

Change-Id: If86071a0d850da961336a58147b70369ace7bd12
2014-10-14 14:19:34 -07:00
Elliott Hughes
2476691632 am 97df16ba: Merge "Add clock_settime and clock_nanosleep."
* commit '97df16ba5c2911e06d1211781a5724706abd227b':
  Add clock_settime and clock_nanosleep.
2014-10-14 03:26:03 +00:00
Haruki Hasegawa
1816025684 Add clock_settime and clock_nanosleep.
Add the missing prototypes, fix the existing prototypes to use clockid_t
rather than int, fix clock_nanosleep's failure behavior, and add simple
tests.

Bug: 17644443
Bug: https://code.google.com/p/android/issues/detail?id=77372
Change-Id: I03fba369939403918abcabae9551a7123953d780
Signed-off-by: Haruki Hasegawa <h6a.h4i.0@gmail.com>
2014-10-13 17:04:10 -07:00
Dmitriy Ivanov
951e582c68 am c2297050: Merge "Add glibc alias for NT_PRFPREG"
* commit 'c229705051c8b6a06ad81c221ca74ef9aa743e13':
  Add glibc alias for NT_PRFPREG
2014-10-13 22:15:39 +00:00
Christopher Ferris
737b6581c2 am 083769a3: Merge "Return total footprint, not high water mark."
* commit '083769a3dffabfb968a03a700b9f2fd7838bcf75':
  Return total footprint, not high water mark.
2014-10-13 22:10:03 +00:00
Dan Albert
c01a38622a am 94571f9a: Merge "Use LOCAL_CXX_STL to select libc++_static."
* commit '94571f9ade03cfe24bff1bddc4d6c1a320b39b8e':
  Use LOCAL_CXX_STL to select libc++_static.
2014-10-13 22:10:00 +00:00
Dmitriy Ivanov
c229705051 Merge "Add glibc alias for NT_PRFPREG" 2014-10-13 22:08:52 +00:00
Dmitriy Ivanov
a6bee4df4c Add glibc alias for NT_PRFPREG
Also fix comment style for DF_1_ constants

Change-Id: I7c3ed1d834f0a2b85ee8cc8016c79020955084f8
2014-10-13 15:03:27 -07:00
Christopher Ferris
fee09e556f Return total footprint, not high water mark.
The mallinfo usmblks value returned by dlmalloc is a little misleading.
It's not the current max, it's the historical high water mark. This
leads to dumpsys meminfo producing native memory numbers that don't add up.
Change this to the real total footprint, not this high water mark.

Bug: 17265653

(cherry pick from commit f4ada9c9ce)

Change-Id: I2fba10285859dccfe8331063c9be14cc169f2d91
2014-10-13 12:45:35 -07:00
Dan Albert
90a29db0f4 Use LOCAL_CXX_STL to select libc++_static.
Directly adding the library to LOCAL_STATIC_LIBRARIES thwarts a few
build system checks.

Change-Id: Ib23c43badfa85de21c691f79ccdcc2cbe2a89b33
2014-10-13 11:20:29 -07:00
Christopher Ferris
472c21b437 am 62a665a6: Merge "Add back symbols to fix Greed for Glory franchise."
* commit '62a665a605df64a6ea5ac680bb564ad7a5f03711':
  Add back symbols to fix Greed for Glory franchise.
2014-10-10 06:38:26 +00:00
Christopher Ferris
78ba823033 Add back symbols to fix Greed for Glory franchise.
Bug: 17813018

(cherry picked from commit c891e24073)

Change-Id: I4e891c2dbad9ea00d2377c5175317d9ae3840153
2014-10-09 22:23:50 -07:00
Elliott Hughes
a852bb56e8 am e9c216fc: Merge "Fix pthread_attr_getstack under valgrind."
* commit 'e9c216fca56e84b0d0a96f7d5e3c99d3276ef071':
  Fix pthread_attr_getstack under valgrind.
2014-10-09 22:10:37 +00:00
Elliott Hughes
9afb2f2106 Fix pthread_attr_getstack under valgrind.
valgrind seems to mess with the stack enough that the kernel will
report "[stack:pid]" rather than "[stack]" in /proc/self/maps, so
switch to the task-specific file instead to force "[stack]". (There
are two conditions in the kernel code that decides which form to
output.)

Bug: 17897476
Change-Id: Iff85ceb6d52e8716251fab4e45d95a27184c5529
2014-10-09 14:01:47 -07:00
Christopher Ferris
95296d4129 am d0944d9e: Merge "Re-add dlmalloc for 32 bit."
* commit 'd0944d9ed38be0d74c3d8876f0f36b9ddc0ce38c':
  Re-add dlmalloc for 32 bit.
2014-10-09 18:59:43 +00:00
Christopher Ferris
f183f95946 Re-add dlmalloc for 32 bit.
It turns out that appportable has a version that calls dlmalloc directly.
Re-add the dlmalloc symbol for 32 bit only as a compatibility shim that
calls malloc.

Bug: 17881362

(cherry pick commit from c9734d24d9)

Change-Id: Iee9a777f66a1edb407d7563a60792b767ac4f83a
2014-10-09 11:47:01 -07:00
Dan Albert
b9122b73bf am 8a7f8387: Merge "Use snprintf(3) instead of sprintf(3)."
* commit '8a7f8387b3b95de2ee0c42e34a226a1fcc066896':
  Use snprintf(3) instead of sprintf(3).
2014-10-09 00:40:24 +00:00
Dan Albert
a2220ffb74 am 72d72d91: Merge "Replace uses of sprintf(3) with snprintf(3)."
* commit '72d72d91262fabe6bc169618ef3acb0721441cf0':
  Replace uses of sprintf(3) with snprintf(3).
2014-10-09 00:13:06 +00:00
Dan Albert
ca75f9cdeb Use snprintf(3) instead of sprintf(3).
This change should probably be made upstream as well, but they have a
note about not using it because it isn't available on all systems.

Change-Id: I6d8404c031bd2f486532ced55d94bbb4a4cd2e71
2014-10-08 17:10:26 -07:00
Dan Albert
72d72d9126 Merge "Replace uses of sprintf(3) with snprintf(3)." 2014-10-08 23:44:48 +00:00
Dan Albert
cfd8c45725 Replace uses of sprintf(3) with snprintf(3).
At -00, the compiler warns about sprintf(3), and it is promoted to an
error by -Werror.

Change-Id: Ibb380d27d7eb09dda8ac785be2478d656b379190
2014-10-08 16:12:27 -07:00
Elliott Hughes
9a96ca3ec4 am 0511534d: Merge "Don\'t silently return EINVAL for a NULL sem_t*."
* commit '0511534dcbb00f26b2fd6209b1b60a3263bf042c':
  Don't silently return EINVAL for a NULL sem_t*.
2014-10-08 22:49:21 +00:00
Elliott Hughes
75129ae9f3 Don't silently return EINVAL for a NULL sem_t*.
Bug: 17571197
Change-Id: Ied31d8de87fc10d20dc338be0457e9a4ddb9a0a5
2014-10-08 15:11:44 -07:00
Elliott Hughes
b559513e08 am 5a3ca374: Merge "Revert "Work around a bug in Immersion\'s libImmEmulatorJ.so.""
* commit '5a3ca374583f7605672d9e8f9098011de240f7c4':
  Revert "Work around a bug in Immersion's libImmEmulatorJ.so."
2014-10-08 16:49:35 +00:00
Elliott Hughes
5a3ca37458 Merge "Revert "Work around a bug in Immersion's libImmEmulatorJ.so."" 2014-10-08 16:40:58 +00:00
Dan Albert
6c4a64e3e2 am c9e4f2de: Merge "Inline helpers need to be exported unmangled."
* commit 'c9e4f2de0a92ebf6dec336f383ba172efe1bb366':
  Inline helpers need to be exported unmangled.
2014-10-08 00:12:32 +00:00
Dan Albert
c9e4f2de0a Merge "Inline helpers need to be exported unmangled." 2014-10-08 00:01:08 +00:00
Dan Albert
658727e111 Inline helpers need to be exported unmangled.
__open_2() is used by the fortify implementation of open(2) in
fcntl.h, and as such needs an unmangled C name. For some reason
(inlining?), this doesn't cause problems at the default optimization
level, but does for -O0.

The rest of these didn't cause build failures, but they look suspect
and probably will, we just haven't caught them yet.

Bug: 17784968
Change-Id: I7391a7a8999ee204eaf6abd14a3d5373ea419d5b
2014-10-07 16:46:47 -07:00
Elliott Hughes
3d773274ad Revert "Work around a bug in Immersion's libImmEmulatorJ.so."
This reverts commit 7d3f553f98.

Change-Id: I8909b6aa1d97e9a61dbe95a2d91b9fbe336b58f0
2014-10-07 23:31:06 +00:00
Elliott Hughes
e698a7b5cf am e8d9057e: Merge "Work around a bug in Immersion\'s libImmEmulatorJ.so."
* commit 'e8d9057e3005f6f53f8ef2e876b43aea7a892292':
  Work around a bug in Immersion's libImmEmulatorJ.so.
2014-10-07 23:20:57 +00:00
Elliott Hughes
7d3f553f98 Work around a bug in Immersion's libImmEmulatorJ.so.
This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL
pthread_mutex_t*. This gives them (and their users) one release to fix things.

Bug: 17443936
Change-Id: I3b63c9a3dd63db0833f21073e323b3236a13b47a
2014-10-07 16:02:11 -07:00
Dan Albert
7c955d7797 am eeb9aa02: Merge "Use snprintf instead of sprintf."
* commit 'eeb9aa02b7f307a1d9b80731dd69ef9dd2f47e47':
  Use snprintf instead of sprintf.
2014-10-07 18:46:32 +00:00
Dan Albert
b0fd55608e Use snprintf instead of sprintf.
At -O0, the attribute warning on sprintf is actually triggered (why
doesn't this happen with -Os?!) and promoted to an error by -Werror.
asctime64_r() is a non-standard function, but the IBM docs state that
the buffer is assumed to be at least 26 characters wide, and the
format string does limit to that (assuming a 4 digit year, also
defined by the IBM docs).

http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/asctimer.htm

Change-Id: I1c884474a769aa16c53e985c3d8d694c478c1189
2014-10-07 11:28:47 -07:00
Christopher Ferris
6869d26ad9 Force export symbols on all x86 variants in libc.
For silvermont, the __popcountsi2 symbol does not get exported by libc.
But for atom, this symbol is exported. Since we already exported this symbol
for previous releases, it's better to just follow through and force
the export, but only for 32 bit. x86 64 bit will not export this symbol.

Bug: 17681440

(cherry picked from commit d11eac3455)

Change-Id: I93704c721d98d569922f606f214069bda24872ba
2014-10-06 16:41:46 -07:00
Christopher Ferris
9a7d31eb9c Merge "resolved conflicts for merge of d11eac34 to lmp-dev-plus-aosp" into lmp-dev-plus-aosp 2014-10-06 23:32:53 +00:00
Christopher Ferris
d61d2b7b80 resolved conflicts for merge of d11eac34 to lmp-dev-plus-aosp
Change-Id: I3cd9056d5d689b783f4afa870397ad4d9de357f5
2014-10-06 16:30:45 -07:00
Nick Kralevich
2d04b5e09f am b5cba608: Merge "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"
* commit 'b5cba6081bc9179d3ea2aa1bfd77dd8de1c88525':
  cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
2014-10-06 23:29:04 +00:00
Christopher Ferris
d11eac3455 Force export symbols on all x86 variants in libc.
For silvermont, the __popcountsi2 symbol does not get exported by libc.
But for atom, this symbol is exported. Since we already exported this symbol
for previous releases, it's better to just follow through and force
the export, but only for 32 bit. x86 64 bit will not export this symbol.

Bug: 17681440
Change-Id: I6c62245f0960910f64baaaf6d9d090bf3ea5f435
2014-10-06 15:51:26 -07:00
Nick Kralevich
1aaa17802c cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
Otherwise the gcc compiler warning doesn't show up.

Add -Wno-error to fortify related tests. Fortify related tests
are expected to be examples of bad programs, and in many
cases shouldn't compile cleanly. Rewriting them to compile
cleanly isn't feasible nor desirable.

Bug: 17784968
Change-Id: I93bececa7444d965f18c7c27d46e7abce5c49a02
2014-10-06 15:11:52 -07:00
Dmitriy Ivanov
47388d8297 am 6d569b92: Merge "Add file_offset parameter to android_extinfo"
* commit '6d569b92012543a297dccf2dfeaa648d07b3c133':
  Add file_offset parameter to android_extinfo
2014-10-06 17:28:54 +00:00
Dmitriy Ivanov
6d569b9201 Merge "Add file_offset parameter to android_extinfo" 2014-10-06 17:19:39 +00:00
Dmitriy Ivanov
07e5bc152d Add file_offset parameter to android_extinfo
Bug: 17762003
Change-Id: I8fb267a3155acef3dba534038cf5d1ef00d7154b
2014-10-06 10:02:34 -07:00
Nick Kralevich
0fd98ec4d7 am a6eef3be: Merge "Revert "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions""
* commit 'a6eef3be105fb34161fd1b1d513f7d03b5f1bbe9':
  Revert "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"
2014-10-06 00:44:49 +00:00
Nick Kralevich
a6eef3be10 Merge "Revert "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"" 2014-10-06 00:40:07 +00:00
Nick Kralevich
884a3de60f Revert "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"
Broke the build.

In file included from frameworks/rs/cpu_ref/rsCpuCore.cpp:36:
system/core/include/cutils/properties.h:118:1: error: unknown attribute '__artificial__' ignored [-Werror,-Wunknown-attributes]
__BIONIC_FORTIFY_INLINE
^
bionic/libc/include/sys/cdefs.h:537:110: note: expanded from macro '__BIONIC_FORTIFY_INLINE'
#define __BIONIC_FORTIFY_INLINE extern __inline__ __always_inline __attribute__((gnu_inline)) __attribute__((__artificial__))
                                                                                                             ^
1 error generated.
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libRSCpuRef_intermediates/rsCpuCore.o] Error 1
This reverts commit 9b543ffeac.

Change-Id: I6a1198747505dcb402b722887c1bfbc3a628a8b8
2014-10-06 00:39:47 +00:00
Nick Kralevich
036cd686af am 558ec810: Merge "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions"
* commit '558ec8103bad6eed78c3e372fc9b2535a3486745':
  cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
2014-10-06 00:17:24 +00:00
Nick Kralevich
558ec8103b Merge "cdefs.h: add artificial attribute to FORTIFY_SOURCE functions" 2014-10-06 00:10:48 +00:00
Nick Kralevich
10450b14f7 am db6fea86: Merge "further cleanup memcpy fortify implementation"
* commit 'db6fea86a5cb70c5aaad61ef6c126557f36e138b':
  further cleanup memcpy fortify implementation
2014-10-05 16:52:37 +00:00
Nick Kralevich
b84f667e93 further cleanup memcpy fortify implementation
Change-Id: I0380f3c8ca8f9bb8a206accd839c32c9daf13c56
2014-10-05 06:52:24 -07:00
Nick Kralevich
9b543ffeac cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
Otherwise the gcc compiler warning doesn't show up.

Delete some unittests. These unittests no longer compile cleanly
using -Wall -Werror, and rewriting them to compile cleanly
isn't feasible.

Bug: 17784968
Change-Id: I9bbdc7b6a1c2ac75754f5d0f90782e0dfae66721
2014-10-04 22:01:41 -07:00
Nick Kralevich
2b208d96af am ae97a776: Merge "string.h: remove unused variable"
* commit 'ae97a776ea900e5923d6d320d72dcc04b224796e':
  string.h: remove unused variable
2014-10-04 22:47:10 +00:00
Nick Kralevich
48be71d02b string.h: remove unused variable
Change-Id: I08b7dab1b374ad427fcbee4183f2c7d93d0199a9
2014-10-04 15:20:00 -07:00
Elliott Hughes
b4954dc384 am 4ef0e59f: Merge "Reimplement clock(3) using clock_gettime(3)"
* commit '4ef0e59f339ad138eabe3bc408beda6004f5ea83':
  Reimplement clock(3) using clock_gettime(3)
2014-10-04 02:24:08 +00:00
Alex Van Brunt
a508714800 Reimplement clock(3) using clock_gettime(3)
Unlike times(), clock_gettime() is implemented as a vDSO on many architectures.
So, using clock_gettime() will return a more accurate time and do so with less
overhead because it does have the overhead of calling into the kernel.

It is also significantly more accurate because it measures the actual time in
nanoseconds rather than the number of ticks (typically 1 millisecond or more).

Bug: 17814435

(cherry picked from commit 8d0b2dbf21)

Change-Id: Id4945d9f387330518f78669809639952e9227ed9
2014-10-03 19:05:52 -07:00
Alex Van Brunt
8d0b2dbf21 Reimplement clock(3) using clock_gettime(3)
Unlike times(), clock_gettime() is implemented as a vDSO on many architectures.
So, using clock_gettime() will return a more accurate time and do so with less
overhead because it does have the overhead of calling into the kernel.

It is also significantly more accurate because it measures the actual time in
nanoseconds rather than the number of ticks (typically 1 millisecond or more).

Bug: 17814435
Change-Id: Id4945d9f387330518f78669809639952e9227ed9
2014-10-03 18:54:28 -07:00
Elliott Hughes
ea9800e985 Explain why clock(3) isn't broken.
Bug: 17441123
Bug: 17814435

(cherry picked from commit f83c208b82)

Change-Id: I2065afe73b79a8d86404edee16e983625d902cdc
2014-10-03 16:46:20 -07:00
Dmitriy Ivanov
fc046eca0b am d5df4124: Merge "Add RTLD_NODELETE flag support"
* commit 'd5df4124bbbb30411ef19f7c2fbb3987d0eb9630':
  Add RTLD_NODELETE flag support
2014-10-03 16:53:33 +00:00
Dmitriy Ivanov
d5df4124bb Merge "Add RTLD_NODELETE flag support" 2014-10-02 21:47:29 +00:00
Hans Boehm
f26a55e13a am 2d111d9e: Merge "Make memory_order_acquire visible in global namespace"
* commit '2d111d9eb10b6c48e2e47251be66b418a6109dd9':
  Make memory_order_acquire visible in global namespace
2014-10-01 19:23:05 +00:00
Hans Boehm
2d111d9eb1 Merge "Make memory_order_acquire visible in global namespace" 2014-10-01 19:16:50 +00:00
Christopher Ferris
3a25cdfd33 am b19bd93f: Merge "Add stpcpy assembler version."
* commit 'b19bd93f8b83307f2f7530545f7c78824914f4eb':
  Add stpcpy assembler version.
2014-10-01 18:24:16 +00:00
Christopher Ferris
b19bd93f8b Merge "Add stpcpy assembler version." 2014-10-01 18:16:14 +00:00
Dmitriy Ivanov
1b20dafdbe Add RTLD_NODELETE flag support
Bug: https://code.google.com/p/android/issues/detail?id=64069
Change-Id: Ie5f90482feae86391172be4b32d6cb7d76f446fb
2014-10-01 11:09:37 -07:00
Elliott Hughes
1f84254edb am cadccfd7: Merge "Update bionic to tzdata 2014h."
* commit 'cadccfd70821aeb107b8fc0084da04faecbfde2f':
  Update bionic to tzdata 2014h.
2014-10-01 17:35:56 +00:00
Elliott Hughes
44ba5935e9 am 89fd3236: Merge "Fix update-tzdata.py to rebuild icu4c .dat file."
* commit '89fd32362bb62775aad001802bc79e3f07d7d62f':
  Fix update-tzdata.py to rebuild icu4c .dat file.
2014-10-01 17:35:55 +00:00
Elliott Hughes
cadccfd708 Merge "Update bionic to tzdata 2014h." 2014-10-01 17:20:34 +00:00
Christopher Ferris
7d849ac378 Add stpcpy assembler version.
For generic, continue to use the C version of the code.

Bug: 13746695
Change-Id: I77426a70b06131f2373bb51265bea1240bb3f101
2014-09-30 19:23:26 -07:00
Hans Boehm
76ac4d0853 Make memory_order_acquire visible in global namespace
We were missing that using directive when including <atomic>.

Bug:17736764
Change-Id: Ie8ca92a952749415567bcd5fa21d56629a364660
2014-09-30 18:35:04 -07:00
Elliott Hughes
0c8fb51e6b Update bionic to tzdata 2014h.
From the release notes:

  Changes affecting past time stamps

    America/Jamaica's 1974 spring-forward transition was Jan. 6, not Apr. 28.

    Shanks says Asia/Novokuznetsk switched from LMT (not "NMT") on 1924-05-01,
    not 1920-01-06.  The old entry was based on a misinterpretation of Shanks.

    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/Blantyre, Africa/Bujumbura,
    Africa/Gaborone, Africa/Harare, Africa/Kigali, Africa/Lubumbashi,
    Africa/Lusaka, Africa/Maseru, and Africa/Mbabane.

Bug: 17731498
Change-Id: If65b740d4e3a67075cca770655a1df17952c3da0
2014-09-30 17:35:38 -07:00
Elliott Hughes
f8896c6c93 Fix update-tzdata.py to rebuild icu4c .dat file.
Bug: 17731498
Change-Id: I4c810507c0ca9883dde1bece14530db80485b8f6
2014-09-30 17:30:01 -07:00
Elliott Hughes
d0fb0873f5 am 252c1ac9: Merge "Update our FreeBSD realpath(3) to upstream head."
* commit '252c1ac9738ff6187354f243ef118eac962b65dc':
  Update our FreeBSD realpath(3) to upstream head.
2014-10-01 00:05:58 +00:00
Dmitriy Ivanov
c1429de2eb am 1f7d5ac5: Merge "Fix unused DT entry warnings."
* commit '1f7d5ac53854a09bbcace08b3a1d1b9cf3f2eed3':
  Fix unused DT entry warnings.
2014-09-30 23:52:10 +00:00
Elliott Hughes
31e072fc9b Update our FreeBSD realpath(3) to upstream head.
Change-Id: I8c89728184ecd2c1a28a05cefa84a5037d28b552
2014-09-30 16:40:41 -07:00
Dmitriy Ivanov
6cdeb5234d Fix unused DT entry warnings.
DT_STRSZ Implement strtab boundary checks
 DT_FLAGS_1 Warn if flags other than DF_1_NOW|DF_1_GLOBAL are set

Bug: 17552334
Change-Id: Iaad29cd52f5b2d7d2f785fb351697906dc1617d9
2014-09-30 14:41:29 -07:00
Andrew Hsieh
98630f6cb7 am b104be32: Merge "Remove arch-mips64/bionic/__get_sp.S"
* commit 'b104be321f2538a6e0bbd566bc958537d1f65cef':
  Remove arch-mips64/bionic/__get_sp.S
2014-09-30 04:17:06 +00:00
Christopher Ferris
7de591d19b am 85a932c0: Merge "Cleanup arm assembly."
* commit '85a932c0c9225e0f71d94a0d8cbac85089a398cf':
  Cleanup arm assembly.
2014-09-30 04:17:05 +00:00
Andrew Hsieh
b0c0037370 Remove arch-mips64/bionic/__get_sp.S
__get_sp.S doesn't exist

Change-Id: Id84f8904c8022c683263a317a18fabeb50fed992
2014-09-30 07:55:32 +08:00
Christopher Ferris
c8bd2abab2 Cleanup arm assembly.
Remove the old arm directives.
Change the non-local labels to .L labels.
Add cfi directives to strcpy.S.

Change-Id: I9bafee1ffe5d85c92d07cfa8a85338cef9759562
2014-09-29 15:53:10 -07:00
Dan Albert
6251d58e66 am 73e6c9b3: Merge "Static libc++ is being renamed libc++_static."
* commit '73e6c9b39353807aae80170355ec0b67b7a4ce16':
  Static libc++ is being renamed libc++_static.
2014-09-29 20:55:46 +00:00
Dan Albert
188d093993 Static libc++ is being renamed libc++_static.
Change-Id: I1596110e4ed7e8f9ab9e2605dfcd9fd0489ca0d1
2014-09-27 09:22:07 -07:00
Dan Albert
5eb62b3919 am 7ca5c4b9: Merge "Make __aeabi_*() symbols weak."
* commit '7ca5c4b99b308550e34e185ed632b8a5ad5341ee':
  Make __aeabi_*() symbols weak.
2014-09-27 00:29:49 +00:00
Dan Albert
690211fcf8 Make __aeabi_*() symbols weak.
This is needed to avoid multiple symbol definitions when linking with
libstdc++ or with compiler-rt.

Change-Id: I2f713bcff113222f0d2538e49691e715d8a8475d
2014-09-26 15:36:14 -07:00
Christopher Ferris
1d8b9213a9 am aa66e882: Merge "Add __memcpy_chk assembly for 64 bit."
* commit 'aa66e8828048d8d6fd7e4bb9c5e341ed89614266':
  Add __memcpy_chk assembly for 64 bit.
2014-09-26 21:04:41 +00:00
Christopher Ferris
8cf61dab5f Add __memcpy_chk assembly for 64 bit.
Bug: 17623887
Change-Id: I443723bc941b40f84884b330d222baabee01f868
2014-09-26 12:47:04 -07:00
Elliott Hughes
e74a9d0b35 am aaad5485: Merge "Re-expose more stdio implementation details for LP32." into lmp-dev
* commit 'aaad548535c34e2bba16b2a0b71173e0ae4b16c0':
  Re-expose more stdio implementation details for LP32.
2014-09-25 03:13:56 +00:00
Elliott Hughes
abefc93ff3 Re-expose more stdio implementation details for LP32.
Keeps a variety of apps running.

(cherry-pick of 5def2f5aecd968e4022b0afbe4441fa7ba3e7c7e.)

Bug: 17047819
Change-Id: I55882ec95f2b59a5df76e5a89c23aa315609e01d
2014-09-24 20:07:10 -07:00
Elliott Hughes
5def2f5aec Re-expose more stdio implementation details for LP32.
Keeps a variety of apps running.

Bug: 17047819
Change-Id: I55882ec95f2b59a5df76e5a89c23aa315609e01d
2014-09-24 17:20:53 -07:00
Elliott Hughes
49471f3809 am 567d3fcb: Merge "Switch to OpenBSD fopen/fclose."
* commit '567d3fcb7ece287a84912183e91eff851fa48fc2':
  Switch to OpenBSD fopen/fclose.
2014-09-24 20:44:46 +00:00
Elliott Hughes
d98cac5fbb am 4fcfd3a4: Merge "Sync with current upstream getopt_long.c."
* commit '4fcfd3a474ae5a9e5095ca92a10a8aaa0a3dae5a':
  Sync with current upstream getopt_long.c.
2014-09-24 20:44:45 +00:00
Elliott Hughes
567d3fcb7e Merge "Switch to OpenBSD fopen/fclose." 2014-09-24 20:24:48 +00:00
Elliott Hughes
af12924f67 Sync with current upstream getopt_long.c.
Change-Id: I269195aa581a688fd3eb99552d506b8f5f6a8395
2014-09-24 12:39:34 -07:00
Elliott Hughes
5a69da8d7a Switch to OpenBSD fopen/fclose.
This means all our stdio implementation is now the OpenBSD implementation.
The only thing we lose is the STDIO_THREAD_LOCK calls but they were no-ops
anyway.

We should probably talk to upstream about this. Either fix the locking or,
preferably, encourage them to move away from this pooling (especially since
there's no eviction policy).

Bug: 17154680
Change-Id: Ie2523e444a7d0965b8d141d57e3e11f6432d5b9a
2014-09-24 11:14:36 -07:00
Elliott Hughes
7a2a1a8b6c am f05410ed: Merge "Sync with upstream findfp.c."
* commit 'f05410edc634040f96643b8f378320faddfef423':
  Sync with upstream findfp.c.
2014-09-24 18:09:37 +00:00
Elliott Hughes
f05410edc6 Merge "Sync with upstream findfp.c." 2014-09-24 17:48:59 +00:00
Dan Albert
0d78bad579 am 21db6ff1: Merge "Coverage configs for bionic."
* commit '21db6ff108a8df43582bf2ca0d7d6c925f26b5e5':
  Coverage configs for bionic.
2014-09-24 17:45:54 +00:00
Elliott Hughes
c08c25b4c9 Sync with upstream findfp.c.
Change-Id: Ib298f46de0c4d0fd4ce0a9b456c163e8b8b06342
2014-09-24 10:32:30 -07:00
Dan Albert
21db6ff108 Merge "Coverage configs for bionic." 2014-09-24 17:28:04 +00:00
Dan Albert
c2d39088d8 Coverage configs for bionic.
Bug: 17553780
Change-Id: Iee7d0c210e2379e71e0c1e4e7058bce23f61e8cd
2014-09-24 10:26:41 -07:00
Dan Albert
b14a903421 am fc5a93f7: Merge "Fix incorrect parameter types for locale funcs."
* commit 'fc5a93f7a2ea2be740f2c909e8a6a192fa65adc8':
  Fix incorrect parameter types for locale funcs.
2014-09-24 16:13:50 +00:00
Dan Albert
086bb382db Fix incorrect parameter types for locale funcs.
strtoll(3), strtoull(3), wcstoll(3), and wcstoull(3) all take an _int_
as a base, not a size_t. This is an ABI compatibility issue.

Bug: 17628622
Change-Id: I17f8eead34ce2112005899fc30162067573023ec
(cherry picked from commit 3c5037f1b3)
2014-09-24 09:00:42 -07:00
Dan Albert
fc5a93f7a2 Merge "Fix incorrect parameter types for locale funcs." 2014-09-24 16:00:07 +00:00
Elliott Hughes
f6067fa2e0 am ebf37e38: Merge "Switch to OpenBSD flags.c."
* commit 'ebf37e38861e376ae47c72d45ab8de6703dd18f0':
  Switch to OpenBSD flags.c.
2014-09-24 05:08:23 +00:00
Elliott Hughes
ebf37e3886 Merge "Switch to OpenBSD flags.c." 2014-09-24 04:50:45 +00:00
Christopher Ferris
f5da2641c3 am 04643c18: Merge "Remove the unnecessary generic-neon code."
* commit '04643c181c3256348a6fd78e54c8bc5527ad0b0a':
  Remove the unnecessary generic-neon code.
2014-09-24 04:15:16 +00:00
Christopher Ferris
04643c181c Merge "Remove the unnecessary generic-neon code." 2014-09-24 04:01:23 +00:00
Elliott Hughes
a71b4c3f14 Switch to OpenBSD flags.c.
Change-Id: I0a35e5bd9f8edba27e0c73e5c8150636346d6a81
2014-09-23 20:02:42 -07:00
Elliott Hughes
42317a0e50 am c57e5c82: Merge "CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps."
* commit 'c57e5c828914714a283dd41f0a4adb064f6b8763':
  CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps.
2014-09-24 02:10:59 +00:00
Christopher Ferris
2169e17482 Remove the unnecessary generic-neon code.
Change-Id: Ib75c33caafd76750ec1aca3a74dec5e4b881e965
2014-09-23 18:31:45 -07:00
Elliott Hughes
31165edf57 CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps.
Change-Id: I74ea88e0d4973d6ab3c57da7d8bb643c31592b14
2014-09-23 18:21:52 -07:00
Dan Albert
3c5037f1b3 Fix incorrect parameter types for locale funcs.
strtoll(3), strtoull(3), wcstoll(3), and wcstoull(3) all take an _int_
as a base, not a size_t. This is an ABI compatibility issue.

Bug: 17628622
Change-Id: I17f8eead34ce2112005899fc30162067573023ec
2014-09-23 15:32:24 -07:00
Elliott Hughes
0d44da9eb4 am 87b6906f: Merge "Pull in upstream fixes to reject invalid bases."
* commit '87b6906f6e0c17b2541535be8e054324cc2fef4a':
  Pull in upstream fixes to reject invalid bases.
2014-09-23 22:12:57 +00:00
Elliott Hughes
b05ec5ae93 Pull in upstream fixes to reject invalid bases.
Also add tests to make sure the full set works correctly.

Change-Id: I3e7f237f12c9c93e1185a97c9717803e7e55a73c
2014-09-23 14:53:10 -07:00
Elliott Hughes
3a86c0fd90 am 86421653: Merge "Sync with some upstream OpenBSD #include cleanup."
* commit '8642165344217877b8a70811d19e09b584a0e10a':
  Sync with some upstream OpenBSD #include cleanup.
2014-09-23 21:48:00 +00:00
Elliott Hughes
0c1008b9d8 am 0ab5fd9a: Merge "Switch to OpenBSD insque/remque/killpg."
* commit '0ab5fd9a5af4cd00572e4881f46c1e6f974f657c':
  Switch to OpenBSD insque/remque/killpg.
2014-09-23 21:48:00 +00:00
Elliott Hughes
8642165344 Merge "Sync with some upstream OpenBSD #include cleanup." 2014-09-23 21:27:29 +00:00
Elliott Hughes
49eed7db79 Switch to OpenBSD insque/remque/killpg.
Change-Id: Ie02290ad3187b1c1596dd776fd1c8a743a55f7ef
2014-09-23 14:06:56 -07:00
Elliott Hughes
08dc9d83a2 Sync with some upstream OpenBSD #include cleanup.
Change-Id: Ibcd7adb19e9a6b9ad8c24d77e23935f19f56a144
2014-09-23 13:55:15 -07:00
Elliott Hughes
c65a1d5ee0 am 93951cfa: Merge "Fix a couple more cases of missing CLOEXEC."
* commit '93951cfa96c3c7504a78f94e7ec408936e5db9bf':
  Fix a couple more cases of missing CLOEXEC.
2014-09-23 01:39:11 +00:00
Elliott Hughes
0dc39f9952 Fix a couple more cases of missing CLOEXEC.
The debuggerd case can probably never happen, because you're crashing at this
point anyway. The system property one seems possible though.

Change-Id: Idba6a4f1d68587ec5b320d1e25f0b6a987ea32a0
2014-09-22 17:43:09 -07:00
Elliott Hughes
1f2e845f9a am b2da4562: Merge "Clean up fpathconf(3)/pathconf(3)."
* commit 'b2da45625353336452112e28872310903dc70a8f':
  Clean up fpathconf(3)/pathconf(3).
2014-09-22 23:05:35 +00:00