Commit graph

29814 commits

Author SHA1 Message Date
Christopher Ferris
5d3ba4ed9d Merge "Update to kernel headers v5.2.6." 2019-08-06 04:30:52 +00:00
Elliott Hughes
a928758ac3 Merge "Document the "one big library" trick."
am: 10a67b849e

Change-Id: I27681d9d278339351dfc4f423aa8ea457c35e2de
2019-08-05 20:40:17 -07:00
Peter Collingbourne
6239798fae Merge "linker: Add library load and unload hooks for HWASan."
am: 32a628b286

Change-Id: I4dc4e57f71fea9241cb6a3b3ed978370efb7b401
2019-08-05 20:39:52 -07:00
Treehugger Robot
10a67b849e Merge "Document the "one big library" trick." 2019-08-06 03:21:34 +00:00
Treehugger Robot
32a628b286 Merge "linker: Add library load and unload hooks for HWASan." 2019-08-06 03:19:44 +00:00
Tom Cherry
2e9c8cffd8 Merge "Update docs for clockwait/clocklock functions"
am: f8a7ec7cd4

Change-Id: I4c77a44afb2cd44c2ae0f828fa3d529d8e53459a
2019-08-05 18:19:24 -07:00
Treehugger Robot
f8a7ec7cd4 Merge "Update docs for clockwait/clocklock functions" 2019-08-06 00:58:29 +00:00
Peter Collingbourne
6533208aaa linker: Add library load and unload hooks for HWASan.
These hooks notify the HWASan runtime library whenever a library is loaded
or unloaded so that it can update its shadow memory.

Bug: 138159093
Test: walleye_hwasan-userdebug boots with+without https://reviews.llvm.org/D65770
Change-Id: I6caf2a6540ed2c0d94db444e806a3c7ba504cabb
2019-08-05 16:51:01 -07:00
Elliott Hughes
3230b6851b Document the "one big library" trick.
Bug: http://b/133823482
Test: N/A
Change-Id: I3a70fe563f47d6f2311415c84a3c5f9f7b575e54
2019-08-05 16:40:52 -07:00
Elliott Hughes
3d24d2b088 Add memfd_create(2) and mlock2(2).
These are old enough now that the latest devices will have kernels that
support them.

Also add basic doc comments to <sys/mman.h>.

Test: treehugger
Change-Id: I1b5ff5db0b6270f5c374287cac1d6a751a0259f5
2019-08-05 16:31:08 -07:00
Tom Cherry
cd70aa47d2 linker: Remove setting _USING_LIBCXX
As of aosp/1086558, stdatomic.h directly checks for the presence of
<atomic> instead of checking _USING_LIBCXX, so these lines are
obsolete.

Test: build
Change-Id: Icfdb47b3ad109421b3413041f3d3027e2c0b518e
2019-08-05 14:36:46 -07:00
Tom Cherry
f0d9271fe2 Update docs for clockwait/clocklock functions
Test: n/a
Change-Id: Ie4853912c9ed63d29121e62406682896012962ec
2019-08-05 14:13:25 -07:00
Elliott Hughes
50531818ac Merge "Update seccomp whitelist."
am: a5c9c7c565

Change-Id: I472ec60e9a3a9f9a79a8a431f50f7c162950231d
2019-08-05 13:08:53 -07:00
Christopher Ferris
fa59a10bcd Update to kernel headers v5.2.6.
Also, fix a bug in update_all.py when the syscalls file does not change.

Test: Builds and boots on a taimen.
Change-Id: If85b00daef2c176f804a0861894f5bbca9c6d5df
2019-08-05 12:59:58 -07:00
Treehugger Robot
a5c9c7c565 Merge "Update seccomp whitelist." 2019-08-05 19:22:08 +00:00
Yi Kong
bf67ea5426 Adapt tests due to the new Clang fortify-source warning
https://reviews.llvm.org/D58797 added several new compile time
_FORTIFY_SOURCE diagnostics. This broke clang_fortify_tests:

