Commit graph

5960 commits

Author SHA1 Message Date
Yabin Cui
f5d4f322bb am 448a8596: Merge "Switch system_properties.cpp from bionic atomic operations to stdatomic."
* commit '448a85968da1e4622e829bb48fd888a38f9f6c49':
  Switch system_properties.cpp from bionic atomic operations to stdatomic.
2015-02-25 21:10:42 +00:00
Yabin Cui
448a85968d Merge "Switch system_properties.cpp from bionic atomic operations to stdatomic." 2015-02-25 21:04:56 +00:00
Yabin Cui
a1e4a4a3c6 am 8c41eae6: Merge "Move getusershell/endusershell/setusershell to ndk_cruft.cpp."
* commit '8c41eae6fcdb6cad1f6c46ae01708ead6b734060':
  Move getusershell/endusershell/setusershell to ndk_cruft.cpp.
2015-02-25 00:05:52 +00:00
Yabin Cui
8c41eae6fc Merge "Move getusershell/endusershell/setusershell to ndk_cruft.cpp." 2015-02-25 00:00:51 +00:00
Yabin Cui
7fb680bfda Move getusershell/endusershell/setusershell to ndk_cruft.cpp.
Bug: 19108648
Change-Id: I65134040345398dde612c4325d902db58f3bd2be
2015-02-24 14:46:59 -08:00
Nick Kralevich
e93bc6bbe8 am d91ded81: Merge "Fix "faccessat ignores flags""
* commit 'd91ded81376a10a1c89f7a5ae3c462ae3b24188e':
  Fix "faccessat ignores flags"
2015-02-24 21:52:36 +00:00
Nick Kralevich
35778253a5 Fix "faccessat ignores flags"
The kernel system call faccessat() does not have any flags arguments,
so passing flags to the kernel is currently ignored.

Fix the kernel system call so that no flags argument is passed in.

Ensure that we don't support AT_SYMLINK_NOFOLLOW. This non-POSIX
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
flag is a glibc extension, and has non-intuitive, error prone behavior.

For example, consider the following code:

  symlink("foo.is.dangling", "foo");
  if (faccessat(AT_FDCWD, "foo", R_OK, AT_SYMLINK_NOFOLLOW) == 0) {
    int fd = openat(AT_FDCWD, "foo", O_RDONLY | O_NOFOLLOW);
  }

The faccessat() call in glibc will return true, but an attempt to
open the dangling symlink will end up failing. GLIBC documents this
as returning the access mode of the symlink itself, which will
always return true for any symlink on Linux.

Some further discussions of this are at:

  * http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003617.html
  * http://permalink.gmane.org/gmane.linux.lib.musl.general/6952

AT_SYMLINK_NOFOLLOW seems broken by design. I suspect this is why this
function was never added to POSIX. (note that "access" is pretty much
broken by design too, since it introduces a race condition between
check and action). We shouldn't support this until it's clearly
documented by POSIX or we can have it produce intuitive results.

Don't support AT_EACCESS for now. Implementing it is complicated, and
pretty much useless on Android, since we don't have setuid binaries.
See http://git.musl-libc.org/cgit/musl/commit/?id=0a05eace163cee9b08571d2ff9d90f5e82d9c228
for how an implementation might look.

Bug: 18867827
Change-Id: I25b86c5020f3152ffa3ac3047f6c4152908d0e04
2015-02-24 13:40:43 -08:00
Yabin Cui
b8ce474217 Switch system_properties.cpp from bionic atomic operations to stdatomic.
Bug: 17177189
Change-Id: I42e05ad1c490cc7a8040138151afc0ee72a9b63f
2015-02-24 10:41:53 -08:00
Elliott Hughes
4ec60a0178 am 2aef607b: Merge "Fix dup2 in the case where the two fds are equal."
* commit '2aef607b25c463baed5ae70d14212e24ea7bcf2b':
  Fix dup2 in the case where the two fds are equal.
2015-02-24 05:59:52 +00:00
Elliott Hughes
be52e65817 Fix dup2 in the case where the two fds are equal.
dup3's behavior differs from dup2 in this case, so we need to paper
over that in the C library.

Change-Id: I313cd6f226db5e237f61866f324c5ecdd12bf762
2015-02-23 21:52:56 -08:00
Elliott Hughes
491c09e0d5 am 393bdb15: Merge "Add RLIM_SAVED_CUR and RLIM_SAVED_MAX."
* commit '393bdb156d5024a03f03425a977d0518c84dbb98':
  Add RLIM_SAVED_CUR and RLIM_SAVED_MAX.
