Commit graph

8410 commits

Author SHA1 Message Date
Dmitriy Ivanov
66bbf1595c Merge "Refactoring: C++11 style DISABLE_ bionic marcos" 2014-09-12 16:50:05 +00:00
Elliott Hughes
8d8a789c49 Merge "Expose __swsetup for LP32 binary compatibility." 2014-09-12 01:27:45 +00:00
Elliott Hughes
5f35710fad Expose __swsetup for LP32 binary compatibility.
(cherry-pick of 7e00b44e80d6e38b8ab86d0ebc86b666c0ac2ef6.)

Bug: 17476127
Change-Id: I0ef1355ac913d782c268a638f88642d6cfc236c2
2014-09-11 18:23:46 -07:00
Dmitriy Ivanov
6487f0d834 Merge "Add IFUNC support for arm64 and IRELATIVE reloc" 2014-09-12 00:40:12 +00:00
Dmitriy Ivanov
9aea164457 Add IFUNC support for arm64 and IRELATIVE reloc
There are number of changes in the way IFUNC related relocations are done:
 1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
 2. IFUNC relocations are now relying on static linker to generate
    them in correct order - this removes necessety of additional
    relocation pass for ifuncs.
 3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
 4. Ifunc are resolved on symbol lookup this approach allowed to avoid
    mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284
Change-Id: I414dd3e82bd47cc03442c5dfc7c279949aec51ed
2014-09-11 16:30:45 -07:00
Elliott Hughes
5920a9ad5f Merge "Add pthread_gettid_np and re-expose __get_thread for LP32." 2014-09-11 23:25:46 +00:00
Elliott Hughes
a4831cb4a3 Add pthread_gettid_np and re-expose __get_thread for LP32.
A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.

(cherry-pick of 27efc48814b8153c55cbcd0af5d9add824816e69.)

Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
2014-09-11 16:22:50 -07:00
Elliott Hughes
ea66004c4a Merge "Fix mips __fadvise64.S build failure." 2014-09-11 17:12:49 +00:00
Elliott Hughes
9990b3973b Fix mips __fadvise64.S build failure.
Bug: 12449798
Change-Id: I0663b741108ba2f1d286904d6414b3ff4d475551
2014-09-11 10:10:08 -07:00
Elliott Hughes
33df10f284 Merge "Add posix_fadvise(3)." 2014-09-11 15:46:44 +00:00
Elliott Hughes
b587f339db Add posix_fadvise(3).
(cherry-pick of 00008263782e484020420c606f7d145fe7d0a4d8.)

Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
2014-09-11 08:45:46 -07:00
Lorenzo Colitti
c71483c0b3 Merge "When comparing DNS server configs, also compare number of servers" 2014-09-09 10:22:18 +00:00
Lorenzo Colitti
bce18c9163 When comparing DNS server configs, also compare number of servers
Bug: 16070602
Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
2014-09-09 19:20:26 +09:00
Dmitriy Ivanov
d9ff722661 Refactoring: C++11 style DISABLE_ bionic marcos
Enable the -std=gnu++11 flag for libstdc++ static and
  dynamic libs.

  ScopeGuard uses DISABLE_ macros instead of '= delete';

Change-Id: I07e21b306f95fffd49345f7fa136cfdac61e0225
2014-09-08 17:51:31 -07:00
Dmitriy Ivanov
3c3624f3df Merge "Load libraries in breadth-first order" 2014-09-09 00:49:38 +00:00
Elliott Hughes
671f96cd44 Merge "Ensure __set_errno is still visible on LP32." 2014-09-08 23:47:53 +00:00
Elliott Hughes
011e111d29 Ensure __set_errno is still visible on LP32.
The use of the .hidden directive to avoid going via the PLT for
__set_errno had the side-effect of actually making __set_errno
hidden (which is odd because assembler directives don't usually
affect symbols defined in a different file --- you can't even
create a weak reference to a symbol that's defined in a different
file).

