summaryrefslogtreecommitdiff
path: root/libc/include
AgeCommit message (Collapse)Author
2021-07-12Merge SP1A.210709.002Haamed Gheibi
Change-Id: Ifb03c531ae205a26e8e324f4b9ee4b9ae7b1062a
2021-06-24Add definition of M_MEMTAG_TUNING.Evgenii Stepanov
Bug: 191769584 Test: N/A Merged-In: Ief77f95a04411528563787a9fc6d10738fc5688f Change-Id: Ief77f95a04411528563787a9fc6d10738fc5688f (cherry picked from commit d8d561c98457409c0003b37b9c1f84bb7d988e04)
2021-05-10Merge SP1A.210510.001Brian Orr
Change-Id: I3f1de8b84f5e253d6a659de6a2ed75e674b7f5a5
2021-05-03Update to v5.12 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.12 Test: Boots flame device and runs bionic unit tests. Test: Boots acloud device and runs bionic unit tests. Change-Id: I8ac107ce9d4978be3ef9517b90ad6ecafd06785a
2021-04-25Merge SP1A.210412.001Scott Lobdell
Change-Id: Icb74f1a8f5ef597ea95b8d4b2d6689a66e8753b8
2021-04-08Merge SP1A.210407.002Scott Lobdell
Change-Id: Idd8ceba51b13323ecdee0d34a328b9648f888693
2021-04-06Fix return type of process_madvise().Elliott Hughes
Noticed this from https://man7.org/linux/man-pages/man2/process_madvise.2.html but independently confirmed by checking the kernel source. Also fix the documentation. Test: treehugger Change-Id: I6beeeeb2178a58a22a36532e634917b3ae8767ee
2021-03-29fortify: mark all always_inline functions with no_stack_protectorGeorge Burgess IV
FORTIFY'ed functions try to be as close to possible as 'invisible'; having stack protectors detracts from that. Don't apply this to functions which clang has no chance of inlining anyway (like variadic functions) Bug: 182948263 Test: TreeHugger Change-Id: I08cfec25464b8ea1e070942e3dc76fc84da73dd0
2021-03-11Merge SP1A.210311.001Scott Lobdell
Change-Id: Ibc8a477237696d23ba36573c5b0334a0b1007865
2021-02-25Add wrappers for pidfd_{open,getfd,send_signal}.Josh Gao
Bug: http://b/172518739 Test: `/data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter="*pidfd*"` on blueline Change-Id: Ibae32bbedbcf26535a80a5cbfb55ce180906b610
2021-02-23Merge SP1A.210222.001Scott Lobdell
Change-Id: I0c63fcf0268c45f5f90323df42aaf2f77e05abdb
2021-02-16Update to v5.11 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.11 Test: Built cuttlefish and flame images. Ran bionic unit tests on both. Change-Id: Ie60337aafad4bda55af99b6c8fe9f56bf2fa787f
2021-02-11Rename __ANDROID_UNGUARDED_AVAILABILITY__ -> ↵Elliott Hughes
__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__. Also reduce some of the duplication in the macros. Bug: http://b/179067538 Test: treehugger Change-Id: I81ab341731b0faad6c7c5f00037feff8576abafb
2021-02-08Merge SP1A.210208.001Daniel Norman
Change-Id: I3ff65c4f80ca07db3b31cd670e16dbc153717470
2021-02-01Merge "[MemInit] Remove old API, introduce new MemInit API."Mitch Phillips
2021-02-01Fix __VERSIONER_NO_GUARD cases for availability.Dan Albert
libc++ still depends on these being declared even if they are unavailable. This results in a worse error message (a link error rather than a compiler diagnostic) if these functions end up being used, but without the decl headers like libc++'s math.h can't be included because it refers to an undeclared function. For the cases where weak symbols aren't being used, don't annotate these functions with their availability information. Also need to avoid using __builtin_available for this case because the NDK doesn't have __isOSVersionAtLeast yet. __ANDROID_UNGUARDED_AVAILABILITY__ is being used as a proxy for "building for the NDK" here because we don't have a good signal for that which works for both the NDK proper and the NDK-in-the-platform case. Test: imported into the NDK, built and tested NDK Bug: None Change-Id: I9ef3e19a8fa083bca0be47b80dfef7ba52a94866
2021-01-26Merge changes from topic "proc_madvise_framework"Edgar Arriaga
* changes: Add bionic headers for process_madvise Add a flag to distinguish shared VMAs
2021-01-26Merge SP1A.210122.003Chris Gross
Change-Id: I38a0c2cf0aed3762aafe4b1fa8a69dd03106fa39
2021-01-25[MemInit] Remove old API, introduce new MemInit API.Mitch Phillips
Introduces new heap-zero-init API. We've realised that it's better to be able to individually control MTE and heap zero-init. Having heap-zero-init not be controllable without affecting MTE affects our ability to turn off heap-zero-init in zygote-forked applications. Bug: 135772972 Test: On FVP: atest -s localhost:5555 malloc#zero_init \ Test: malloc#disable_mte heap_tagging_level Change-Id: I8c6722502733259934c699f4f1269eaf1641a09f
2021-01-21Guard __libc_current_sigrtmin/max with __builtin_available am: bb19208d66Jiyong Park
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1425571 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I250471726533e6d83d92fab106ff0b600774d8b0
2021-01-21__INTRODUCED_IN macros add the availability attribute am: 23bfed2a10Jiyong Park
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1425569 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I498f8560c2d25bd704ff10907631a8ffb14d5928
2021-01-21Merge changes from topic "future_symbol"Jiyong Park
* changes: crtbegin_static is built with min_sdk_version: "current" Guard __libc_current_sigrtmin/max with __builtin_available __INTRODUCED_IN macros add the availability attribute
2021-01-14Add bionic headers for process_madviseEdgar Arriaga
Test: atest bionic-unit-tests-static Bug: 173258203 Change-Id: I396945b95de364055b87cc53321aed4fad4ebc70
2021-01-15Guard __libc_current_sigrtmin/max with __builtin_availableJiyong Park
The two APIs were added for the API level 21 and beyond. Currently, its existence is tested using the null check which is done regardless of the min sdk version of the compilation unit. (which in turn required us to mark the API symbol weak regardless of the min sdk version.) Now, we have a better way of testing the API availability; __builtin_available. The null check is replaced with the call to the compiler-provided macro which determines if the code is running in a version of OS where the API is known to exist. Bug: 150860940 Bug: 134795810 Test: m Change-Id: Ib96c78f8d3cc71d7e755d1eab86051517bbbcc44
2021-01-15__INTRODUCED_IN macros add the availability attributeJiyong Park
__INTRODUCED_IN (and its variants) macro is used to mark the availability of an API symbol. The macros were used by the versioner tool for the NDK clients. When the Bionic headers are processed by the tool, APIs with the macros are guarded with __ANDROID_API__. e.g., void foo() __INTRDUCED_IN(30); is processed into \#if __ANDROID_API__ >= 30 void foo(); \#endif by the versioner. The macros however didn't play a role for other cases, e.g. OS components. This is too strict for NDK clients and too loose for the non-NDK clients. For the former, this completely hides the APIs that are newer than the min sdk version (__ANDROID_API__). For the latter, a call to such an API can be made without being guarded. This change is the first step towards a better way of handling the native APIs availability. The plan is that every NDK APIs are annotated with the availability attribute and callers are required to guard their API calls with a runtime check if the API is newer than the min sdk version of the caller. In this change, the macros now emits the availability attribute for the non-NDK clients (i.e. when not processed by versioner). Bug: 163288375 Bug: 134795810 Test: m Change-Id: I6eb2bce2bc2770cbfd69815e6816b6f25b3d6127
2021-01-14Make "disable memory mitigations" and "set heap tagging level" more available.Elliott Hughes
These were only available internally via android_mallopt(), but they're likely to be needed by more code in future, so move them into mallopt(). This change leaves the android_mallopt() options for now, but I plan on coming back to remove them after I've switched the handful of callers over to mallopt() instead. Bug: http://b/135772972 Test: treehugger Change-Id: Ia154614069a7623c6aca85975a91e6a156f04759
2021-01-07Fix things so that <features.h> can be used from assembler again.Elliott Hughes
Bug: https://github.com/android/ndk/issues/1422 Test: builds Change-Id: I1b94ffe688f3d420533074c94f7ffed606ca923f
2021-01-05Merge SP1A.210105.001Scott Lobdell
Change-Id: Ic65bdddcb53299975551b7d52de0812f546c3278
2020-12-14Update to v5.10 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.10 Test: Built cuttlefish and flame images. Ran bionic unit tests on both. Change-Id: I37ffc850970adcce1febbe2269c202632fce763a
2020-12-08Simplify and improve tempnam() and tmpnam().Elliott Hughes
They're both obsolescent in POSIX.1-2008, and you really shouldn't be using them, but since we can't actually delete them... This change makes them both obey $TMPDIR if set, and fall back to /data/local/tmp otherwise. That's as good as we've managed for anything else such as tmpfile(3). Also add some tests. Bug: http://b/174682340 Test: treehugger Change-Id: Ieef99dcc2062f84b2b7cbae046787fdfe975e772
2020-11-05Merge SP1A.201105.002Scott Lobdell
Change-Id: I456d5ca17dc0954ac1645c062740ab0b848bf50e
2020-10-19Update to v5.9 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.9 Test: Boots cuttlefish 64bit, passes 32 bit and 64 bit bionic unit tests. Change-Id: Ib5503355b238ea75595538e63eb000c867d06ef7
2020-10-15Merge SP1A.201015.001Scott Lobdell
Change-Id: I39bcf67f94cb5c7aa2ca5aff5e0a4d9abad57ab4
2020-09-25Merge "Enable BTI in bionic linker"Elliott Hughes
2020-09-24Copy the M_THREAD_DISABLE_MEM_INIT constant value into malloc.h.Peter Collingbourne
This will allow platform and application developers to use it. Bug: 163630045 Change-Id: If9a361cb97aaf62d3fa124b60f64d51d609af48d
2020-09-23Enable BTI in bionic linkerTamas Petz
This patch adds support to load BTI-enabled objects. According to the ABI, BTI is recorded in the .note.gnu.property section. The new parser evaluates the property section, if exists. It searches for .note section with NT_GNU_PROPERTY_TYPE_0. Once found it tries to find GNU_PROPERTY_AARCH64_FEATURE_1_AND. The results are cached. The main change in linker is when protection of loaded ranges gets applied. When BTI is requested and the platform also supports it the prot flags have to be amended with PROT_BTI for executable ranges. Failing to add PROT_BTI flag would disable BTI protection. Moreover, adding the new PROT flag for shared objects without BTI compatibility would break applications. Kernel does not add PROT_BTI to a loaded ELF which has interpreter. Linker handles this case too. Test: 1. Flame boots 2. Tested on FVP with BTI enabled Change-Id: Iafdf223b74c6e75d9f17ca90500e6fe42c4c1218
2020-09-21Merge SP1A.200921.001Justin DeMartino
Change-Id: Id2ab019914bb555dadf52c46b8403c0d5fb3c20a
2020-09-17Make it clearer that math.h isn't fdlibm.Elliott Hughes
It was originally based on fdlibm, but it's been through two different projects since then, and `git blame` shows basically nothing remaining from those days. Seems worth leaving something to explain the unusual copyright header though! Test: treehugger Change-Id: I8e7252a755704b866e7f36c8e97adc021fa3cdad
2020-09-08NGREG != ELF_NGREG.Elliott Hughes
Except they are the same on arm32/arm64, so we hadn't really noticed. x86 and x86-64 are quite different though, presumably by historical accident. Fix the definitions and add some static asserts. Bug: https://github.com/android/ndk/issues/1347 Test: treehugger Change-Id: Ic27b172066cf3443749463b9b73c912d204f9516
2020-09-01Merge SP1A.200727.001Daniel Norman
Change-Id: Iae7e5be602dbc976dea7cc572e65da2d507264ca
2020-08-17Add support for new scudo mallopt options.Christopher Ferris
Bug: 162092537 Test: Ran new unit tests. Change-Id: I4b7d17a9e98166c03cd153eb9e9d847693914ea3 Merged-In: I4b7d17a9e98166c03cd153eb9e9d847693914ea3 (cherry picked from commit 8844879212852a70918df1c9ebcac4d574f1fcd9) (cherry picked from commit 44f0faa247d9345bfd94472ee7d6b003f4c7864e)
2020-08-13Merge "Add a thread-properties API (Based on proposal at ↵Vy Nguyen
https://sourceware.org/glibc/wiki/ThreadPropertiesAPI)"
2020-08-12Merge "Cleanup for #inclusivefixit."Elliott Hughes
2020-08-11Add api-level.h to dac, improve docs.Dan Albert
We don't list most of bionic on dac since it would be overwhelming for the current layout, but this file in particular seems useful, especially __ANDROID_API__. Unfortunately, c2devsite doesn't include macro documentation. Until then, it's still useful to include the functions defined in this header. I've also elaborated a bit in the __ANDROID_API__ documentation, since the existing phrasing led to confusion over whether it was closer to minSdkVersion or compileSdkVersion. In practice these are identical for the NDK, but if we switch to weakly-linked APIs via the availability attribute that would change. Test: built docs, looked at them Bug: None Change-Id: I5cf78a6143b5c15790c369bdf888611e4c1189db
2020-08-11Add a thread-properties APIVy Nguyen
(Based on proposal at https://sourceware.org/glibc/wiki/ThreadPropertiesAPI) This includes API to: - locate static and dynamic TLS - register thread-exit and dynamic TLS creation/destruction callbacks Change-Id: Icd9d29a5b2f47495395645e19d3b2c96826f19c8
2020-08-10Merge "Reimplement our no-op utmp.h functions more simply."Elliott Hughes
2020-08-07Reimplement our no-op utmp.h functions more simply.Elliott Hughes
Now we're being marked down for our poor coverage, we may as well remove more broken cruft. Despite the amount of effort that seems to have gone into pututline(), it wasn't working with the other utmp.h functions (in particular, utmpname()), and wasn't declared in the header file! Test: treehugger Change-Id: I1a583984189c751168c11c01431433f96f8c548b
2020-08-07Make swab(3) inline prior to API 28.Dan Albert
Test: make checkbuild Bug: https://stackoverflow.com/q/54392471/632035 Change-Id: Iaeb55231ea2395d7e1e31be63034f5db19025060
2020-08-04Update to v5.8 kernel headers.Christopher Ferris
Kernel headers coming from: Git: https://android.googlesource.com/kernel/common/ Branch: android-mainline Tag: android-mainline-5.8 Test: NA Change-Id: I2231c877589820fc09800a200cf4ac62ba74b04c
2020-07-31More cleanup for #inclusivefixit.Elliott Hughes
Found manually with grep, since the script seems to miss stuff. Test: treehugger Change-Id: I5933cbade9792801d4a0bec1ccb077efa6ad8fbc