2015-02-23 22:45:14 +00:00
Elliott Hughes
6af62e0d50 Add RLIM_SAVED_CUR and RLIM_SAVED_MAX.
Change-Id: Ia6be76460bfcf852832325c5f36cb272f49a4b87
2015-02-23 13:41:40 -08:00
Elliott Hughes
07e218a484 am 3d83b189: Merge "[MIPS64] Fix mips64 build."
* commit '3d83b18970f32467596830845793b18a858f59e6':
  [MIPS64] Fix mips64 build.
2015-02-23 16:09:17 +00:00
Nikola Veljkovic
daf8911079 [MIPS64] Fix mips64 build.
Build was broken by:
https://android-review.googlesource.com/133834

Use <unistd.h> to get syscall().
Remove <asm/unistd.h>, it gets included through <sys/syscall.h>.

Change-Id: Id762f6dea5f9538c19b79cdd46deda978efd50fe
2015-02-23 16:21:31 +01:00
Elliott Hughes
6421f8f5b2 am c39eef71: Merge "valgrind can\'t find syscall because we didn\'t put it in <unistd.h>."
* commit 'c39eef71a7f66b69e2216a51d0e7fbc1796d0696':
  valgrind can't find syscall because we didn't put it in <unistd.h>.
2015-02-20 17:02:25 +00:00
Elliott Hughes
4c5891d93d valgrind can't find syscall because we didn't put it in <unistd.h>.
Change-Id: I1e47291d4476bd2816138a8cf58f29d4986d39e3
2015-02-19 22:49:44 -08:00
Bill Yi
a6395dda54 Merge commit '9d7f68ebfd79b1ce54dc56bceb7346f34615e5a1' into HEAD 2015-02-19 14:30:25 -08:00
Elliott Hughes
3cfb52aab2 Add GNU extensions mempcpy and wmemcpy.
Used by elfutils. On the bright side, they stopped using __mempcpy.

Bug: 18374026
Change-Id: Id29bbe6ef1c5ed5a171bb6c32182f129d8332abb
2015-02-18 22:02:56 -08:00
Dan Albert
3e1b5f46c0 Merge "Parameterize use of clang in libc_ndk." 2015-02-19 02:33:08 +00:00
Dan Albert
2c678e6644 Parameterize use of clang in libc_ndk.
We still have issues with clang coverage in static libraries, so we
need to make sure we follow suit with the rest of libc for now.

Bug: 17574078
Change-Id: I2ab58a84b1caa0d8d08415d240c35adec5b1e150
2015-02-18 17:37:52 -08:00
Elliott Hughes
d3fa31a55d Merge "[MIPS] Fix setjmp signals" 2015-02-19 01:00:19 +00:00
Yabin Cui
4add77b93c Merge "Make gets() deprecated." 2015-02-18 21:33:02 +00:00
Yabin Cui
913fcb274f Make gets() deprecated.
gets is already deprecated in glibc. Others with __warnattr are not deprecated.

Change-Id: I80a276d2b5964630218be47f1c94b146c0d31151
2015-02-18 12:20:32 -08:00
Elliott Hughes
1dbc6bb025 Merge "Implement _FILE_OFFSET_BITS (mostly)." 2015-02-18 18:01:05 +00:00
Neil Fuller
9ec37c7fa9 Merge "Update tzdata to tzdata2015a" 2015-02-18 09:42:33 +00:00
Elliott Hughes
68dc20d411 Implement _FILE_OFFSET_BITS (mostly).
I still don't think we can make stdio's fseeko and ftello work, but we can
have everything else, and very few programs use fseeko/ftello (and they can
just refrain from using _FILE_OFFSET_BITS and be no worse off than they are
today).

Bug: 11865851
Change-Id: Ic3cb409aae6713f4b345de954bcc4241fcd969ec
2015-02-17 19:54:43 -08:00
Dan Albert
a6395e1fd0 Update NDK compatlib for 4.1.2.
The replacement new failures present in newer versions are present
here as well, with the following new issues:

XPASS std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp

This is from the -NaN formatting fix in bionic. We previously had this
wrong, and the upstream test is also wrong. There's currently an XFAIL
for Android in this test because I haven't fixed the upstream test
yet. After that is done, I'll need to teach the test runner how to
XFAIL older Android versions...