This change switches the system call stubs over to a new always-hidden
__set_errno_internal and has a visible __set_errno on LP32 just for
binary compatibility with old NDK apps.

(cherry-pick of 7efad83d430f4d824f2aaa75edea5106f6ff8aae.)

Bug: 17423135
Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
2014-09-08 16:46:50 -07:00
Elliott Hughes
201f36d23b Merge "Don't expose non-standard basename_r and dirname_r in LP64." 2014-09-08 23:46:04 +00:00
Elliott Hughes
cf5fc80c3e Don't expose non-standard basename_r and dirname_r in LP64.
(cherry-pick of f0e9458ea596227720fa745df15f5357f6c0c8f6.)

Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
2014-09-08 16:44:48 -07:00
Dmitriy Ivanov
14669a939d 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: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
2014-09-08 13:02:50 -07:00
Elliott Hughes
d3d89f0d28 Merge "Add arc4random_addrandom binary compatibility." 2014-09-08 17:53:04 +00:00
Elliott Hughes
fc829736e1 Add arc4random_addrandom binary compatibility.
This was in <stdlib.h> in older releases. It's no longer used, but we can
preserve backwards compatibility by making it a no-op.

(cherry-pick of 51c8355d5cf4b83ccd2ad250ca4c61a616356c2b.)

Bug: 16205834
Change-Id: Idde7b46df4f253e39675600bcf82352879a716e7
2014-09-08 10:52:28 -07:00
Christopher Ferris
b4673c4102 Merge "Add dlmalloc_usable_size for 32 bit arches." 2014-09-06 20:17:02 +00:00
Christopher Ferris
f903558446 Add dlmalloc_usable_size for 32 bit arches.
Bug: 17337831

(cherry picked from commit 1c365cb494)

Change-Id: Ice100e42eeac4b9c3b77737a546ec33174adcb2f
2014-09-06 13:06:57 -07:00
Ying Wang
e07b4da53d Merge "Use LOCAL_POST_LINK_CMD to insert the objcopy command for linker." 2014-09-05 23:41:25 +00:00
Dmitriy Ivanov
320a01d516 Merge "Revert "Load libraries in breadth-first order"" 2014-09-05 23:36:22 +00:00
Dmitriy Ivanov
498eb18b82 Revert "Load libraries in breadth-first order"
This reverts commit a3ad450a2e.

Change-Id: Ia2b838ad2159c643b80c514849582f4b4f4f40e5
2014-09-05 16:27:54 -07:00
Ying Wang
f9e147b0bf Use LOCAL_POST_LINK_CMD to insert the objcopy command for linker.
Previously we duplicated code in build/core/executable.mk and it's hard
to maintain. LOCAL_POST_LINK_CMD is a clean solution for this.

Bug: 17403674
Change-Id: I8c054bf782af68cf1f88b8d787a78ca74a7968b5
2014-09-05 16:16:35 -07:00
Dmitriy Ivanov
b3ebfecdae Merge "Fix order of soinfo links (repairs libcxx tests)." 2014-09-05 23:11:19 +00:00
Dmitriy Ivanov
b2a30ee8d2 Fix order of soinfo links (repairs libcxx tests).
Change-Id: Iee9de09657351cd6a7512784ca797e4b84cdd98b
2014-09-05 16:01:47 -07:00
Chih-Hung Hsieh
8adace5f2c Merge "Enable clang compilation with libc but not linker." 2014-09-05 18:54:48 +00:00
Chih-Hung Hsieh
b58db8b083 Enable clang compilation with libc but not linker.
Clang is still disabled for x86 and x86_64 long double code,
for x86_64 special assembly instruction, and the linker module.

