Commit graph

26841 commits

Author SHA1 Message Date
Yi Kong
c15baefc0a Merge "Exclude libclang_rt.builtins symbols" 2018-10-04 22:09:55 +00:00
Yi Kong
7786a344ce Exclude libclang_rt.builtins symbols
Similar to libgcc, libclang_rt.builtins symbols need to be excluded.

Bug: 29275768
Change-Id: Iaf7381de3b4dbd92997abd03667dea0baaab98e1
2018-10-03 10:07:13 +00:00
Chih-hung Hsieh
9df26193c8 Merge "Work around bugprone-exception-escape bug." 2018-10-02 18:30:31 +00:00
Elliott Hughes
8d63ae128f Merge "Make fclose/pclose distinct." 2018-10-02 16:57:11 +00:00
Chih-Hung Hsieh
153b71c407 Work around bugprone-exception-escape bug.
Bug: 117120485
Test: build with WITH_TIDY=1 and global bugprone-* checks.
Change-Id: I28aa2a176bd7d2ae4961877a8122a09666d85237
2018-10-01 16:17:44 -07:00
Elliott Hughes
22917f63ee Make fclose/pclose distinct.
I failed to convince the compiler/linker to just refrain (via factoring out,
attribute `noinline`, or meddling with `--icf=none`), but luckily I noticed
that we should have CHECK_FP in each function for a better error message,
and the distinct error messages keep the two functions apart.

(Also add a missing CHECK_FP to `clearerr_unlocked`.)

Bug: http://b/116969207
Test: manual with a modified `crasher`
Change-Id: Ic122e90e94f7e22f486be57d3dac7137a225d682
2018-10-01 16:17:37 -07:00
Christopher Ferris
928ce8eb64 Merge "Move isolated test runner out of bionic." 2018-10-01 23:07:31 +00:00
Stephen Hines
05ba56d6c0 Merge "Fix up a few bionic tests for the clang-r339409 update." 2018-10-01 15:57:35 +00:00
Christopher Ferris
6d2c0bdf6e Move isolated test runner out of bionic.
Use a global gtest isolation runner rather than the custom one in
bionic.

Test: Ran all unit tests and verified same behavior before and after.

Change-Id: I24a7cf17cf8e018d0f51969c64b53ce9059cc779
2018-09-27 22:22:17 -07:00
Christopher Ferris
f3ff8dc6f4 Merge "Ignore output to stderr while enumerating tests" 2018-09-27 23:23:36 +00:00
Treehugger Robot
ddf92a1ba5 Merge "Always return /vendor/bin/sh as shell for OEM ids in getpwnam() etc." 2018-09-27 23:23:34 +00:00
Colin Cross
6b755755bc Merge "Disable STL for crt objects" 2018-09-27 23:23:19 +00:00
Tom Cherry
fa5f61c8d9 Always return /vendor/bin/sh as shell for OEM ids in getpwnam() etc.
During the review of the script that generates /vendor/etc/passwd, it
was suggested that the shell be /vendor/bin/sh instead of the typical
/system/bin/sh.  This has subsequently caused bionic unit tests to
fail, since they always check that the shell is set to /system/bin/sh.

In the spirit of that review, libc is modified to return
/vendor/bin/sh for the OEM AID ranges and the test is updated to
expect this.

Test: bionic unit tests
Change-Id: Ie7c1c48fde8a71b3df1aa0ef112d42ab7bd3baec
2018-09-27 20:29:49 +00:00
Elliott Hughes
7208139406 Merge "Use builtins for ceil/floor/rint/trunc on arm64" 2018-09-27 20:24:28 +00:00
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
Elliott Hughes
e27886eaea Merge "Add reallocarray(3)." 2018-09-26 22:54:54 +00:00
Elliott Hughes
b177085ce7 Add reallocarray(3).
Originally a BSD extension, now in glibc too. We've used it internally
for a while.

(cherry-pick of e4b13f7e3ca68edfcc5faedc5e7d4e13c4e8edb9.)

Bug: http://b/112163459
Test: ran tests
Change-Id: I813c3a62b13ddb91ba41e32a5a853d09207ea6bc
Merged-In: I813c3a62b13ddb91ba41e32a5a853d09207ea6bc
2018-09-26 14:24:18 -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
dimitry
21557cdd2e Ignore output to stderr while enumerating tests
Bug: http://b/114304197
Test: adb unroot && run CtsBionicTestCases
Change-Id: I75880934fa1c25be6c76e866f97efc14d5ccd0a1
2018-09-25 12:23:33 +02:00
Stephen Hines
cd659d410a Fix up a few bionic tests for the clang-r339409 update.
Disable -Wmemset-transposed-args to ensure that FORTIFY still works
without it. Also, we can finally enable checking for
FLT_HAS_SUBNORM/DBL_HAS_SUBNORM/LDBL_HAS_SUBNORM now that those are
available in Clang.

Bug: http://b/110779387
Test: build and run bionic unit tests
Change-Id: I4bf19b870c44d981ecbd1089d0ae6a2496be5441
2018-09-24 16:59:08 -07: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