Commit graph

5283 commits

Author SHA1 Message Date
Elliott Hughes
c3f114037d <pthread.h> fixes and pthread cleanup.
<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7
2013-10-31 12:31:16 -07:00
Elliott Hughes
d0d0b52da3 Merge "Remove an obsolete ARM gdb hack." 2013-10-30 21:37:56 +00:00
Elliott Hughes
b5b97f20a8 Remove an obsolete ARM gdb hack.
Experiment shows that the claim in the makefile was false: gdb works fine
setting breakpoints in these functions when compiled without special treatment.

Change-Id: Ibdf4dd5a14d171c954b8c2089daaf28e1c310be9
2013-10-30 14:32:42 -07:00
Elliott Hughes
47a73363fc Merge "Factor out some of the makefile cruft." 2013-10-30 02:13:34 +00:00
Elliott Hughes
2f287bc728 Factor out some of the makefile cruft.
I really don't want to add yet another copy for aarch64.

Also sort arm, mips, and x86.

Also silence the "TARGET_ARCH_VARIANT" warning for non-ARM; Intel and MIPS
have both complained about it.

Change-Id: I32c592a90c0cf0cdae250d84035b3e4655543781
2013-10-29 16:59:54 -07:00
Elliott Hughes
7a8e20c9c7 Merge "Explain the sigprocmask in pthread_exit." 2013-10-29 23:29:07 +00:00
Elliott Hughes
2b6e43e00e Explain the sigprocmask in pthread_exit.
Also remove the SIGSEGV special case, which was probably because
hand-written __exit_with_stack_teardown stubs used to try to cause
SIGSEGV if the exit system call returned (which it never does, so
that dead code disappeared).

Also move the sigprocmask into the only case where it's necessary ---
the one where we unmap the stack that would be used by a signal
handler.

Change-Id: Ie40d20c1ae2f5e7125131b6b492cba7a2c6d08e9
2013-10-29 16:11:06 -07:00
Christopher Ferris
f084f7dc1e Merge "Fix up failing glibc tests." 2013-10-29 22:32:33 +00:00
Christopher Ferris
13613137bc Fix up failing glibc tests.
There is a known bug running clone with the CLONE_VM flag, so for host
create an empty test.

Change the expected output of the stdio test for a glibc difference.

Change the pause test to use ScopedSignalHandler to setup/restore the SIGALRM
handler.

After this, running bionic-unit-tests-glibc passes for all tests.

Bug: 11389824

Change-Id: Ib304eae4164115835a54991dfdca5821ecc3db5e
2013-10-29 14:55:11 -07:00
Elliott Hughes
8e6e7cdadb Merge "Update <sys/exec_elf.h> to include EM_AARCH64." 2013-10-29 15:50:33 +00:00
Elliott Hughes
126405039e Update <sys/exec_elf.h> to include EM_AARCH64.
Upstream added the constant for us.

Change-Id: I197e32d2e5b3fd499d069546ccfcc1d35d65e0a0
2013-10-28 21:28:40 -07:00
Elliott Hughes
6e504fdaff Merge "AArch64: Add support for AArch64 to stdlib/strtod.c" 2013-10-28 23:25:27 +00:00
Serban Constantinescu
65ca282ecd AArch64: Add support for AArch64 to stdlib/strtod.c
This patch adds support for AArch64 to strtod.c definitions.

Change-Id: I9491c4371d921c00e73ae169877a9a71225731fb
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:24:51 -07:00
Elliott Hughes
830de5cb30 Merge "AArch64: Autogenerated syscalls for AArch64" 2013-10-28 23:19:46 +00:00
Serban Constantinescu
7f8863dc07 AArch64: Autogenerated syscalls for AArch64
This patch adds AArch64 syscalls, autogenerated using:
        ./libc/tools/gensyscalls.py

Change-Id: I1cc60430423ecb52a35448bf2c358b82136b2f16
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:18:42 -07:00
Elliott Hughes
93b7b81912 Merge "AArch64: Add support for AArch64 to the syscall interface" 2013-10-28 23:17:23 +00:00
Serban Constantinescu
feaa89a1bc AArch64: Add support for AArch64 to the syscall interface
This patch adds support for AArch64 to the syscall interface. The kernel
implementation exports a set of canonical syscalls, therefore some of
the userspace exported syscalls are implemented as stubs based on the
canonical set.

Change-Id: Ia965d71e97769b8be9d7655193fc40303964c4df
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
2013-10-28 16:16:34 -07:00
Elliott Hughes
07d3c6cecc Merge "Fix the *rand48 functions on LP64." 2013-10-28 23:09:49 +00:00
Elliott Hughes
60fd3450bf Fix the *rand48 functions on LP64.
I reported the mrand48 bug upstream, and 'matt' fixed the whole family
of functions!