BUG: 17163651
BUG: 17302991
BUG: 17403674
Change-Id: I43c5f5f0ddc0c2a31918f00b57150dadd8f3f26b
2014-09-05 11:18:35 -07:00
Dmitriy Ivanov
001815ed19 Merge "Reset enviroment for math_tests" 2014-09-05 01:56:44 +00:00
Dmitriy Ivanov
7b956ede3f Reset enviroment for math_tests
Bug: 17390824
Change-Id: I42f4c8d9199a2efe7641f0b0e64580cacb5695da
2014-09-04 18:38:21 -07:00
Elliott Hughes
aca9cae309 Merge "Fix pthread_attr_getstack__main_thread." 2014-09-04 23:20:53 +00:00
Elliott Hughes
27a9aed819 Fix pthread_attr_getstack__main_thread.
There were two problems here:

* This would fail when run with unlimited stack, because it didn't know
  that bionic reports unlimited stacks as 8MiB.

* This would leave RLIMIT_STACK small, causing failures to exec (so the
  popen and system tests would fail).

Change-Id: I5b92dc64ca089400223b2d9a3743e9b9d57c1bc2
2014-09-04 16:09:25 -07:00
Elliott Hughes
c74a7680a4 Merge "Fix mips signed/unsigned signal_test.cpp build breakage." 2014-09-04 22:48:16 +00:00
Elliott Hughes
aa13e839f0 Fix mips signed/unsigned signal_test.cpp build breakage.
Change-Id: I045ce017c0c51e1843193759a2eb6fc5b93e3867
2014-09-04 15:43:10 -07:00
Dmitriy Ivanov
44352f5f7f Merge "Revert "Register __libc_fini as early as possible."" 2014-09-04 21:55:59 +00:00
Dmitriy Ivanov
c0cd9ce5df Merge "Revert "Fix arm64 build"" 2014-09-04 21:55:55 +00:00
Dmitriy Ivanov
4b41555ba5 Revert "Register __libc_fini as early as possible."
This reverts commit e880c736d6.

Change-Id: Ide83e442eb5dbfef5298a15bc602c3fe1dda1862
2014-09-04 21:54:34 +00:00
Dmitriy Ivanov
f0d8970435 Revert "Fix arm64 build"
This reverts commit 5c1a7fdbd5.

Change-Id: Ia5fea0d6a8f59700edce0742e2271b5f02a5d87c
2014-09-04 21:53:14 +00:00
Elliott Hughes
05f0bfd6c5 Merge "Don't mask out SA_RESTORER from sa_flags." 2014-09-04 21:03:34 +00:00
Elliott Hughes
afe58ad989 Don't mask out SA_RESTORER from sa_flags.
glibc doesn't do this, and we probably shouldn't either.

Bug: 16703540
Change-Id: Id5b93c3782e34024a9916463348e8f3caff191bf
2014-09-04 13:54:42 -07:00
Chih-Hung Hsieh
4ee7c325df Merge "Disable Clang, due to x86 LDBL_MANT_DIG errors." 2014-09-04 20:44:34 +00:00
Chih-Hung Hsieh
356a6249d8 Disable Clang, due to x86 LDBL_MANT_DIG errors.
Clang -m32 has incorrect sizeof(long double) = 12.
With -m64, LDBL_MANT_DIG is incorrect 64.

BUG: 17163651
Change-Id: I4b157aa1a8572c3a10aece6070e119a292ab8e83
2014-09-04 12:35:19 -07:00
Elliott Hughes
071bed8091 Merge "_GNU_SOURCE implies _BSD_SOURCE and the latest _POSIX_C_SOURCE." 2014-09-04 17:02:10 +00:00
Elliott Hughes
fc8974b7aa _GNU_SOURCE implies _BSD_SOURCE and the latest _POSIX_C_SOURCE.
This showed up as open_memstream not being visible in <stdio.h>
if only _GNU_SOURCE was defined.

Bug: 17361504
Change-Id: I38f9843f4e6ee770a6325ad50f779bda5495ffca
2014-09-04 08:53:16 -07:00
Dmitriy Ivanov
1737b15937 Merge "Load libraries in breadth-first order" 2014-09-04 00:59:23 +00:00
Dmitriy Ivanov
8f3b8f523e Merge "Fix arm64 build" 2014-09-03 23:36:35 +00:00