Commit graph

26822 commits

Author SHA1 Message Date
Colin Cross
ab17944178 Disable STL for crt objects
cc_objects are getting support for STL headers, disable them for
crt objects to avoid a circular dependency through libc++.

Test: m checkbuild
Change-Id: I4e0f4a2193ce98ec4b8802492add9014ec0dba98
2018-09-27 11:03:22 -07:00
Dimitry Ivanov
e4e3de819d Merge "linker: extract defaults and source files" 2018-09-26 09:03:45 +00:00
Chih-hung Hsieh
fe108db540 Merge "Add noexcept to move constructors and assignment operators." 2018-09-25 23:15:54 +00:00
Elliott Hughes
efaa60ff6c Merge "Only use NDK libraries in the benchmarks." 2018-09-25 22:13:09 +00:00
Chih-Hung Hsieh
9a64b56334 Add noexcept to move constructors and assignment operators.
Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: I9f8760cddb3c25255cd24604606af84d837d55e9
2018-09-25 14:00:44 -07:00
dimitry
b8b3a76606 linker: extract defaults and source files
Move source files to filegroup and extract c/ldflags and
version-script to linker_defaults.

Bug: http://b/71494052
Test: make
Change-Id: Ic82885e1c006f91a8446978fabd214f87cd20510
2018-09-25 16:17:24 +02:00
Elliott Hughes
627329915a Only use NDK libraries in the benchmarks.
It should be possible to run the benchmarks on any device, including
past and future ones, and sticking to NDK libraries ensures that.

Bug: N/A
Test: `readelf -aW`
Change-Id: I15a7a4104fa30263136bc3033d2bd9022cd8ff7b
2018-09-24 16:45:13 -07:00
Christopher Ferris
30b17e32f0 Merge "Touch the memory when doing malloc/free benchmark." 2018-09-21 15:51:08 +00:00
Treehugger Robot
8f5589faf2 Merge "Remove unused NetBSD compatibility cruft." 2018-09-21 01:06:32 +00:00
Christopher Ferris
4fae703029 Touch the memory when doing malloc/free benchmark.
Also, update the benchmark loop for modern C++.

Test: Ran benchmarks.
Change-Id: I925446b893793eb8c2c6759716cdd3dbbcf1e7c1
2018-09-20 15:03:49 -07:00
Evgenii Stepanov
8d11bea6c5 Merge "[hwasan] Tweak process and thread initialization." 2018-09-20 21:39:55 +00:00
Elliott Hughes
64f8e7b1cc Remove unused NetBSD compatibility cruft.
Bug: N/A
Test: builds
Change-Id: I5c472c7b5c570c739363b4a454251ebf0324d43c
2018-09-20 13:27:41 -07:00
Josh Gao
ce9d653b38 Merge changes from topics "fdsan_ziparchive_type", "fdsan_java_socket"
* changes:
  fdsan: improve documentation.
  fdsan: add type for libziparchive's ZipArchive.
  fdsan: add types for Java sockets.
2018-09-20 19:22:03 +00:00
Evgenii Stepanov
13e8dcbdc9 [hwasan] Tweak process and thread initialization.
Make sure that TLS_SLOT_TSAN is always available and correctly set up in
HWASan-instrumented functions by setting up the tls register and running hwasan
initialization (__hwasan_init in the main thread and __hwasan_thread_enter in
secondary) early enough.

This is needed to accomodate a change in HWASan: https://reviews.llvm.org/D52249

Bug: 112438058
Test: boot with SANITIZE_TARGET=hwaddress, run bionic-tests
Change-Id: Icd909a4ea0da6c6c1095522bcc28debef5f2c63d
2018-09-20 12:20:12 -07:00
Elliott Hughes
a02d631163 Merge "Remove dead code." 2018-09-19 17:13:11 +00:00
Elliott Hughes
15711c1dd0 Remove dead code.
I stumbled across this because I was looking at the various locks in libc.

Bug: N/A
Test: ran tests
Change-Id: I77c9954f49aaae7519ea7f4917bbe6f138b841ad
2018-09-18 14:28:48 -07:00
Josh Gao
d747bb8f3f fdsan: improve documentation.
Fix a race condition in the example, and add a linearized version to
make it more clear what's going on.