FAILED: out/target/product/walleye/obj/STATIC_LIBRARIES/bionic-compile-time-tests2-clang++_intermediates/clang_fortify_tests.o
error: 'warning' diagnostics seen but not expected:
  Line 159: 'memcpy' will always overflow; destination buffer has size 8, but size argument is 9
  Line 161: 'memmove' will always overflow; destination buffer has size 8, but size argument is 9
  Line 165: 'memset' will always overflow; destination buffer has size 8, but size argument is 9
  Line 183: 'strncpy' size argument is too large; destination buffer has size 8, but size argument is 9
  Line 185: 'stpncpy' size argument is too large; destination buffer has size 8, but size argument is 9
  Line 189: 'strncat' size argument is too large; destination buffer has size 8, but size argument is 9
  Line 227: 'strncpy' size argument is too large; destination buffer has size 4, but size argument is 5
  Line 232: 'stpncpy' size argument is too large; destination buffer has size 4, but size argument is 5
  Line 242: 'strncat' size argument is too large; destination buffer has size 4, but size argument is 5
  Line 490: 'snprintf' size argument is too large; destination buffer has size 8, but size argument is 9
  Line 495: 'vsnprintf' size argument is too large; destination buffer has size 8, but size argument is 9
error: 'note' diagnostics seen but not expected:
  File bionic/libc/include/bits/fortify/fcntl.h Line 50: 'open' has been explicitly marked unavailable here
  File bionic/libc/include/bits/fortify/fcntl.h Line 102: 'open64' has been explicitly marked unavailable here
  File bionic/libc/include/bits/fortify/fcntl.h Line 75: 'openat' has been explicitly marked unavailable here
  File bionic/libc/include/bits/fortify/fcntl.h Line 121: 'openat64' has been explicitly marked unavailable here
  File bionic/libc/include/bits/fortify/stdio.h Line 68: 'sprintf' has been explicitly marked unavailable here
16 errors generated.

Bug: 131328001
Bug: 138701853
Test: Build with r365631 toolchain
Change-Id: I103ecb7b3abcf4b5cfc4f36ccab69e03d0976275
2019-08-05 11:48:47 -07:00
Elliott Hughes
9a5bdd6d45 Update seccomp whitelist.
renameat2 is now exposed, my comment about timerfd was nonsense, and
it's worth documenting when and where the various syscalls appeared.

Bug: http://b/127675384
Test: treehugger
Change-Id: I84662398d39678df3ee7ce39add670337ff8abea
2019-08-05 08:56:40 -07:00
Elliott Hughes
0dc203a547 Merge "Add renameat2."
am: fd56f55419

Change-Id: I6843edd14527e6029271718b076ad5cbc94fee45
2019-08-02 15:19:42 -07:00
Elliott Hughes
fd56f55419 Merge "Add renameat2." 2019-08-02 21:53:18 +00:00
Elliott Hughes
05b675e8bf Add renameat2.
Bug: http://b/127675384
Test: new tests
Change-Id: Ia2e3d5679180391ca98e62fa429fa11cbf167507
2019-08-02 09:09:59 -07:00
Elliott Hughes
97f04680ef Merge "seccomp: add the "64-bit time for 32-bit processes" system calls."
am: 8aac028212

Change-Id: I9e14f7d4d0e99e0574285ba7fbd74116376f9a8e
2019-08-01 08:57:21 -07:00
Elliott Hughes
8aac028212 Merge "seccomp: add the "64-bit time for 32-bit processes" system calls." 2019-08-01 15:17:45 +00:00
Elliott Hughes
ee7bc3002d seccomp: add the "64-bit time for 32-bit processes" system calls.
The cuttlefish folks are hitting this because the VDSO clock_gettime
falls back to the clock_gettime64 system call when given an invalid
clock.

Bug: http://b/138781460
Test: examined the generated .cpp files.
Change-Id: I98b311cd8652716eb6d45fb99308fdf952e79ba3
2019-08-01 15:16:58 +00:00
Ryan Prichard
8f70df314c Merge changes I99d2faae,Ie98b7624
am: c2a722f5d7

Change-Id: I698623ddc497a54099d22d97152968b8748160c2
2019-07-31 14:27:37 -07:00
Ryan Prichard
c2a722f5d7 Merge changes I99d2faae,Ie98b7624
* changes:
  Enable traditional TLS accesses on arm64
  Renumber arm64 TLS to match GNU values
2019-07-31 20:50:58 +00:00
Ryan Prichard
30feb645f9 Enable traditional TLS accesses on arm64
Handle generic DTPMOD/DTPREL relocations on arm64. Expose __tls_get_addr.

