Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 021dd1c

Browse files
enh-googleGerrit Code Review
authored andcommitted
Merge "Fix uses of the deprecated API level names in the implementation." into main
2 parents 1fb9272 + a7637a8 commit 021dd1c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

libc/bionic/libc_init_common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ void __libc_init_fork_handler() {
210210

211211
extern "C" void scudo_malloc_set_add_large_allocation_slack(int add_slack);
212212

213-
__BIONIC_WEAK_FOR_NATIVE_BRIDGE void __libc_set_target_sdk_version(int target __unused) {
213+
__BIONIC_WEAK_FOR_NATIVE_BRIDGE void __libc_set_target_sdk_version(int target_api_level __unused) {
214214
#if defined(USE_SCUDO) && !__has_feature(hwaddress_sanitizer)
215-
scudo_malloc_set_add_large_allocation_slack(target < __ANDROID_API_S__);
215+
scudo_malloc_set_add_large_allocation_slack(target_api_level < 31);
216216
#endif
217217
}
218218

libc/bionic/pthread_create.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void __set_stack_and_tls_vma_name(bool is_main_thread) {
349349
extern "C" int __rt_sigprocmask(int, const sigset64_t*, sigset64_t*, size_t);
350350

351351
__attribute__((no_sanitize("hwaddress")))
352-
#ifdef __aarch64__
352+
#if defined(__aarch64__)
353353
// This function doesn't return, but it does appear in stack traces. Avoid using return PAC in this
354354
// function because we may end up resetting IA, which may confuse unwinders due to mismatching keys.
355355
__attribute__((target("branch-protection=bti")))
@@ -368,13 +368,13 @@ static int __pthread_start(void* arg) {
368368
__set_stack_and_tls_vma_name(false);
369369
__init_additional_stacks(thread);
370370
__rt_sigprocmask(SIG_SETMASK, &thread->start_mask, nullptr, sizeof(thread->start_mask));
371-
#ifdef __aarch64__
371+
#if defined(__aarch64__)
372372
// Chrome's sandbox prevents this prctl, so only reset IA if the target SDK level is high enough.
373373
// Furthermore, processes loaded from vendor partitions may have their own sandboxes that would
374-
// reject the prctl. Because no devices launched with PAC enabled before S, we can avoid issues on
375-
// upgrading devices by checking for PAC support before issuing the prctl.
374+
// reject the prctl. Because no devices launched with PAC enabled before API level 31, we can
375+
// avoid issues on upgrading devices by checking for PAC support before issuing the prctl.
376376
static const bool pac_supported = getauxval(AT_HWCAP) & HWCAP_PACA;
377-
if (pac_supported && android_get_application_target_sdk_version() >= __ANDROID_API_S__) {
377+
if (pac_supported && android_get_application_target_sdk_version() >= 31) {
378378
prctl(PR_PAC_RESET_KEYS, PR_PAC_APIAKEY, 0, 0, 0);
379379
}
380380
#endif

0 commit comments

Comments
 (0)