FAIL std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp
    dtor.pass.cpp:39: int main(): assertion "globalMemCounter.checkDeleteArrayCalledEq(1)" failed

Haven't investigated this one yet. http://b/19412688

Note that this also needs the libgcc link ordering to be fixed in the
build system, as we'll otherwise depend on libgcc symbols from libc
that may or may not have been there.

The build fix can't be submitted because the proper link order causes
the libgcc unwinder to be used instead of the EHABI one:
http://b/18471342

Bug: 18471532
Change-Id: Icf560485a9b8f5ebbe01e4458703e62ec94df5e1
2015-02-17 17:02:42 -08:00
Dan Albert
9a9ea3a280 Update the NDK compatlib for 4.4.4 and ToT.
Now passes all libc++ tests for these targets, with the exception of
the usual failing replacement new tests since libc uses new/delete for
things. I don't know if we can ever really fix these.

Bug: 18471532
Change-Id: Ibc0a15f26b0e4613249b5e15ecf3cf80e523467c
2015-02-17 17:02:34 -08:00
Yabin Cui
0e61c2c0ea Merge "Revert "Move use of __warnattr to __deprecated."" 2015-02-17 23:56:29 +00:00
Yabin Cui
784de4e50a Revert "Move use of __warnattr to __deprecated."
This reverts commit 4645c4f62d.

Change-Id: I6c1062d54a4e2c4f41ce7a403e4e7840e6339146
2015-02-17 23:54:40 +00:00
Yabin Cui
b5c2379687 Merge "Move use of __warnattr to __deprecated." 2015-02-17 23:10:31 +00:00
Yabin Cui
4645c4f62d Move use of __warnattr to __deprecated.
clang don't support warning attribute. Replacing warning attriubte with
deprecated attribute can achieve the same behavior whether compiled by
gcc or clang.

Bug: 19340053
Change-Id: I064432b81cf55212458edbc749eb72dc15a810fb
2015-02-17 14:14:45 -08:00
Yabin Cui
89dad68efb Merge "Change getgrent error declaration message to proper style." 2015-02-17 21:29:27 +00:00
Yabin Cui
62533de98e Change getgrent error declaration message to proper style.
Bug: 19340053
Change-Id: I9c47a2016f356d171a5f2082acb8391d81e019b2
2015-02-17 11:33:42 -08:00
Elliott Hughes
be6a44566a Fix sysconf for _SC_CHILD_MAX and _SC_OPEN_MAX.
Change-Id: I656f613166bd604f35b31e5ec042a5230c6b82b8
2015-02-17 09:55:58 -08:00
Elliott Hughes
fb48c68221 Merge "Fix memchr overflow." 2015-02-17 17:54:40 +00:00
Elliott Hughes
92b9c6ff3e POSIX says flock is in <sys/file.h>, not <unistd.h>.
Bug: 19392265
Change-Id: I14d0b56883f0354e13db04a1d140b8f60dae08d7
2015-02-17 09:08:24 -08:00
Neil Fuller
094a8ae078 Update tzdata to tzdata2015a
Time Zone Data v. 2015a (Released 2015-01-29)
http://www.iana.org/time-zones/repository/releases/tzdata2015a.tar.gz

Information from NEWS:

Release 2015a - 2015-01-29 22:35:20 -0800

  Changes affecting future time stamps

    The Mexican state of Quintana Roo, represented by America/Cancun,
    will shift from Central Time with DST to Eastern Time without DST
    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)

    Chile will not change clocks in April or thereafter; its new standard time
    will be its old daylight saving time.  This affects America/Santiago,
    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)

    New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
    (Thanks to Tim Parenti.)

  Changes affecting past time stamps

    Iceland observed DST in 1919 and 1921, and its 1939 fallback
    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
    Shanks about time in Iceland between 1837 and 1908.

    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: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
    and Asia/Muscat.

Bug: 19212588
(cherry-picked from commit 700eb048fb)

Change-Id: I23d94982f634889ab9dcef28cf4a8853224bfd9c
2015-02-17 17:05:48 +00:00
Elliott Hughes
41ef902379 Fix memchr overflow.
The overflow's actually in the generic C implementation of memchr.

While I'm here, let's switch our generic memrchr to the OpenBSD version too.