Bug: http://b/123385182
Test: manual -- compile code using arm64 gcc -mtls-dialect=trad
Change-Id: I99d2faae35d1ebffc1be8de50b4a1f5e21b14348
2019-07-30 20:55:54 -07:00
Ryan Prichard
6d601458de Renumber arm64 TLS to match GNU values
The AArch64 ELF specification originally specified these relocations:

  R_AARCH64_TLS_DTPREL64          1028
  R_AARCH64_TLS_DTPMOD64          1029

However, the GNU toolchain implemented them as:

  R_AARCH64_TLS_DTPMOD64          1028
  R_AARCH64_TLS_DTPREL64          1029

The AArch64 ELF specification has been updated to replace the relocations
with R_AARCH64_TLS_IMPDEF1 and with R_AARCH64_TLS_IMPDEF2, where each
implementation can choose which interpretation it implements, but with a
suggestion to follow the GNU behavior.

Also: remove the 64 suffixes from the TLS relocations. The newest version
of the AArch64 ELF specification (version f) also omits the suffixes, as
do the glibc headers.

Bug: http://b/123385182
Bug: https://bugs.llvm.org/show_bug.cgi?id=40507
Test: build device, it boots
Change-Id: Ie98b7624752982973f0ac969d646454a86784cab
2019-07-30 16:30:46 -07:00
Pirama Arumuga Nainar
340fc05e12 Merge "Fix clang header dependency for versioner"
am: 876c6f03f9

Change-Id: If1b3f0f43832f35d7d7ed01ad0f86caad0b404c5
2019-07-29 22:44:00 -07:00
Pirama Arumuga Nainar
876c6f03f9 Merge "Fix clang header dependency for versioner" 2019-07-30 05:08:18 +00:00
Vic Yang
b483b66d1d Merge "Use the new sort_bss_symbols_by_size option for libc"
am: e7c3cb1dc7

Change-Id: Ib91707801fb9b43bc1f766be45340481866df451
2019-07-29 20:10:49 -07:00
Vic Yang
e7c3cb1dc7 Merge "Use the new sort_bss_symbols_by_size option for libc" 2019-07-30 02:34:23 +00:00
Pirama Arumuga Nainar
49c733cc49 Fix clang header dependency for versioner
Versioner is now a prebuilt in prebuilts/clang-tools and that project
has the Clang headers packaged with it.  Use that dependency instead of
external/clang/lib/Headers.  Use the linux-x86 path for both Linux and
Darwin since they are both the same.

Test: presubmit
Change-Id: I01ad4c05fe3301a2fdad3662377f78694af6cd81
2019-07-29 15:44:46 -07:00
Vic Yang
03ff4365ec Use the new sort_bss_symbols_by_size option for libc
Instead of maintaining a symbol ordering file, using the new
sort_bss_symbols_by_size property allows for symbol sorting at build
time.

Bug: 135754984
Test: Build and check the resulting libc.so has its bss symbols sorted.
Change-Id: I4a1cd6774dfe61b73f454bdf95b535db1f9fb1ac
2019-07-29 13:26:33 -07:00
Vic Yang
7317514821 Merge "linker: Speed up relocation with an 1-entry symbol cache"
am: c16468b661

Change-Id: I6bae2ce197c259e2a437312006f829be2dc9fd94
2019-07-26 13:23:50 -07:00
Vic Yang
c16468b661 Merge "linker: Speed up relocation with an 1-entry symbol cache" 2019-07-26 20:09:19 +00:00
Vic Yang
1b4854cbf6 Merge "Fix linker compilation when STATS is set"
am: 6ae3a1324b

Change-Id: I71694ad5ff8f1394a154399b1869b03de89f34d0
2019-07-25 15:17:22 -07:00
Treehugger Robot
6ae3a1324b Merge "Fix linker compilation when STATS is set" 2019-07-25 21:37:42 +00:00
Vic Yang
521ad07270 linker: Speed up relocation with an 1-entry symbol cache
When relocating a DSO, it is not unusual to have consecutive
relocations using the same symbol.  In this case, it is wasteful to
perform the same symbol lookup.  This change implements an 1-entry
symbol cache so that symbol lookup results are reused in such scenario.

Test: On cuttlefish, enable STATS in linker_debug.h.  Boot and see RELO
      STATS in logcat showing cache hits.  Hit rate seen is mostly
      within 15% to 45%.