Test: none
Change-Id: Id9158e4fd407b676ef364e7076985de3ad477457
2018-09-18 13:42:08 -07:00
Josh Gao
5fa9df8efc fdsan: add type for libziparchive's ZipArchive.
Test: debuggerd `pidof system_server` | grep " fd "
Change-Id: I6a9a4306ecffe3899e4cc7285a0eb33efaa62616
2018-09-18 13:23:31 -07:00
Elliott Hughes
655f80e37f Merge "State clearly that an ELF file has the wrong architecture." 2018-09-18 18:15:07 +00:00
Josh Gao
d527cf1f99 fdsan: add types for Java sockets.
Test: art/tools/run-libcore-tests.sh
Change-Id: If61211bc4ae225c3f89db989a167f9dc4fce375a
2018-09-17 17:31:58 -07:00
Elliott Hughes
d16cface55 State clearly that an ELF file has the wrong architecture.
Before:

  "libx.so" has unexpected e_machine: 40 (EM_ARM)

After:

  "libx.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)

Bug: N/A
Test: `LD_PRELOAD=/system/lib64/libm-x86_64.so date` on arm64
Change-Id: I5bb40c435bd22b4e11fe802615925e10db7fb631
2018-09-17 15:50:09 -07:00
Elliott Hughes
8b527f2857 Merge "Explicitly say pthread_cancel in the docs." 2018-09-15 15:40:03 +00:00
Elliott Hughes
670ea7aca9 Explicitly say pthread_cancel in the docs.
Bug: http://b/33943372
Test: N/A
Change-Id: If71691f7ff20c9b8c14de15692543bbd858c9aab
2018-09-14 17:05:01 -07:00
Peter Collingbourne
ed16b344e7 Merge "benchmarks: Fix the benchmark tests." 2018-09-14 02:16:52 +00:00
Peter Collingbourne
b228f4e3d3 Merge "benchmarks: Update the documentation." 2018-09-13 23:12:08 +00:00
Peter Collingbourne
62011c27a7 benchmarks: Update the documentation.
Update the locations of the benchmark binaries to match where they
are currently installed.
2018-09-13 16:08:18 -07:00
Peter Collingbourne
c282ca9f44 benchmarks: Fix the benchmark tests.
Update the list of benchmarks to include the recently added strncmp
benchmarks.
2018-09-13 16:06:01 -07:00
Treehugger Robot
4d98149096 Merge "Move pipe, open, and getdents from the APP to COMMON seccomp whitelist." 2018-09-12 21:46:14 +00:00
Robert Sesek
74cdb253ba Move pipe, open, and getdents from the APP to COMMON seccomp whitelist.
These system calls are required by Breakpad for crash reporting.
WebViews are spawned from the webview_zygote, which itself is spawned
from the app_process zygote. The webview_zygote gets the SYSTEM seccomp
policy applied because it is not an app, and so the WebView sandboxed
processes inherit that policy.

In Ifd8a85b0de2eb6f2a76a6458570fc03b020a90ab, these system calls were
moved from COMMON to APP, which breaks Breakpad/crash reporting for
WebView sandboxed processes.

Bug: 112572914
Test: `am start com.android.settings/.SettingsLicenseActivity`
Test: Get the pid of the sandboxed_process0 for the license viewer.
Test: Send the process SIGABRT and check logcat for "google-breakpad"
      error messages.

Change-Id: I1cf56ae85b1a67ec91e979bc7e0f941726a9cc0e
2018-09-11 19:20:34 -04:00
Orion Hodson
56deeb7336 Merge "Update probing in membarrier_test" 2018-09-11 06:43:10 +00:00
Orion Hodson
0c938550cf Update probing in membarrier_test
Updates HasMembarrier(cmd) to probe rather than execute command to fix
unintended test skipping.

Test: manual on OrangePi Zero running 4.17.4.
Change-Id: I33a6684a3662cae20cbedc52463b26ef299caf71
2018-09-10 10:21:40 +01:00
Christopher Ferris
2942b6a2c2 Merge "Fix membarrier test." 2018-09-08 16:33:47 +00:00
Bernie Innocenti
59c08dd67b Merge "Improve netd detection" 2018-09-08 01:58:34 +00:00
Christopher Ferris
795034cab8 Fix membarrier test.
Some older kernels do not support all membarrier commands. For example,
the 4.9.x kernel only supports MEMBARRIER_CMD_QUERY and MEMBARRIER_CMD_SHARED.