Bug: https://code.google.com/p/android/issues/detail?id=147048
Change-Id: I296ae06a1ee196d2c77c95a22f11ee4d658962da
2015-02-14 13:21:22 -08:00
Yabin Cui
9d7f68ebfd am 4812bdf1: am 4181cc69: Merge "Declare getgrent/setgrent/endgrent as missing."
* commit '4812bdf1b160fb803dd86a393daf2ae725029c2e':
  Declare getgrent/setgrent/endgrent as missing.
2015-02-14 02:46:43 +00:00
Yabin Cui
4181cc691e Merge "Declare getgrent/setgrent/endgrent as missing." 2015-02-14 02:37:19 +00:00
Dmitriy Ivanov
39c9f7bc65 am 88117127: am b81a871c: Merge changes I88827aa0,Ib0b0987a
* commit '88117127defa6aeb26840ec8547486aefd5edd73':
  Fix: DT_DEBUG was acting as DT_REL on mips64
  Add missing SHT_LOOS/SHT_HIOS values
2015-02-14 00:49:33 +00:00
Dmitriy Ivanov
b81a871cbb Merge changes I88827aa0,Ib0b0987a
* changes:
  Fix: DT_DEBUG was acting as DT_REL on mips64
  Add missing SHT_LOOS/SHT_HIOS values
2015-02-14 00:38:04 +00:00
Dmitriy Ivanov
13ed3f0af1 Add missing SHT_LOOS/SHT_HIOS values
Change-Id: Ib0b0987a7e85af7863c6ef894263b5980e32344d
2015-02-13 16:34:38 -08:00
Colin Cross
15c60ccfb1 am d6a9f804: am 150403ca: Merge "Make .note.android.ident section type SH_NOTE"
* commit 'd6a9f804a9c95942bddc9afa243c339d72371008':
  Make .note.android.ident section type SH_NOTE
2015-02-13 20:29:34 +00:00
Yabin Cui
c9d09431b9 Declare getgrent/setgrent/endgrent as missing.
Bug: 19340053
Change-Id: I42bfeda95e6f262e2e74ab47336ea346c2de7e4a
2015-02-13 10:52:35 -08:00
Colin Cross
e09ab2cc2f Make .note.android.ident section type SH_NOTE
The .note.android.ident section is only used by GDB, which doesn't
care what section type the section is, but it would be convenient
for readelf -n to be able to find the section too.

The old way of getting the .note.android.ident section to be of type
SH_NOTE involved compiling from .c to .s using gcc, running sed to
change progbits to note, and then compiling from .s to .o using gcc.
Since crtbrand.c only contains a section containing data, a
crtbrand.S can be checked in that will compile on all platforms,
avoiding the need for sed.

Also add crtbrand.o to crtbegin_so.o so that libraries also get
the note, and to the crt workaround in arm libc.so.

Change-Id: Ica71942a6af4553b56978ceaa288b3f4c15ebfa2
2015-02-12 21:37:20 -08:00
Colin Cross
71721a31d0 am baf16422: am 362d6779: Merge "Remove no-op sed step when compiling crtbrand.o"
* commit 'baf164221b1356fe13091c2ca4b357da9a4e237c':
  Remove no-op sed step when compiling crtbrand.o
2015-02-12 18:26:53 +00:00
Colin Cross
24958ae4ef Remove no-op sed step when compiling crtbrand.o
crtbrand.c was compiled to a .s file, run through a sed script
to translate a %progbits to %note, and the compiled to .o.
However, when the sed command was copied from the original source
it was not updated to use the new name of the section (.note.ABI-tag
to .note.android.ident), so it didn't modify the file.  Since the
section has been generated with type %progbits instead of %note for
two years, just delete the whole sed step.

Change-Id: Id78582e9b43b628afec4eed22a088283132f0742
2015-02-11 17:40:45 -08:00
Duane Sand
b6d301f42d [MIPS] Fix setjmp signals
Include full 16-byte Mips sigset_t signal mask within jump buffer.
Call sigprocmask instead of sigblockmask/sigsetmask to get/set full signal mask.
Include sigsetjmp's savesigs arg inside jmp_buf, instead of following it.
Reserve room for future extensions.
Preserve historically-large mips32 _JBLEN size.
Eliminate redundancy: code setjmp and _setjmp as tail calls into sigsetjmp,
and make longjmp and _longjmp aliases of siglongjmp.

Change-Id: Ie79137cf059228c1a51344ebb20d3a9a40b4a252
2015-02-11 15:15:53 -08:00