Change-Id: I07fbc034e86499ce89599c3026a741738fd0cfc0
2013-10-28 15:24:26 -07:00
Elliott Hughes
020bcdaef3 Merge "Update <sys/exec_elf.h> to get the DF_* flags." 2013-10-28 22:03:55 +00:00
Elliott Hughes
74ce45972d Update <sys/exec_elf.h> to get the DF_* flags.
Change-Id: Ia9e785f6b95122f94ee3b01a312db1d5bb91a72e
2013-10-28 14:59:41 -07:00
Elliott Hughes
486d99f050 Merge "Don't allow text relocations on 64-bit." 2013-10-28 21:36:23 +00:00
Elliott Hughes
e4d792adb8 Don't allow text relocations on 64-bit.
I've also updated our <sys/exec_elf.h> to match upstream.

Change-Id: I52f9fce3167541811208d273ff23ceaa112f7135
2013-10-28 14:34:56 -07:00
Elliott Hughes
3ec5d8954b Merge "Fix utime/utimes when passed a NULL pointer." 2013-10-28 20:29:24 +00:00
Elliott Hughes
27586ebe1a Fix utime/utimes when passed a NULL pointer.
Bug: 11383777
Change-Id: If944a42f3adfa8a6ce91c167c249e009ed63300a
2013-10-28 13:21:06 -07:00
Elliott Hughes
d4e9f076d6 Merge "Clean up linker architecture macros." 2013-10-28 18:04:22 +00:00
Elliott Hughes
4eeb1f12a8 Clean up linker architecture macros.
We don't need our own architecture macros; the standard ones will do.

This patch also fixes some __x86_64__ tests to be USE_RELA tests instead,
because they're not actually x86_64-specific.

I've cleaned up architecture-specific code slightly so where possible
all the code corresponding to a particular architecture is together.

This patch also fixes a bug in LP64 DT_PLTGOT handling, which should be
an error rather than falling through into DT_DEBUG! There was another #ifdef
bug where we'd only report unexpected DT_ entries on MIPS.

Change-Id: Id1d04e372611f641c1aa278a18e379f28af9eaf5
2013-10-28 11:02:49 -07:00
Elliott Hughes
f7f6b2686d Merge "Upgrade to tzdata2013h." 2013-10-28 17:00:16 +00:00
Elliott Hughes
3df3879bd6 Upgrade to tzdata2013h.
From the release notes:

  Changes affecting current and future time stamps:

    Libya has switched its time zone back to UTC+2 without DST,
    instead of UTC+1 with DST.  (Thanks to Even Scharning.)

    Western Sahara (Africa/El_Aaiun) uses Morocco's DST rules.
    (Thanks to Gwillim Law.)

  Changes affecting future time stamps:

    Acre and (we guess) western Amazonas will switch from UTC-4 to UTC-5
    on 2013-11-10.  This affects America/Rio_Branco and America/Eirunepe.
    (Thanks to Steffen Thorsen.)

    Add entries for DST transitions in Morocco in the year 2038.
    This avoids some year-2038 glitches introduced in 2013g.
    (Thanks to Yoshito Umaoka for reporting the problem.)

Change-Id: Ic855df19773e3fbf13b941b5bfa91dcee9e181e1
2013-10-28 09:38:00 -07:00
Christopher Ferris
93fcfeee2b Merge "Update running bionic unit tests on host." 2013-10-25 17:37:02 +00:00
Christopher Ferris
b38e4d536f Update running bionic unit tests on host.
Add a bionic-unit-tests-glibc-run target to run the glibc bionic unit tests.

Modify the bionic-unit-tests-run-on-host to make sure that the /system/bin
directory is created properly.

Also remove the EXTERNAL_STORAGE variable which isn't used any more.

Bug: 11234772
Change-Id: I9aea501d05700b29e938f672474d550b1872a78b
2013-10-25 10:23:12 -07:00
Elliott Hughes
ad8fb26aff Merge "Fix the exit syscall stub's name." 2013-10-25 16:25:22 +00:00
Elliott Hughes
421e911a0b Merge "Simplify defining the linker architecture macro." 2013-10-25 16:01:20 +00:00
Elliott Hughes
60d5b06ece Simplify defining the linker architecture macro.
Like the new TODO says, though, do we need this at all? Wouldn't we be better
off just using the regular architecture-specific macros? This is a dynamic
linker, so there's never a possibility of cross-linking.

Change-Id: I7be6b8663f5e585c4024a49aae383430c86a3c1b
2013-10-24 23:18:13 -07:00
Elliott Hughes
6b53c2349a Fix the exit syscall stub's name.
I've left the exit_group syscall as _exit because otherwise we'd have to
convince the compiler that our _exit (which just calls __exit_group) is
actually "noreturn", and it seems like that would be less clean than just
cutting out the middleman.

