Commit graph

27468 commits

Author SHA1 Message Date
Elliott Hughes
ae471db4a9 Merge "Make android_get_application_target_sdk_version available to the NDK." 2018-11-15 23:04:41 +00:00
Elliott Hughes
c0f4656452 Make android_get_application_target_sdk_version available to the NDK.
Also move this and android_get_device_api_level into <android/api-level.h>
so that they're always available.

This involves cleaning up <sys/cdefs.h> slightly.

Bug: N/A
Test: builds
Change-Id: I25435c55f3549cd0d827a7581bee75ea8228028b
2018-11-15 11:07:30 -08:00
Treehugger Robot
cfd628009c Merge "switch to using android-base/file.h instead of android-base/test_utils.h" 2018-11-15 15:58:45 +00:00
Mark Salyzyn
ba1a723ad1 switch to using android-base/file.h instead of android-base/test_utils.h
Test: compile
Bug: 119313545
Change-Id: I664fb32522d01909c603d7b903475c4e9aea9223
2018-11-14 15:46:49 -08:00
Treehugger Robot
f1e657cdff Merge "linker unit tests requires liblog" 2018-11-14 23:21:09 +00:00
Mark Salyzyn
33c3a066ae linker unit tests requires liblog
Test: compile
Bug: 119313545
Change-Id: Ic6263c7db55d27ccb5075478aedae30c58ad0044
2018-11-14 13:05:27 -08:00
Elliott Hughes
8359068064 Merge "Move API levels from uint32_t to int." 2018-11-14 19:50:59 +00:00
Treehugger Robot
48630a9191 Merge "bionic tests: switch to using android-base/file.h for TemporaryFile" 2018-11-14 15:20:47 +00:00
Elliott Hughes
ff1428a48e Move API levels from uint32_t to int.
(cherrypick of a6c71a09670ca636cca5cfea9d74b03a951e2b5e.)

Bug: N/A
Test: builds
Change-Id: I9c414e30e3c4fe2a4e16a2fe4ce18eae85fe4844
2018-11-13 21:25:07 -08:00
Haibo Huang
378600fe95 Merge changes I5fb5745f,Ib0c0de37
* changes:
  Change memcpy ifunc to return memmove for x86
  Use ifunc to dynamically dispatch libc routines for x86
2018-11-14 04:36:02 +00:00
Haibo Huang
e141362aa1 Change memcpy ifunc to return memmove for x86
It is cleaner to do this with ifunc. This is a partial revert of:
https://android-review.googlesource.com/c/platform/bionic/+/693863

Test: run bionic unit test
Change-Id: I5fb5745fc98807805aedb94b683e959e2a76a25d
2018-11-13 14:23:19 -08:00
Haibo Huang
b9244ff551 Use ifunc to dynamically dispatch libc routines for x86
Test: run bionic unit test in aosp_cf_x86_phone emulator
Change-Id: Ib0c0de37cd38d24bfce2dfbe35b8fd8edff004af
2018-11-13 13:48:23 -08:00
Christopher Ferris
17c4bd9e59 Merge "Move to jemalloc5." 2018-11-13 20:48:07 +00:00
Mark Salyzyn
68a3bcc249 bionic tests: switch to using android-base/file.h for TemporaryFile
A matching definition of TemporaryFile exists in libbase now.

Test: compile
Bug: 119313545
Change-Id: I6f84dbf3af9a9c4b270a2532a36c9cb4c0f6bb8f
2018-11-13 10:57:28 -08:00
Peter Collingbourne
c2d3e67a77 Merge "bionic: Allocate a shadow call stack for each thread." 2018-11-13 18:56:58 +00:00
Christopher Ferris
d73a49e91e Move to jemalloc5.
Bug: 62621531

Test: Builds and boots. All unit tests pass.
Change-Id: I09d106cc3b658885b9155d6838f8df61498d3f85
2018-11-13 10:32:33 -08:00
Peter Collingbourne
da772e2113 bionic: Allocate a shadow call stack for each thread.
Instead of allocating the stack within a 16MB guard region as we
were doing before, just allocate the stack on its own. This isn't
as secure as with the guard region (since it means that an attacker
who can read the pthread_internal_t can determine the address of the
SCS), but it will at least allow us to discover more blockers until
a solution to b/118642754 is decided on.