Change-Id: I84783d3b9a6ac9e39ed7fb45e58f6b3c012478d0
2019-07-25 13:31:55 -07:00
Vic Yang
542db792dc Fix linker compilation when STATS is set
Test: Compiles with STATS set in linker_debug.h
Change-Id: I8ea6ca9a61ad316473dab51999885008f2721cee
2019-07-25 10:39:27 -07:00
Ryan Prichard
cbb9a965f7 Merge "Name stack+tls VMAs with PR_SET_VMA_ANON_NAME"
am: d5c0a508bc

Change-Id: I71e7de0fc0361d3c958638fa083c8d1a72016cd4
2019-07-24 14:05:42 -07:00
Ryan Prichard
d5c0a508bc Merge "Name stack+tls VMAs with PR_SET_VMA_ANON_NAME" 2019-07-24 20:46:32 +00:00
Dan Albert
4ea19214a4 Link libc++demangle.
The demangler is moving out of libc++abi to save on bloat.

Test: make checkbuild
Bug: http://b/138245375
Change-Id: I7402894bb326f524388c9efdf86509dad50f2018
2019-07-24 12:16:41 -07:00
Yi Kong
9e4364d035 Merge "Add missing nothrow attribute"
am: 4f40d47a02

Change-Id: I964c91f0149021e3b26b44ce236149b4d2ccd320
2019-07-23 18:31:57 -07:00
Treehugger Robot
4f40d47a02 Merge "Add missing nothrow attribute" 2019-07-24 01:10:58 +00:00
Florian Mayer
5d9e9ceaf6 Merge "Reserve signal for java heap dumps."
am: 21f1d484bb

Change-Id: I9d778a560ed7b9f6eb6641436b8e85041c8f2cd3
2019-07-23 16:32:42 -07:00
Florian Mayer
21f1d484bb Merge "Reserve signal for java heap dumps." 2019-07-23 23:02:56 +00:00
Yi Kong
7b50f7d51e Add missing nothrow attribute
The upcoming compiler update emits warning about the missing nothrow
attribute:

  bionic/libc/bionic/jemalloc.h:33:5: error: 'je_mallctl' is missing exception specification '__attribute__((nothrow))' [-Werror,-Wmissing-exception-spec]
  int je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
      ^
                                                                                           __attribute__((nothrow))
  external/jemalloc_new/include/jemalloc/jemalloc.h:230:38: note: previous declaration is here
  JEMALLOC_EXPORT int JEMALLOC_NOTHROW    je_mallctl(const char *name,
                                          ^
  external/jemalloc_new/include/jemalloc/jemalloc_rename.h:12:22: note: expanded from macro 'je_mallctl'
  #  define je_mallctl je_mallctl

Test: build with clang r365631
Bug: 131328001
Change-Id: Ia8b6f47d38e5a003b6282f10724b65b1f971ba84
2019-07-23 15:03:16 -07:00
Florian Mayer
6883b0807b Reserve signal for java heap dumps.
We will put instrumentation in ART to write out Java heap memory
information on receipt of this signal.

Bug: 136210868
Test: Flash blueline-userdebug and boot

Change-Id: I63173a4051c46b8569faaf3064e1db1dbd0ea3fe
2019-07-23 16:38:00 +01:00
Ryan Prichard
03cef383ba Name stack+tls VMAs with PR_SET_VMA_ANON_NAME
Bionic creates a single thread mapping to hold a thread's stack and static
TLS memory. Use PR_SET_VMA_ANON_NAME to name this region
"stack_and_tls:tid". dumpsys meminfo can report this region as "Stack"
memory.

The main thread's memory is instead named stack_and_tls:main, and the VMA
is renamed to stack_and_tls:main in a post-fork child.

For the main thread, and threads using pthread_attr_setstack, Bionic still
creates the stack_and_tls mapping, but it only has TLS memory in it.

Bug: http://b/134795155
Test: run "dumpsys meminfo" and verify that this CL increases the reported
  stack memory usage from about 4MB to 21MB.
Change-Id: Id1f39ff083329e83426130b4ef94222ffacb90ae
Merged-In: Id1f39ff083329e83426130b4ef94222ffacb90ae
2019-07-23 02:06:51 +00:00
Tom Cherry
52de5d1a70 Merge "Change stdatomic.h check from defined(_USING_LIBCXX) to __has_include(<atomic>)"
am: 6b2532e19a

Change-Id: I78c3d5fb79a63edb71553cd1ebe554511361e6c5
2019-07-19 11:36:49 -07:00