Commit graph

100 commits

Author SHA1 Message Date
Elliott Hughes
5270017ab3 Remove __INTRODUCED_IN_FUTURE.
This hasn't been particularly useful, we haven't used it consistently,
and it has caused trouble.

Test: builds
Change-Id: Ic5b5b5124af98aa8301e602fd75b0eb72a5fc7f6
2019-03-14 13:34:21 -07:00
Elliott Hughes
78e9ebc3b9 The future is now (2019 edition).
This year, we accidentally shipped NDK r20beta1 first :-(

Bug: https://github.com/android-ndk/ndk/issues/932
Test: builds
Change-Id: Id66a16ea09e7928843e61612fbdef09e72610d49
2019-03-14 09:29:52 -07:00
Torne (Richard Coles)
efbe9a5eef linker: allow using reserved space for multiple libraries.
Introduce a new flag ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE which
instructs the linker to use the reserved address space to load all of
the newly-loaded libraries required by a dlopen() call instead of only
the main library. They will be loaded consecutively into that region if
they fit. The RELRO sections of all the loaded libraries will also be
considered for reading/writing shared RELRO data.

This will allow the WebView implementation to potentially consist of
more than one .so file while still benefiting from the RELRO sharing
optimisation, which would otherwise only apply to the "root" .so file.

Test: bionic-unit-tests (existing and newly added)
Bug: 110790153
Change-Id: I61da775c29fd5017d9a1e2b6b3757c3d20a355b3
2019-02-20 17:29:36 -05:00
Elliott Hughes
0f57d561fe Fix a comment in <android/api-level.h>.
Bug: N/A
Test: N/A
Change-Id: Id6ef27caf8fe095d2be7fbf18fed74cc1334f86b
2018-11-15 15:07:13 -08: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
Elliott Hughes
8178c417f6 ART isn't using the ART-specific linker features any more.
Bug: N/A
Test: ran tests
Change-Id: Ide3c295035687019608a2c4716a4a21cb889d121
2018-11-06 11:15:17 -08:00
Logan Chien
aede30d316 libc: Add default __STRING implementation
This commit defines a default `__STRING()` definition.  There should be
a default definition because the unit test cases of versioner will
include `android/versioning.h` directly.  We cannot include
`sys/cdefs.h` in `android/versioning.h` either because that will lead to
circular inclusion.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: Ie99c0eef4414fd687347baf3a2d295468877464f
2018-10-23 21:47:34 +08:00
Florian Mayer
f7f71e3c7b Add RT signal to load heapprofd library.
Tests: Ran malloc_debug_unit_tests
Tests: Flashed to walleye, sent signal, observed
  "Unable to open shared library: heapprofd.so".

Change-Id: Ia8ce216837e29e3edbda8789ca28023d53fa1fda
2018-10-18 21:38:06 +01:00
Elliott Hughes
eb61430374 Don't #define __ANDROID_NDK__ for the platform build!
Caused an ODR violation trying to build current ToT of toybox.

Bug: N/A
Test: can successfully build code with `#ifdef __ANDROID_NDK__`
Change-Id: Ia80b8889b267779ee01f6257744e1794db0ebc65
2018-10-17 14:27:36 -07:00
Elliott Hughes
dd6763a6c6 Another round of documentation.
Bug: N/A
Test: N/A
Change-Id: I1b818fbb36ddd6d084dee56828290c2717a0c9b0
2018-10-04 16:35:13 -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
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
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
Josh Gao
ab6a0802af fdsan: add type for ART's FdFile.
Bug: http://b/113558485
Test: none
Change-Id: I9bc874d8689cc54563f2a5878d324b27ad85060e
2018-08-30 17:37:52 -07:00
Elliott Hughes
222ce95c8a Remove ARM/MIPS fenv duplication.
Bug: http://b/32709207
Test: ran tests
Change-Id: I58d354e9f8b1e6023427ba271bf39e4e24b7f8ab
2018-08-30 09:26:43 -07:00
Josh Gao
cd524ca71f Merge changes from topic "fdsan_abort_msg"
* changes:
  fdsan: provide abort message in warning tombstones.
  Implement pthread_sigqueue.
  Stringify api_level in <android/versioning.h>.
  Delete archaic pre-ANSI C support.
2018-08-28 20:20:21 +00:00
Treehugger Robot
ec247245de Merge changes from topic "bionic_fdsan_java"
* changes:
  fdsan: make the tag type values sequential.
  fdsan: expose functions to get and interpret tags.
2018-08-28 20:17:59 +00:00
Treehugger Robot
24107698b4 Merge "Add fdsan owner type for sqlite." 2018-08-28 00:16:34 +00:00
Josh Gao
f3aa3007e3 Stringify api_level in <android/versioning.h>.
Make it so that we can use __ANDROID_API_<letter>__ constants in
__INTRODUCED_IN macros.

Test: treehugger
Change-Id: I0929c01e23e58f51d12f73200e1daf5ef484ea5d
2018-08-27 16:48:17 -07:00
Elliott Hughes
4b9379c889 Merge "Start documenting libc." 2018-08-24 17:16:53 +00:00
Josh Gao
c1b4476808 fdsan: make the tag type values sequential.
In retrospect, allocating tag types from both ends will just make the
future creation of user-defined tags harder, because constants that are
introduced, and then used in previous versions might collide with
user-defined tags. Move all of the tag values to the front, so that we
can allocate from the end to minimize this.

Test: bionic_unit_tests
Change-Id: I5063adf8301b1063bd4931a6ce8b70dfe2411efd
2018-08-23 23:10:52 -07:00
Josh Gao
27cc4bc414 Add fdsan owner type for sqlite.
Test: none
Change-Id: Ib331d108e7e0431250eba3609f3557d8e4665aba
2018-08-23 23:10:52 -07:00
Josh Gao
b6b3a1d4f9 fdsan: expose functions to get and interpret tags.
Make it easier to write tests in users of fdsan by exposing functions
to allow users to get and interpret the tags.

Test: bionic_unit_tests
Change-Id: Iafa9bcaeb5e4db230f3dfec6f483274f34602694
2018-08-23 23:10:52 -07:00
Elliott Hughes
462e90cf4d Start documenting libc.
Bug: N/A
Test: N/A
Change-Id: I17345cb72a5ffc3af1688cf5874589cfb1e1fea0
2018-08-23 11:03:17 -07:00
Elliott Hughes
cf97d7f121 Folks are starting to need a placeholder name for Q.
Better to just have one place to update...

Bug: N/A
Test: builds
Change-Id: If7135d26f498b0841f9ae505bf6ca3ed05767345
2018-08-22 10:50:29 -07:00
Josh Gao
e899e798b8 Mark fdsan functions as __attribute__((weak)).
Make it so that users can check for availability of fdsan at runtime.

Bug: http://b/110100358
Test: treehugger
Test: make libjnitest
Change-Id: Ief3054161f3e255d048370975f7dd90cf7ad3687
2018-07-20 13:51:28 -07:00
Josh Gao
f6e5b58260 Introduce api to track fd ownership in libc.
Add two functions to allow objects that own a file descriptor to
enforce that only they can close their file descriptor.

Use them in FILE* and DIR*.

Bug: http://b/110100358
Test: bionic_unit_tests
Test: aosp/master boots without errors
Test: treehugger
Change-Id: Iecd6e8b26c62217271e0822dc3d2d7888b091a45
2018-07-19 14:28:54 -07:00
Dan Albert
da1994ced6 Add dlext.h to the libdl doc group.
Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/libdl
Bug: http://b/77236573
Change-Id: Ie09351ee961554488e34c79511712b07c345b8ad
2018-04-13 14:32:37 -07:00
Dan Albert
4d4a7832ad Add a few more legacy inlines for strto*_l.
These three functions are the only reason we need libandroid_support
post-L. Add these so we can remove it entirely for LP64 or users
targeting L+.

Test: make checkbuild
Test: build/soong/scripts/build-ndk-prebuilts.sh
Test: Imported the prebuilts generated from the above to the NDK,
      `./checkbuild.py && ./run_tests.py` with a handful of patches
      to remove libandroid_support for L+.
Bug: None

Change-Id: I39f8ee686bd76ebdb2fc3745b013d56175ba8ff0
2018-02-06 13:45:29 -08:00
Elliott Hughes
cc0fe6e8c0 The future is now (2018 edition).
Bug: N/A
Test: builds
Change-Id: Ic638e5b1f4e5901885fe7bc60b2a265817636b21
2018-01-30 08:54:12 -08:00
Elliott Hughes
5046e5fe87 Make the <android/dlext.h> docs show up on the web.
Just enough doxygen so that
https://developer.android.com/ndk/reference/dlext_8h.html won't be completely
devoid of all this.

Bug: N/A
Test: ran doxygen manually
Change-Id: I1e0667feae93227e32c1bd671065359f5be85d9d
2018-01-25 15:48:32 -08:00
Dan Albert
989d804859 Reland "Cleanup transitive includes in the legacy inlines."
This reverts commit 54c71521b5.

Bug: None
Test: make checkbuild
Change-Id: Ica6a4f7ecadfcc854160a60a5db1b44ae3b6c821
2018-01-18 23:39:48 +00:00
Joachim Sauer
54c71521b5 Revert "Revert "Revert "Revert "Revert "Cleanup transitive includes in the legacy inlines."""""
This reverts commit a074ac79d7.

Reason for revert: Broke several builds.

Change-Id: I406f0b0aa0c37961ad031d2f6c5ea4241f3f1111
2018-01-18 11:37:34 +00:00
Dan Albert
a074ac79d7 Revert "Revert "Revert "Revert "Cleanup transitive includes in the legacy inlines.""""
This reverts commit b37e9aa9a6.

Reason for revert: trying again
Test: make native
Change-Id: Ide23f0a752fd6ca88e44449e996eb5809db6712d
2018-01-11 09:43:23 -08:00
Ryan Prichard
51a7fe8fbd Mark abs/labs/llabs as 19+ rather than 21+
The libc.map.txt file already defines these three functions as having
been introduced in API 19, but these header files had declared them as
21 and up.

See https://android-review.googlesource.com/c/platform/development/+/233407

imaxabs is already declared as 19 and up.

Test: build-ndk-prebuilts.sh && ./update_platform.py &&
  checkbuild.py && run_tests.py
Test: manually build app against 18 and 19

Change-Id: Iaeed48d7e6c438d816635a0433a056e557e8ebc2
2018-01-08 17:46:27 -08:00
Elliott Hughes
b6c7f6e595 Fix arm/arm64 <fenv.h> to match current reality.
ARM stopped supporting enabling of FP exceptions years ago.

Bug: http://b/68832485
Test: ran tests
Change-Id: I8450baa78e04d994c352180975b0a1ecd5a9f662
2017-11-03 16:46:32 -07:00
Dan Albert
b37e9aa9a6 Revert "Revert "Revert "Cleanup transitive includes in the legacy inlines."""
This reverts commit f945fb6b8a.

Reason for revert: haven't fixed all the builds yet

Change-Id: I55aff5d0290c27691427d91a8e46ae01c87da6b2
2017-10-24 09:20:41 +00:00
Dan Albert
f945fb6b8a Revert "Revert "Cleanup transitive includes in the legacy inlines.""
This reverts commit 9cb8639b18.

Fixed all the broken builds that were reported to me before this was
reverted.

Test: make checkbuild  # kikey960, marlin, aosp_arm64; master and aosp
2017-10-17 11:07:26 -07:00
Orion Hodson
9cb8639b18 Revert "Cleanup transitive includes in the legacy inlines."
This reverts commit 43df953502.

Reason for revert: Breaks most AOSP builds.
https://android-build.googleplex.com/builds/branch-dashboard/aosp-master?build_id=4399910

Change-Id: I53459f97b7dffb1f7f602db03893564dd3cfe6bf
2017-10-17 08:41:23 +00:00
Dan Albert
43df953502 Cleanup transitive includes in the legacy inlines.
We don't want to be exposing so much through the headers for the
implementation details unless we have to.

Test: make checkbuild
Bug: None
Change-Id: Ieca9cd8106725e08887a3e9fde60d1eef64ef98b
2017-10-13 14:39:03 -07:00
Dan Albert
8c2323c697 Fix "Add a legacy inline for mmap64".
Autosubmit fired before the CL was actually ready (forgot to hit "y"
on the repo upload).

Test: make checkbuild
Test: copied into the NDK and ran mmap64_fob64 test.
Bug: lots
Change-Id: I8c0400a703f319e8e230f7ba9178009ed7c88be0
2017-10-06 16:01:36 -07:00
Dan Albert
a613d0df5c Add a legacy inline for mmap64.
While this was never an inline, this function alone has caused most of
the bug reports related to _FILE_OFFSET_BITS=64. Providing an inline
for it should allow a lot more code to build with _FILE_OFFSET_BITS=64
when targeting pre-L.

Test: make checkbuild
Test: built trivial cc_binary for LP32 against API 14 with
      _FILE_OFFSET_BITS=64 set
Bug: lots
Change-Id: I8479d34af4da358c11423bee43d45b59e9d4143e
2017-10-05 23:41:47 -07:00
John Reck
a0c7ec8080 Add O MR1 define
Bug: 64394076
Test: none
Change-Id: Ice3991c626dd2cce93c9a571ba529fa5b0129492
2017-10-02 08:14:56 -07:00
Elliott Hughes
2f94a29d9c Rename _Exit in a way that works with libandroid_support.
Bug: N/A
Test: builds
Change-Id: I2aeaf9bafe7d51e91b67f22d68f4e52191df062b
2017-09-19 18:34:40 +00:00
Elliott Hughes
faa74342e3 Name function arguments in libc headers for Studio.
First batch of headers...

Bug: http://b/64613623
Test: builds
Change-Id: I6bc3ad79daa635456b61d03b1f43f06c433ec596
2017-08-11 17:45:59 -07:00
Dan Albert
cd8828c346 Put back the _Exit rename for pre-L.
Somehow I accidentally removed this in
https://android-review.googlesource.com/c/445150.

Test: make checkbuild
Bug: None
Change-Id: Ia6744af6c7b6dc2f149e9eab6e1f39863f96f6ca
2017-08-07 14:47:00 -07:00
Treehugger Robot
9faa95c9eb Merge "Fix error condition on strtof inline." 2017-07-27 02:40:40 +00:00
Dan Albert
bd3f657e56 Fix error condition on strtof inline.
Test: make checkbuild
Test: pull into ndk, ./run_tests.py
Bug: https://github.com/android-ndk/ndk/issues/415
Change-Id: I1575f799c9e849d66456c785208a36709a7b8122
2017-07-26 17:21:47 -07:00
Dan Albert
f66fa495a8 Add __ANDROID_NDK__ to identify using the NDK.
I've added some things like __ANDROID_MAJOR__ to an ndk-version.h, but
that is only in the NDK itself and so doesn't help the platform. Add
__ANDROID_NDK__ to identify that you're building for the NDK and not
the platform.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/407
Change-Id: I2d1f1c28e3764e4e658cf675b290b7a17253ee33
2017-07-26 14:27:43 -07:00
Elliott Hughes
e76ff925df Merge "Make inline tcsetattr definition match constants." 2017-07-10 20:40:53 +00:00