Bug: 112907825
Bug: 118642754
Change-Id: Ibe5dffbad1b4700eaa0e24177eea792e7c329a61
2018-11-12 20:04:40 -08:00
Peter Collingbourne
b87e85aac3 Merge "bionic: Add shadow call stack guard region field to pthread_internal_t." 2018-11-12 22:50:24 +00:00
Peter Collingbourne
5d427bcb08 bionic: Add shadow call stack guard region field to pthread_internal_t.
Landing this change separately to the change that implements SCS
because it needs to land at the same time as an internal change. This
will simplify the situation in case SCS needs to be reverted again.

Change-Id: Ibe18750829665b6dcf6e36628a5e5bbdd1a0dd4f
Merged-In: Ibe18750829665b6dcf6e36628a5e5bbdd1a0dd4f
2018-11-12 13:42:28 -08:00
Treehugger Robot
e9bd18ac0c Merge "Separate libc_common to two targets" 2018-11-12 21:31:11 +00:00
Ryan Prichard
f521c19e13 Merge "Publish the current draft of my ELF TLS doc" 2018-11-12 20:48:37 +00:00
Haibo Huang
f71edfad1c Separate libc_common to two targets
Adds libc_common_static and libc_common_shared targets. So that static
and shared objects can use different libraries.

In following changes I'll add dynamic dispatch code to
libc_common_shared.

Test: compile and run bionic unit test.
Change-Id: I056742fdf8af76ed7deb274c515951656b176fcb
2018-11-12 10:10:31 -08:00
Treehugger Robot
40538268d4 Merge "Add lp32 and lp64 shorthands to SYSCALLS.TXT." 2018-11-10 00:09:21 +00:00
Ryan Prichard
9491c54619 Publish the current draft of my ELF TLS doc
I have a script that converts the internal Google Doc to this markdown
file.

Bug: http://b/78026329
Test: review document
Change-Id: I16cfa60f1e480f859eb79cb0e5f0c519f5622cfd
2018-11-09 15:24:16 -08:00
Elliott Hughes
8251d4419f Add lp32 and lp64 shorthands to SYSCALLS.TXT.
Bug: N/A
Test: updating the generated stubs is a no-op
Change-Id: I7f6f9bcfd8c054f0a2d7e5f488eacb88cefb8d15
2018-11-09 13:57:34 -08:00
Florian Mayer
0dbe6d1aec System property for heapprofd at process startup.
Test: m
Test: flash sailfish
Test: setprop heapprofd.enable 1;
      setprop heapprofd.enable.ls 1;
      ls;

Bug: 117821125

Change-Id: I4a42e430e5e1e194a22f83683061751aa5dfe7ff
2018-11-09 12:00:24 +00:00
Ken Chen
b9de32f6f0 Merge "Free memory when it is no more used" 2018-11-09 03:28:44 +00:00
Tom Cherry
66bc428f93 linker: changes to init work arounds
Change three things regarding the work around to the fact that init is
special:

1) Only first stage init is special, so we change the check to include
   accessing /proc/self/exe, which if is available, means that we're
   not first stage init and do not need any work arounds.
2) Fix the fact that /init may be a symlink and may need readlink()
3) Suppress errors from realpath_fd() since these are expected to fail
   due to /proc not being mounted.

Bug: 80395578
Test: sailfish boots without the audit generated from calling stat()
      on /init and without the errors from realpath_fd()

Change-Id: I266f1486b142cb9a41ec791eba74122bdf38cf12
2018-11-08 21:50:19 +00:00
Ken Chen
f945716bf9 Free memory when it is no more used
Memory leak happen when Android data framework updates identical DNS
information to netd.

(cherrypick of c466fe95dc641d879683700aea4233ffd42bc762.)

Bug: 115595601
Test: netd_unit_test, netd_integration_test
Change-Id: Idcc0956729286563603f482258f488a1ccd75e6a
2018-11-08 13:29:13 -08:00
Josh Gao
8fd93e6ea5 Merge "Increase the size of the signal stack on 64-bit." 2018-11-08 21:24:51 +00:00
Josh Gao
f90687c4ec Increase the size of the signal stack on 64-bit.
The signal stack is sufficiently large for a single invocation of the
signal handler, but in cases where the signal handler needs to recurse,
(e.g. if our address space is limited by RLIMIT_AS), it's too small for
us to get to the part where we recognize that we've recursed and bail
out.