Test: Ran unit tests on hikey.
Change-Id: I5d4b93df6aa5f443c4700e8f7d33f46953f74e87
2018-09-07 14:11:28 -07:00
Bernie Innocenti
fb4eaa019e Improve netd detection
The alleged improvement consists in making the detection actually work
when netd is spawned by init, which of course uses the full path.
I had tested the previous logic by running netd from the shell, which
worked because argv[0] was just set to "netd". My bad -_-

Test: flash, boot and grep logcat for "Skipping libnetd_client init"
Change-Id: Ie5f11436dfa2a9347721147dc2b980144452404a
2018-09-07 10:29:18 -07:00
Elliott Hughes
431d2ff141 Merge "Add android_get_device_api_level." 2018-09-07 15:40:45 +00:00
Orion Hodson
dca7d3fae5 Merge "libc: Add membarrier to common seccomp allowed list" 2018-09-07 09:46:08 +00:00
Treehugger Robot
8a8bf193b0 Merge "Fix mistake in fdsan documentation." 2018-09-07 01:33:58 +00:00
Treehugger Robot
dc91d900ae Merge "bionic: Add magic to abort message" 2018-09-07 01:32:14 +00:00
Elliott Hughes
e15e93a247 Merge "Use strerror_r(3) for the printf family %m." 2018-09-06 23:45:18 +00:00
Josh Gao
01416ba112 Fix mistake in fdsan documentation.
File descriptors are POSIX, not C.

Test: none
Change-Id: Idc3c32c60f9c61e8e68aabbc4589a6c68e156e4b
2018-09-06 16:23:38 -07:00
Josh Gao
0326f063b5 Merge "fdsan: add documentation." 2018-09-06 23:17:50 +00:00
Luis Hector Chavez
6d93c60778 bionic: Add magic to abort message
This change adds a 128-bit magic value just before the abort message
(and its length). This allows Chrome OS crash collector (which cannot
reliably correlate a crash with its corresponding tombstone) to extract
the abort message from the core dump.

Bug: 62387553
Test: /data/nativetest{,64}/debuggerd_test/*
Test: /data/nativetest{,64}/bionic-unit-tests{,-static}/*

Change-Id: I69ff021d773b3a10081ab16ddf6f23233320fb02
2018-09-06 15:18:21 -07:00
Josh Gao
b64196a9bb fdsan: add documentation.
Test: none
Change-Id: I7dabd8f5420c757b6504254a6414da8e877d475e
2018-09-06 14:55:12 -07:00
Treehugger Robot
a2a114ba26 Merge "Annotate siglongjmp for HWASan." 2018-09-06 21:35:09 +00:00
Elliott Hughes
ce934e3d9b Add android_get_device_api_level.
Bug: http://b/113615412
Test: ran tests
Change-Id: I0a7ae336c96c9ed6543b6935cbc242d14d4a4a67
2018-09-06 14:19:46 -07:00
Elliott Hughes
f340a56d1c Use strerror_r(3) for the printf family %m.
There's TLS space used for unknown errno values, and a call to printf
shouldn't clobber that. No-one will ever hit this in real life, but
since it's easily fixed...

Bug: http://b/112776560
Test: ran tests
Change-Id: I8c2437f2e5214e652119791d4e162a197b049d5b
2018-09-06 10:42:40 -07:00
Orion Hodson
6ba6694ec2 libc: Add membarrier to common seccomp allowed list
Allows ART JIT use membarrier to invalidate instruction
pipelines.

Bug: 66095511
Test: bionic-unit-tests
Change-Id: I8cf83929f00baf5a3c440a899d2667a992bda8e2
2018-09-06 16:36:09 +01:00
Treehugger Robot
1e4a4134fb Merge "Revert "arm64: Use builtin for nearbyintf/nearbyint"" 2018-09-06 00:47:32 +00:00
Elliott Hughes
b75cc027ff Revert "arm64: Use builtin for nearbyintf/nearbyint"
This reverts commit 35d8ba303b.

Reason for revert: caused test failures...

[  FAILED  ] math_h_force_long_double.nearbyint (15 ms)
bionic/tests/math_test.cpp:(1080) Failure in test math_h_force_long_double.nearbyint
Value of: (fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0
  Actual: false
Expected: true
math_h_force_long_double.nearbyint exited with exitcode 1.

Change-Id: If8e3a3dfbd0e7ee071e5187f96749b6acbb5fc05
2018-09-05 22:29:28 +00:00