We'll just have to trust ourselves not to add anything to SYSCALLS.TXT
that ought to be private but that only has a single leading underscore.
Hopefully we can manage that.

Change-Id: Iac47faea9f516186e1774381846c54cafabc4354
2013-10-24 22:41:50 -07:00
Elliott Hughes
bbefbf1a75 Merge "Use hidden visibility for generated stubs whose names begin with underscores." 2013-10-25 00:20:24 +00:00
Elliott Hughes
d60a625dd5 Merge "Start moving 32-bit cruft somewhere it won't pollute 64-bit." 2013-10-25 00:18:15 +00:00
Elliott Hughes
567a8de3ca Start moving 32-bit cruft somewhere it won't pollute 64-bit.
Change-Id: I03a6a50a5243f29e50fb58a3cf8b5e7198640baa
2013-10-24 17:14:55 -07:00
Elliott Hughes
fff6e272e9 Use hidden visibility for generated stubs whose names begin with underscores.
Change-Id: Idb39fd04b7a14114801624e744e76e0e7913d951
2013-10-24 17:03:20 -07:00
Elliott Hughes
9728854992 Merge "Let the compiler worry about implementing ffs(3)." 2013-10-24 23:35:51 +00:00
Elliott Hughes
bf425680e4 Let the compiler worry about implementing ffs(3).
It does at least as good a job as our old hand-written assembly anyway.

Change-Id: If7c4a1ac508bace0b71ee7b67808caa6eabf11d2
2013-10-24 16:29:40 -07:00
Elliott Hughes
a1b9f0d443 Merge "Revert "Don't warn about x86 text relocations. They're too prevalent."" 2013-10-24 23:05:24 +00:00
Elliott Hughes
b8b0b6b412 Revert "Don't warn about x86 text relocations. They're too prevalent."
This reverts commit 5be2c5998c.

Change-Id: I3fc8ca530cdbd74c834fb9cfabe812c9386419fc
2013-10-24 22:58:28 +00:00
Elliott Hughes
f8dfb6f249 Merge "Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls." 2013-10-24 22:49:49 +00:00
Elliott Hughes
11952073af Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls.
(aarch64 kernels don't have these system calls.)

Change-Id: I6f64075aa412f71520f2df71c3d69b647f91c1ca
2013-10-24 15:48:32 -07:00
Ben Cheng
fcb37b876e Merge "Add __EXPORTED_HEADERS__ as predefined macro." 2013-10-23 22:47:21 +00:00
Ben Cheng
460fa7033b Add __EXPORTED_HEADERS__ as predefined macro.
To weed out stuff like this in uapi/linux/types.h

ifndef __EXPORTED_HEADERS__
warning "Attempt to use kernel headers from user space, see
http://kernelnewbies.org/KernelHeaders"
endif /* __EXPORTED_HEADERS__ */

Change-Id: I6506cea6248f7a3b44a839b98e91bdd0d3a6c4cd
2013-10-23 14:44:38 -07:00
Elliott Hughes
9098344afe Merge "Don't warn about x86 text relocations. They're too prevalent." 2013-10-23 20:58:38 +00:00
Elliott Hughes
5be2c5998c Don't warn about x86 text relocations. They're too prevalent.
We should fix this (and disallow it for x86_64), but for now let's get CTS
running again.

libdvm.so and libcutils.so are the main problems.

$ scanelf -qT out/target/product/generic_x86/symbols/system/lib/libcutils.so
  libcutils.so: (memory/data?) [0x4125] in (optimized out: previous android_memset16) [0x4100]
  libcutils.so: (memory/data?) [0x424F] in (optimized out: previous android_memset16) [0x4100]
  libcutils.so: (memory/data?) [0x42F8] in (optimized out: previous android_memset16) [0x4100]
  libcutils.so: (memory/data?) [0x4349] in (optimized out: previous android_memset16) [0x4100]
  libcutils.so: (memory/data?) [0x4406] in (optimized out: previous android_memset16) [0x4100]
  libcutils.so: (memory/data?) [0x45AC] in (optimized out: previous android_memset32) [0x4590]
  libcutils.so: (memory/data?) [0x4650] in (optimized out: previous android_memset32) [0x4590]
  libcutils.so: (memory/data?) [0x46F9] in (optimized out: previous android_memset32) [0x4590]
  libcutils.so: (memory/data?) [0x474A] in (optimized out: previous android_memset32) [0x4590]
  libcutils.so: (memory/data?) [0x4807] in (optimized out: previous android_memset32) [0x4590]

Bug: 11353056
Change-Id: Id4a76b310be7fe858a8a60d0d260b09913b66be9
2013-10-23 13:45:01 -07:00
Elliott Hughes
cdac5f73ac Merge "MIPS' pipe(2) is weird, but MIPS' pipe2(2) is the same as everyone else's." 2013-10-23 18:27:35 +00:00