Bug: http://b/118772392
Test: /data/nativetest64/debuggerd_test/debuggerd_test64 --gtest_filter=CrasherTest.seccomp_crash_oom
Change-Id: Ic7a2cf8b01b3f7ea7f4a2318a3ec22a0c3649da6
2018-11-08 21:24:31 +00:00
Elliott Hughes
bf925b0580 Merge "Remove obsolete workaround." 2018-11-08 20:09:49 +00:00
Yi Kong
d495e0b777 Merge "Don't build bionic-unit-tests-static with libcrt_builtins" 2018-11-08 18:23:56 +00:00
Neil Fuller
10265a8cbe Merge "Finalize the name of the apex package" 2018-11-08 08:18:59 +00:00
Yi Kong
b011d59a7f Don't build bionic-unit-tests-static with libcrt_builtins
libcrt_builtins does not work with libm, which is statically linked in
bionic-unit-tests-static. Opt it out of libcrt_builtins for now.

Bug: 119207651
Bug: 117167374
Test: run bionic-unit-test-static
Change-Id: I20067c9841beb9de2b73342847aaa945dbadbff8
2018-11-08 05:33:15 +00:00
Chih-hung Hsieh
b3fe0136d8 Merge "Revert "Disable lld, libc_malloc_debug failed to boot."" 2018-11-08 04:59:14 +00:00
Chih-hung Hsieh
bbd465a230 Merge "Revert "Disable lld, failed to link bionic/linker."" 2018-11-08 04:58:14 +00:00
Elliott Hughes
52d7749335 Merge "ART isn't using the ART-specific linker features any more." 2018-11-08 03:09:53 +00:00
Christopher Ferris
6689b4f258 Merge "Add a force fail for non-bionic xfail test." 2018-11-08 03:01:34 +00:00
Christopher Ferris
aced2b25e6 Merge "Add smoke tests for mallopt options." 2018-11-08 03:01:13 +00:00
Christopher Ferris
af1b8ddaa9 Add smoke tests for mallopt options.
Test: Unit tests pass.
Change-Id: If213f4338078011ff12996c1b2a6f6858b51d824
2018-11-07 17:11:42 -08:00
Chih-hung Hsieh
56794421fc Revert "Disable lld, libc_malloc_debug failed to boot."
This reverts commit 0e87940961.

Reason for revert: This should have been fixed.
Bug: 78118944

Change-Id: I796ff2420ec3682dd54a059175a8428868b75c23
2018-11-07 23:49:37 +00:00
Christopher Ferris
e691069366 Merge "Fix test failures." 2018-11-07 22:48:44 +00:00
Christopher Ferris
01db9bde05 Add a force fail for non-bionic xfail test.
Test: xfail test passes on host.
Change-Id: I6c4ddd3f3dc5541b126d9dd31b1fcff9d34819e6
2018-11-07 14:39:43 -08:00
Christopher Ferris
9ac0cd5f85 Fix test failures.
- Fix the help output for new benchmarks help output.
- Fix incorrect regex for sanitizing output.

Test: Ran unit tests and they pass.
Change-Id: I227eef3ce8c4ce639321e5ab8a57d0877063ede1
2018-11-07 14:30:55 -08:00
Logan Chien
77a5f95405 Merge "versioner: Port to clang-r344140" 2018-11-07 22:02:50 +00:00
Chih-hung Hsieh
34d1f2ddf2 Revert "Disable lld, failed to link bionic/linker."
This reverts commit 73de62e461.

Reason for revert: bug was fixed upstream and included into AOSP lld
Bug: 78115263
Test: make checkbuild

Change-Id: Ib9e4af1efdcdb547c7bd65cce4ce48d7f09ed217
2018-11-07 21:55:18 +00:00
Treehugger Robot
5e099173da Merge "Revert "Do not use clang lld with -z,global"" 2018-11-07 21:43:24 +00:00
Evgenii Stepanov
2b94f124df Merge changes I6ba4b46a,Ic54579e3
* changes:
  Disable a few bionic tests under HWASan.
  Remove timer_delete_multiple test.
2018-11-07 21:35:53 +00:00
Neil Fuller
fd522d0132 Finalize the name of the apex package
The package name in the manifest.json is changing to
remove apex so the hardcoded path must change.

Bug: 119026403
Test: build
Change-Id: I906b595a1325b40f8af8c37d7d08cd543c988cc8
2018-11-07 15:42:43 +00:00